From e49e64cee55f23e777bdff718169b66d5ef48334 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 22 Oct 2024 16:04:07 +0000 Subject: [PATCH] CodeGen from PR 31127 in Azure/azure-rest-api-specs Merge b1b9f888f9126b62975361252d0cddbb63a566cd into d1dc8a3c92c2725c4854f9c4189b08fe3c0ca4c8 --- .../Configuration.json | 12 + .../tsp-location.yaml | 4 + .../tspCodeModel.json | 16987 ++++++++++++++++ ...zure.AI.Language.Authoring.Analyzetext.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 107 + ...e.AI.Language.Authoring.Analyzetext.csproj | 20 + ...oringAnalyzetextClientBuilderExtensions.cs | 52 + ...anguageAuthoringAnalyzetextModelFactory.cs | 1362 ++ .../Generated/Docs/TextAnalysisAuthoring.xml | 5717 ++++++ .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 398 + .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...eploymentResourcesOptions.Serialization.cs | 145 + .../AssignDeploymentResourcesOptions.cs | 76 + ...ssignedDeploymentResource.Serialization.cs | 143 + .../Models/AssignedDeploymentResource.cs | 82 + ...ProjectDeploymentMetadata.Serialization.cs | 151 + .../AssignedProjectDeploymentMetadata.cs | 87 + ...rojectDeploymentsMetadata.Serialization.cs | 153 + .../AssignedProjectDeploymentsMetadata.cs | 83 + .../Generated/Models/CompositionSetting.cs | 57 + .../Models/ConfusionMatrix.Serialization.cs | 121 + .../src/Generated/Models/ConfusionMatrix.cs | 69 + .../ConfusionMatrixCell.Serialization.cs | 143 + .../Generated/Models/ConfusionMatrixCell.cs | 78 + .../ConfusionMatrixRow.Serialization.cs | 121 + .../Generated/Models/ConfusionMatrixRow.cs | 69 + ...ojectAuthorizationRequest.Serialization.cs | 161 + .../Models/CopyProjectAuthorizationRequest.cs | 86 + .../CopyProjectOptions.Serialization.cs | 182 + .../Generated/Models/CopyProjectOptions.cs | 111 + .../CreateDeploymentOptions.Serialization.cs | 160 + .../Models/CreateDeploymentOptions.cs | 88 + .../CreateProjectOptions.Serialization.cs | 208 + .../Generated/Models/CreateProjectOptions.cs | 116 + ...nDocumentEvaluationResult.Serialization.cs | 159 + ...tityRecognitionDocumentEvaluationResult.cs | 61 + ...ognitionEvaluationSummary.Serialization.cs | 151 + ...ustomEntityRecognitionEvaluationSummary.cs | 47 + ...eDocumentEvaluationResult.Serialization.cs | 159 + ...ustomHealthcareDocumentEvaluationResult.cs | 61 + ...althcareEvaluationSummary.Serialization.cs | 151 + .../CustomHealthcareEvaluationSummary.cs | 47 + ...nDocumentEvaluationResult.Serialization.cs | 159 + ...lClassificationDocumentEvaluationResult.cs | 61 + ...ficationEvaluationSummary.Serialization.cs | 151 + ...ltiLabelClassificationEvaluationSummary.cs | 50 + ...nDocumentEvaluationResult.Serialization.cs | 159 + ...lClassificationDocumentEvaluationResult.cs | 61 + ...ficationEvaluationSummary.Serialization.cs | 151 + ...gleLabelClassificationEvaluationSummary.cs | 50 + ...tDocumentEvaluationResult.Serialization.cs | 159 + ...omTextSentimentDocumentEvaluationResult.cs | 58 + ...entimentEvaluationSummary.Serialization.cs | 151 + .../CustomTextSentimentEvaluationSummary.cs | 47 + ...aGenerationConnectionInfo.Serialization.cs | 151 + .../Models/DataGenerationConnectionInfo.cs | 87 + .../DataGenerationConnectionInfoKind.cs | 48 + .../DataGenerationSettings.Serialization.cs | 143 + .../Models/DataGenerationSettings.cs | 81 + .../DeleteDeploymentOptions.Serialization.cs | 152 + .../Models/DeleteDeploymentOptions.cs | 78 + .../DeploymentResource.Serialization.cs | 143 + .../Generated/Models/DeploymentResource.cs | 82 + ...tityLabelEvaluationResult.Serialization.cs | 151 + .../DocumentEntityLabelEvaluationResult.cs | 87 + ...cognitionEvaluationResult.Serialization.cs | 145 + ...cumentEntityRecognitionEvaluationResult.cs | 76 + ...ityRegionEvaluationResult.Serialization.cs | 179 + .../DocumentEntityRegionEvaluationResult.cs | 98 + .../DocumentEvaluationResult.Serialization.cs | 134 + .../Models/DocumentEvaluationResult.cs | 102 + ...ealthcareEvaluationResult.Serialization.cs | 145 + .../DocumentHealthcareEvaluationResult.cs | 76 + ...ificationEvaluationResult.Serialization.cs | 163 + ...ultiLabelClassificationEvaluationResult.cs | 86 + ...mentLabelEvaluationResult.Serialization.cs | 151 + .../DocumentSentimentLabelEvaluationResult.cs | 84 + ...ificationEvaluationResult.Serialization.cs | 143 + ...ngleLabelClassificationEvaluationResult.cs | 85 + ...SentimentEvaluationResult.Serialization.cs | 163 + .../DocumentTextSentimentEvaluationResult.cs | 86 + .../EntityEvaluationSummary.Serialization.cs | 191 + .../Models/EntityEvaluationSummary.cs | 108 + ...ognitionEvaluationSummary.Serialization.cs | 211 + .../EntityRecognitionEvaluationSummary.cs | 166 + .../Generated/Models/Error.Serialization.cs | 200 + .../src/Generated/Models/Error.cs | 100 + .../src/Generated/Models/ErrorCode.cs | 99 + .../EvaluationJobResult.Serialization.cs | 159 + .../Generated/Models/EvaluationJobResult.cs | 95 + .../src/Generated/Models/EvaluationKind.cs | 54 + .../Models/EvaluationOptions.Serialization.cs | 172 + .../src/Generated/Models/EvaluationOptions.cs | 91 + .../Models/EvaluationSummary.Serialization.cs | 132 + .../src/Generated/Models/EvaluationSummary.cs | 83 + .../Models/ExportedClass.Serialization.cs | 138 + .../src/Generated/Models/ExportedClass.cs | 65 + .../ExportedCompositeEntity.Serialization.cs | 193 + .../Models/ExportedCompositeEntity.cs | 78 + ...tiveSummarizationDocument.Serialization.cs | 168 + ...dCustomAbstractiveSummarizationDocument.cs | 104 + ...ummarizationProjectAssets.Serialization.cs | 160 + ...omAbstractiveSummarizationProjectAssets.cs | 35 + ...EntityRecognitionDocument.Serialization.cs | 185 + ...ExportedCustomEntityRecognitionDocument.cs | 86 + ...yRecognitionProjectAssets.Serialization.cs | 185 + ...tedCustomEntityRecognitionProjectAssets.cs | 40 + ...dCustomHealthcareDocument.Serialization.cs | 185 + .../ExportedCustomHealthcareDocument.cs | 86 + ...omHealthcareProjectAssets.Serialization.cs | 185 + .../ExportedCustomHealthcareProjectAssets.cs | 40 + ...belClassificationDocument.Serialization.cs | 185 + ...dCustomMultiLabelClassificationDocument.cs | 86 + ...assificationProjectAssets.Serialization.cs | 185 + ...omMultiLabelClassificationProjectAssets.cs | 40 + ...belClassificationDocument.Serialization.cs | 175 + ...CustomSingleLabelClassificationDocument.cs | 88 + ...assificationProjectAssets.Serialization.cs | 185 + ...mSingleLabelClassificationProjectAssets.cs | 40 + ...stomTextSentimentDocument.Serialization.cs | 185 + .../ExportedCustomTextSentimentDocument.cs | 86 + ...extSentimentProjectAssets.Serialization.cs | 160 + ...xportedCustomTextSentimentProjectAssets.cs | 35 + .../ExportedDocumentClass.Serialization.cs | 138 + .../Generated/Models/ExportedDocumentClass.cs | 65 + ...portedDocumentEntityLabel.Serialization.cs | 168 + .../Models/ExportedDocumentEntityLabel.cs | 73 + ...ortedDocumentEntityRegion.Serialization.cs | 182 + .../Models/ExportedDocumentEntityRegion.cs | 74 + ...tedDocumentSentimentLabel.Serialization.cs | 172 + .../Models/ExportedDocumentSentimentLabel.cs | 73 + .../Models/ExportedEntity.Serialization.cs | 149 + .../src/Generated/Models/ExportedEntity.cs | 69 + .../ExportedEntityList.Serialization.cs | 152 + .../Generated/Models/ExportedEntityList.cs | 66 + ...ExportedEntityListSynonym.Serialization.cs | 163 + .../Models/ExportedEntityListSynonym.cs | 78 + .../ExportedEntitySublist.Serialization.cs | 163 + .../Generated/Models/ExportedEntitySublist.cs | 70 + .../ExportedModelManifest.Serialization.cs | 145 + .../Generated/Models/ExportedModelManifest.cs | 76 + .../ExportedModelOptions.Serialization.cs | 135 + .../Generated/Models/ExportedModelOptions.cs | 75 + .../ExportedPrebuiltEntity.Serialization.cs | 135 + .../Models/ExportedPrebuiltEntity.cs | 75 + .../Models/ExportedProject.Serialization.cs | 166 + .../src/Generated/Models/ExportedProject.cs | 109 + .../ExportedProjectAssets.Serialization.cs | 131 + .../Generated/Models/ExportedProjectAssets.cs | 69 + .../ExportedTrainedModel.Serialization.cs | 182 + .../Generated/Models/ExportedTrainedModel.cs | 107 + ...ntResourcesStatusResponse.Serialization.cs | 223 + ...AssignDeploymentResourcesStatusResponse.cs | 98 + ...CopyProjectStatusResponse.Serialization.cs | 223 + .../Models/GetCopyProjectStatusResponse.cs | 98 + ...omResourcesStatusResponse.Serialization.cs | 223 + ...oymentDeleteFromResourcesStatusResponse.cs | 98 + .../GetDeploymentResponse.Serialization.cs | 192 + .../Generated/Models/GetDeploymentResponse.cs | 108 + ...tDeploymentStatusResponse.Serialization.cs | 223 + .../Models/GetDeploymentStatusResponse.cs | 98 + ...tEvaluationStatusResponse.Serialization.cs | 232 + .../Models/GetEvaluationStatusResponse.cs | 107 + .../GetExportStatusResponse.Serialization.cs | 235 + .../Models/GetExportStatusResponse.cs | 102 + ...tedModelJobStatusResponse.Serialization.cs | 223 + .../GetExportedModelJobStatusResponse.cs | 98 + .../GetExportedModelResponse.Serialization.cs | 173 + .../Models/GetExportedModelResponse.cs | 100 + .../GetImportStatusResponse.Serialization.cs | 223 + .../Models/GetImportStatusResponse.cs | 98 + ...oadSnapshotStatusResponse.Serialization.cs | 223 + .../Models/GetLoadSnapshotStatusResponse.cs | 98 + ...ectDeletionStatusResponse.Serialization.cs | 223 + .../GetProjectDeletionStatusResponse.cs | 98 + .../GetProjectResponse.Serialization.cs | 249 + .../Generated/Models/GetProjectResponse.cs | 129 + ...DeploymentsStatusResponse.Serialization.cs | 223 + .../GetSwapDeploymentsStatusResponse.cs | 98 + .../GetTrainedModelResponse.Serialization.cs | 182 + .../Models/GetTrainedModelResponse.cs | 106 + ...GetTrainingStatusResponse.Serialization.cs | 232 + .../Models/GetTrainingStatusResponse.cs | 107 + ...ntResourcesStatusResponse.Serialization.cs | 223 + ...assignDeploymentResourcesStatusResponse.cs | 98 + .../src/Generated/Models/InnerErrorCode.cs | 87 + .../Models/InnerErrorModel.Serialization.cs | 201 + .../src/Generated/Models/InnerErrorModel.cs | 104 + .../src/Generated/Models/JobStatus.cs | 66 + .../Models/ModelFile.Serialization.cs | 143 + .../src/Generated/Models/ModelFile.cs | 82 + ...belClassEvaluationSummary.Serialization.cs | 191 + .../MultiLabelClassEvaluationSummary.cs | 111 + ...ficationEvaluationSummary.Serialization.cs | 202 + ...ltiLabelClassificationEvaluationSummary.cs | 147 + .../Models/PrebuiltEntity.Serialization.cs | 151 + .../src/Generated/Models/PrebuiltEntity.cs | 89 + .../Models/ProjectDeployment.Serialization.cs | 201 + .../src/Generated/Models/ProjectDeployment.cs | 115 + .../src/Generated/Models/ProjectKind.cs | 83 + .../Models/ProjectMetadata.Serialization.cs | 258 + .../src/Generated/Models/ProjectMetadata.cs | 136 + .../Models/ProjectSettings.Serialization.cs | 204 + .../src/Generated/Models/ProjectSettings.cs | 89 + .../ProjectTrainedModel.Serialization.cs | 191 + .../Generated/Models/ProjectTrainedModel.cs | 113 + .../Models/ResourceMetadata.Serialization.cs | 151 + .../src/Generated/Models/ResourceMetadata.cs | 89 + .../src/Generated/Models/Sentiment.cs | 54 + ...entimentEvaluationSummary.Serialization.cs | 191 + .../Models/SentimentEvaluationSummary.cs | 108 + ...belClassEvaluationSummary.Serialization.cs | 191 + .../SingleLabelClassEvaluationSummary.cs | 111 + ...ficationEvaluationSummary.Serialization.cs | 211 + ...gleLabelClassificationEvaluationSummary.cs | 169 + ...entimentEvaluationSummary.Serialization.cs | 211 + .../Models/SpanSentimentEvaluationSummary.cs | 166 + .../src/Generated/Models/StringIndexType.cs | 52 + .../SubTrainingJobState.Serialization.cs | 173 + .../Generated/Models/SubTrainingJobState.cs | 86 + .../Models/SupportedLanguage.Serialization.cs | 143 + .../src/Generated/Models/SupportedLanguage.cs | 91 + .../SwapDeploymentsOptions.Serialization.cs | 143 + .../Models/SwapDeploymentsOptions.cs | 82 + ...entimentEvaluationSummary.Serialization.cs | 191 + .../Models/TextSentimentEvaluationSummary.cs | 147 + .../TrainingConfigVersion.Serialization.cs | 143 + .../Generated/Models/TrainingConfigVersion.cs | 81 + .../TrainingJobOptions.Serialization.cs | 173 + .../Generated/Models/TrainingJobOptions.cs | 98 + .../Models/TrainingJobResult.Serialization.cs | 187 + .../src/Generated/Models/TrainingJobResult.cs | 97 + .../Models/TrainingJobState.Serialization.cs | 241 + .../src/Generated/Models/TrainingJobState.cs | 114 + ...eploymentResourcesOptions.Serialization.cs | 145 + .../UnassignDeploymentResourcesOptions.cs | 76 + ...nDocumentEvaluationResult.Serialization.cs | 151 + .../Models/UnknownDocumentEvaluationResult.cs | 34 + .../UnknownEvaluationSummary.Serialization.cs | 143 + .../Models/UnknownEvaluationSummary.cs | 29 + ...nownExportedProjectAssets.Serialization.cs | 135 + .../Models/UnknownExportedProjectAssets.cs | 28 + .../Generated/Models/Warning.Serialization.cs | 143 + .../src/Generated/Models/Warning.cs | 82 + .../src/Generated/TextAnalysisAuthoring.cs | 6850 +++++++ .../src/Generated/TextClient.cs | 115 + .../src/Generated/TextClientOptions.cs | 43 + .../src/Properties/AssemblyInfo.cs | 11 + ...anguage.Authoring.Analyzetext.Tests.csproj | 20 + .../Samples/Samples_TextAnalysisAuthoring.cs | 6284 ++++++ .../tsp-location.yaml | 4 + .../authoring/analyzetext/ci.yml | 35 + 258 files changed, 68343 insertions(+) create mode 100644 sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/Configuration.json create mode 100644 sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/tsp-location.yaml create mode 100644 sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/tspCodeModel.json create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/Azure.AI.Language.Authoring.Analyzetext.sln create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/CHANGELOG.md create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/Directory.Build.props create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/README.md create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Azure.AI.Language.Authoring.Analyzetext.csproj create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextClientBuilderExtensions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextModelFactory.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Docs/TextAnalysisAuthoring.xml create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Argument.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Optional.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CompositionSetting.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfoKind.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Error.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Error.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ErrorCode.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationKind.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorCode.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/JobStatus.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectKind.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Sentiment.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/StringIndexType.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesOptions.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Warning.Serialization.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Warning.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextAnalysisAuthoring.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextClient.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextClientOptions.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Properties/AssemblyInfo.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tests/Azure.AI.Language.Authoring.Analyzetext.Tests.csproj create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tsp-location.yaml create mode 100644 sdk/cognitivelanguage/authoring/analyzetext/ci.yml diff --git a/sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/Configuration.json b/sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/Configuration.json new file mode 100644 index 0000000000000..721d992c60da1 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.AI.Language.Authoring.Analyzeconversations", + "library-name": "Azure.AI.Language.Authoring.Analyzeconversations", + "model-namespace": true, + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ] +} diff --git a/sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/tsp-location.yaml b/sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/tsp-location.yaml new file mode 100644 index 0000000000000..738841b90847a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/Language.AnalyzeConversations-authoring +commit: 11ee10edbbbea725125259fe527bf865e62f2e4a +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/tspCodeModel.json b/sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/tspCodeModel.json new file mode 100644 index 0000000000000..9a42e07921be8 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzeconversations/Azure.AI.Language.Authoring.Analyzeconversations/tspCodeModel.json @@ -0,0 +1,16987 @@ +{ + "$id": "1", + "Name": "Language.Authoring.Conversations", + "ApiVersions": [ + "2023-04-01", + "2023-04-15-preview", + "2024-11-15-preview" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "ProjectKind", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ProjectKind", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "Conversation", + "value": "Conversation", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "A project to build natural language into apps, bots, and IoT devices.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "Orchestration", + "value": "Orchestration", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "A project to connect and orchestrate Conversation, Custom question answering and LUIS projects together in one single project.", + "decorators": [] + }, + { + "$id": "8", + "kind": "enumvalue", + "name": "CustomConversationSummarization", + "value": "CustomConversationSummarization", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "A project to build conversation summarization models which are able to summarize long conversations.", + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,JsonMergePatch,Json", + "decorators": [] + }, + { + "$id": "10", + "kind": "enum", + "name": "ErrorCode", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ErrorCode", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "12", + "kind": "enumvalue", + "name": "InvalidRequest", + "value": "InvalidRequest", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "InvalidArgument", + "value": "InvalidArgument", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "Unauthorized", + "value": "Unauthorized", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "Forbidden", + "value": "Forbidden", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "NotFound", + "value": "NotFound", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "22", + "kind": "enumvalue", + "name": "ProjectNotFound", + "value": "ProjectNotFound", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "24", + "kind": "enumvalue", + "name": "OperationNotFound", + "value": "OperationNotFound", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "AzureCognitiveSearchNotFound", + "value": "AzureCognitiveSearchNotFound", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "28", + "kind": "enumvalue", + "name": "AzureCognitiveSearchIndexNotFound", + "value": "AzureCognitiveSearchIndexNotFound", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "TooManyRequests", + "value": "TooManyRequests", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "AzureCognitiveSearchThrottling", + "value": "AzureCognitiveSearchThrottling", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "34", + "kind": "enumvalue", + "name": "AzureCognitiveSearchIndexLimitReached", + "value": "AzureCognitiveSearchIndexLimitReached", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "36", + "kind": "enumvalue", + "name": "InternalServerError", + "value": "InternalServerError", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "ServiceUnavailable", + "value": "ServiceUnavailable", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "40", + "kind": "enumvalue", + "name": "Timeout", + "value": "Timeout", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "42", + "kind": "enumvalue", + "name": "QuotaExceeded", + "value": "QuotaExceeded", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "Conflict", + "value": "Conflict", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "Warning", + "value": "Warning", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "10" + }, + "decorators": [] + } + ], + "description": "Human-readable error code.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "48", + "kind": "enum", + "name": "InnerErrorCode", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.InnerErrorCode", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "50", + "kind": "enumvalue", + "name": "InvalidRequest", + "value": "InvalidRequest", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "52", + "kind": "enumvalue", + "name": "InvalidParameterValue", + "value": "InvalidParameterValue", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "54", + "kind": "enumvalue", + "name": "KnowledgeBaseNotFound", + "value": "KnowledgeBaseNotFound", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "AzureCognitiveSearchNotFound", + "value": "AzureCognitiveSearchNotFound", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "AzureCognitiveSearchThrottling", + "value": "AzureCognitiveSearchThrottling", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "60", + "kind": "enumvalue", + "name": "ExtractionFailure", + "value": "ExtractionFailure", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "62", + "kind": "enumvalue", + "name": "InvalidRequestBodyFormat", + "value": "InvalidRequestBodyFormat", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "EmptyRequest", + "value": "EmptyRequest", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "66", + "kind": "enumvalue", + "name": "MissingInputDocuments", + "value": "MissingInputDocuments", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "68", + "kind": "enumvalue", + "name": "InvalidDocument", + "value": "InvalidDocument", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "ModelVersionIncorrect", + "value": "ModelVersionIncorrect", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "InvalidDocumentBatch", + "value": "InvalidDocumentBatch", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "UnsupportedLanguageCode", + "value": "UnsupportedLanguageCode", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + }, + { + "$id": "76", + "kind": "enumvalue", + "name": "InvalidCountryHint", + "value": "InvalidCountryHint", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "48" + }, + "decorators": [] + } + ], + "description": "Human-readable error code.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "78", + "kind": "enum", + "name": "ExportedProjectFormat", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ExportedProjectFormat", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "80", + "kind": "enumvalue", + "name": "Conversation", + "value": "Conversation", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "description": "Specifies the format for a conversational project.", + "decorators": [] + }, + { + "$id": "82", + "kind": "enumvalue", + "name": "Luis", + "value": "Luis", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "78" + }, + "description": "Specifies the format for an application that was exported from LUIS.", + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "84", + "kind": "enum", + "name": "StringIndexType", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.StringIndexType", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "86", + "kind": "enumvalue", + "name": "Utf16CodeUnit", + "value": "Utf16CodeUnit", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "84" + }, + "description": "The offset and length values will correspond to UTF-16 code units. Use this\noption if your application is written in a language that support Unicode, for\nexample Java, JavaScript.", + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "88", + "kind": "enum", + "name": "CompositionSetting", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.CompositionSetting", + "valueType": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "90", + "kind": "enumvalue", + "name": "returnLongestOverlap", + "value": "returnLongestOverlap", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "88" + }, + "description": "When two or more components are found in the text and overlap, the component\nwith the longest set of characters is returned.", + "decorators": [] + }, + { + "$id": "92", + "kind": "enumvalue", + "name": "requireExactOverlap", + "value": "requireExactOverlap", + "valueType": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "88" + }, + "description": "All components must overlap at the exact same characters in the text for the\nentity to return. If one of the defined components is not matched or predicted,\nthe entity will not return.", + "decorators": [] + }, + { + "$id": "94", + "kind": "enumvalue", + "name": "separateComponents", + "value": "separateComponents", + "valueType": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "88" + }, + "description": "Every component's match or prediction is returned as a separate instance of the\nentity.", + "decorators": [] + }, + { + "$id": "96", + "kind": "enumvalue", + "name": "combineComponents", + "value": "combineComponents", + "valueType": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "88" + }, + "description": "When two or more components are found in the text and overlap, the components'\nspans are merged together into one span combining all of them.", + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "98", + "kind": "enum", + "name": "OrchestrationTargetProjectKind", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.OrchestrationTargetProjectKind", + "valueType": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "100", + "kind": "enumvalue", + "name": "Luis", + "value": "Luis", + "valueType": { + "$id": "101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "98" + }, + "decorators": [] + }, + { + "$id": "102", + "kind": "enumvalue", + "name": "Conversation", + "value": "Conversation", + "valueType": { + "$id": "103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "98" + }, + "decorators": [] + }, + { + "$id": "104", + "kind": "enumvalue", + "name": "QuestionAnswering", + "value": "QuestionAnswering", + "valueType": { + "$id": "105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "98" + }, + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "106", + "kind": "enum", + "name": "TrainingMode", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.TrainingMode", + "valueType": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "108", + "kind": "enumvalue", + "name": "advanced", + "value": "advanced", + "valueType": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "106" + }, + "description": "Trains using fine-tuned neural network transformer models. Can train\nmultilingual projects.", + "decorators": [] + }, + { + "$id": "110", + "kind": "enumvalue", + "name": "standard", + "value": "standard", + "valueType": { + "$id": "111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "106" + }, + "description": "Faster training times for quicker iterations.", + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "112", + "kind": "enum", + "name": "EvaluationKind", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.EvaluationKind", + "valueType": { + "$id": "113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "114", + "kind": "enumvalue", + "name": "percentage", + "value": "percentage", + "valueType": { + "$id": "115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "description": "Split the data into training and test sets according to user-defined\npercentages.", + "decorators": [] + }, + { + "$id": "116", + "kind": "enumvalue", + "name": "manual", + "value": "manual", + "valueType": { + "$id": "117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "description": "Split the data according to the chosen dataset for every example in the data.", + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "118", + "kind": "enum", + "name": "JobStatus", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.JobStatus", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "120", + "kind": "enumvalue", + "name": "notStarted", + "value": "notStarted", + "valueType": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "decorators": [] + }, + { + "$id": "122", + "kind": "enumvalue", + "name": "running", + "value": "running", + "valueType": { + "$id": "123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "decorators": [] + }, + { + "$id": "124", + "kind": "enumvalue", + "name": "succeeded", + "value": "succeeded", + "valueType": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "decorators": [] + }, + { + "$id": "126", + "kind": "enumvalue", + "name": "failed", + "value": "failed", + "valueType": { + "$id": "127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "decorators": [] + }, + { + "$id": "128", + "kind": "enumvalue", + "name": "cancelled", + "value": "cancelled", + "valueType": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "decorators": [] + }, + { + "$id": "130", + "kind": "enumvalue", + "name": "cancelling", + "value": "cancelling", + "valueType": { + "$id": "131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "decorators": [] + }, + { + "$id": "132", + "kind": "enumvalue", + "name": "partiallyCompleted", + "value": "partiallyCompleted", + "valueType": { + "$id": "133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "134", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Versions", + "valueType": { + "$id": "135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "136", + "kind": "enumvalue", + "name": "v2023_04_01", + "value": "2023-04-01", + "valueType": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "134" + }, + "description": "Version 2023-04-01", + "decorators": [] + }, + { + "$id": "138", + "kind": "enumvalue", + "name": "v2023_04_15_preview", + "value": "2023-04-15-preview", + "valueType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "134" + }, + "description": "The 2023-04-15-preview API version.", + "decorators": [] + }, + { + "$id": "140", + "kind": "enumvalue", + "name": "v2024_11_15_preview", + "value": "2024-11-15-preview", + "valueType": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "134" + }, + "description": "The 2024-11-15-preview API version.", + "decorators": [] + } + ], + "description": "The available API versions.", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "142", + "kind": "model", + "name": "ProjectMetadata", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata", + "usage": "Output,Json", + "description": "Represents the metadata of a project.", + "decorators": [], + "properties": [ + { + "$id": "143", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "Represents the project creation datetime.", + "type": { + "$id": "144", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.createdDateTime" + }, + { + "$id": "146", + "kind": "property", + "name": "lastModifiedDateTime", + "serializedName": "lastModifiedDateTime", + "description": "Represents the project creation datetime.", + "type": { + "$id": "147", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "148", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.lastModifiedDateTime" + }, + { + "$id": "149", + "kind": "property", + "name": "lastTrainedDateTime", + "serializedName": "lastTrainedDateTime", + "description": "Represents the project last trained datetime.", + "type": { + "$id": "150", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.lastTrainedDateTime" + }, + { + "$id": "152", + "kind": "property", + "name": "lastDeployedDateTime", + "serializedName": "lastDeployedDateTime", + "description": "Represents the project last deployed datetime.", + "type": { + "$id": "153", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "154", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.lastDeployedDateTime" + }, + { + "$id": "155", + "kind": "property", + "name": "projectKind", + "serializedName": "projectKind", + "description": "Represents the project kind.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.projectKind" + }, + { + "$id": "156", + "kind": "property", + "name": "settings", + "serializedName": "settings", + "description": "The project settings.", + "type": { + "$id": "157", + "kind": "model", + "name": "ProjectSettings", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectSettings", + "usage": "Input,Output,JsonMergePatch,Json", + "description": "Represents the settings used to define the project behavior.", + "decorators": [], + "properties": [ + { + "$id": "158", + "kind": "property", + "name": "confidenceThreshold", + "serializedName": "confidenceThreshold", + "description": "The threshold of the intent with the highest confidence, at which the prediction will automatically be changed to \"None\". The value of the threshold should be between 0 and 1 inclusive.", + "type": { + "$id": "159", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectSettings.confidenceThreshold" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.settings" + }, + { + "$id": "160", + "kind": "property", + "name": "storageInputContainerName", + "serializedName": "storageInputContainerName", + "description": "The storage container name in case of conversation summarization.", + "type": { + "$id": "161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.storageInputContainerName" + }, + { + "$id": "162", + "kind": "property", + "name": "projectName", + "serializedName": "projectName", + "description": "The new project name.", + "type": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.projectName" + }, + { + "$id": "164", + "kind": "property", + "name": "multilingual", + "serializedName": "multilingual", + "description": "Whether the project would be used for multiple languages or not.", + "type": { + "$id": "165", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.multilingual" + }, + { + "$id": "166", + "kind": "property", + "name": "description", + "serializedName": "description", + "description": "The project description.", + "type": { + "$id": "167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.description" + }, + { + "$id": "168", + "kind": "property", + "name": "language", + "serializedName": "language", + "description": "The project language. This is BCP-47 representation of a language. For example, use \"en\" for English, \"en-gb\" for English (UK), \"es\" for Spanish etc.", + "type": { + "$id": "169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectMetadata.language" + } + ] + }, + { + "$ref": "157" + }, + { + "$id": "170", + "kind": "model", + "name": "ErrorResponse", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ErrorResponse", + "usage": "Output,Error,Json", + "description": "Error response.", + "decorators": [], + "properties": [ + { + "$id": "171", + "kind": "property", + "name": "error", + "serializedName": "error", + "description": "The error object.", + "type": { + "$id": "172", + "kind": "model", + "name": "Error", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Error", + "usage": "Output,Json", + "description": "The error object.", + "decorators": [], + "properties": [ + { + "$id": "173", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "One of a server-defined set of error codes.", + "type": { + "$ref": "10" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Error.code" + }, + { + "$id": "174", + "kind": "property", + "name": "message", + "serializedName": "message", + "description": "A human-readable representation of the error.", + "type": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Error.message" + }, + { + "$id": "176", + "kind": "property", + "name": "target", + "serializedName": "target", + "description": "The target of the error.", + "type": { + "$id": "177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Error.target" + }, + { + "$id": "178", + "kind": "property", + "name": "details", + "serializedName": "details", + "description": "An array of details about specific errors that led to this reported error.", + "type": { + "$id": "179", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Error.details" + }, + { + "$id": "180", + "kind": "property", + "name": "innererror", + "serializedName": "innererror", + "description": "An object containing more specific information than the current object about\nthe error.", + "type": { + "$id": "181", + "kind": "model", + "name": "InnerErrorModel", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.InnerErrorModel", + "usage": "Output,Json", + "description": "An object containing more specific information about the error. As per\nMicrosoft One API guidelines -\nhttps://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "decorators": [], + "properties": [ + { + "$id": "182", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "One of a server-defined set of error codes.", + "type": { + "$ref": "48" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.InnerErrorModel.code" + }, + { + "$id": "183", + "kind": "property", + "name": "message", + "serializedName": "message", + "description": "Error message.", + "type": { + "$id": "184", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.InnerErrorModel.message" + }, + { + "$id": "185", + "kind": "property", + "name": "details", + "serializedName": "details", + "description": "Error details.", + "type": { + "$id": "186", + "kind": "dict", + "keyType": { + "$id": "187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "188", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.InnerErrorModel.details" + }, + { + "$id": "189", + "kind": "property", + "name": "target", + "serializedName": "target", + "description": "Error target.", + "type": { + "$id": "190", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.InnerErrorModel.target" + }, + { + "$id": "191", + "kind": "property", + "name": "innererror", + "serializedName": "innererror", + "description": "An object containing more specific information than the current object about\nthe error.", + "type": { + "$ref": "181" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.InnerErrorModel.innererror" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Error.innererror" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ErrorResponse.error" + } + ] + }, + { + "$ref": "172" + }, + { + "$ref": "181" + }, + { + "$id": "192", + "kind": "model", + "name": "CreateProjectOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateProjectOptions", + "usage": "Input,JsonMergePatch,Json", + "description": "Represents the options used to create or update a project.", + "decorators": [], + "properties": [ + { + "$id": "193", + "kind": "property", + "name": "projectKind", + "serializedName": "projectKind", + "description": "Represents the project kind.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateProjectOptions.projectKind" + }, + { + "$id": "194", + "kind": "property", + "name": "settings", + "serializedName": "settings", + "description": "The project settings.", + "type": { + "$ref": "157" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateProjectOptions.settings" + }, + { + "$id": "195", + "kind": "property", + "name": "storageInputContainerName", + "serializedName": "storageInputContainerName", + "description": "The storage container name in case of conversation summarization.", + "type": { + "$id": "196", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateProjectOptions.storageInputContainerName" + }, + { + "$id": "197", + "kind": "property", + "name": "projectName", + "serializedName": "projectName", + "description": "The new project name.", + "type": { + "$id": "198", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateProjectOptions.projectName" + }, + { + "$id": "199", + "kind": "property", + "name": "multilingual", + "serializedName": "multilingual", + "description": "Whether the project would be used for multiple languages or not.", + "type": { + "$id": "200", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateProjectOptions.multilingual" + }, + { + "$id": "201", + "kind": "property", + "name": "description", + "serializedName": "description", + "description": "The project description.", + "type": { + "$id": "202", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateProjectOptions.description" + }, + { + "$id": "203", + "kind": "property", + "name": "language", + "serializedName": "language", + "description": "The project language. This is BCP-47 representation of a language. For example, use \"en\" for English, \"en-gb\" for English (UK), \"es\" for Spanish etc.", + "type": { + "$id": "204", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateProjectOptions.language" + } + ] + }, + { + "$id": "205", + "kind": "model", + "name": "CopyProjectAuthorizationRequest", + "crossLanguageDefinitionId": "copyProjectAuthorization.Request.anonymous", + "usage": "Spread,Json", + "decorators": [], + "properties": [ + { + "$id": "206", + "kind": "property", + "name": "projectKind", + "serializedName": "projectKind", + "description": "Represents the project kind.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "copyProjectAuthorization.Request.anonymous.projectKind" + }, + { + "$id": "207", + "kind": "property", + "name": "storageInputContainerName", + "serializedName": "storageInputContainerName", + "description": "The name of the storage container.", + "type": { + "$id": "208", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "copyProjectAuthorization.Request.anonymous.storageInputContainerName" + }, + { + "$id": "209", + "kind": "property", + "name": "allowOverwrite", + "serializedName": "allowOverwrite", + "description": "Whether to allow an existing project to be overwritten using the resulting copy authorization.", + "type": { + "$id": "210", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "copyProjectAuthorization.Request.anonymous.allowOverwrite" + } + ] + }, + { + "$id": "211", + "kind": "model", + "name": "CopyProjectOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCopyProjectOptions", + "usage": "Input,Output,Json", + "description": "Represents the options for copying an existing project to another Azure\nresource.", + "decorators": [], + "properties": [ + { + "$id": "212", + "kind": "property", + "name": "projectKind", + "serializedName": "projectKind", + "description": "Represents the project kind.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCopyProjectOptions.projectKind" + }, + { + "$id": "213", + "kind": "property", + "name": "targetProjectName", + "serializedName": "targetProjectName", + "description": "The project name to be copied-into.", + "type": { + "$id": "214", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCopyProjectOptions.targetProjectName" + }, + { + "$id": "215", + "kind": "property", + "name": "accessToken", + "serializedName": "accessToken", + "description": "The access token.", + "type": { + "$id": "216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCopyProjectOptions.accessToken" + }, + { + "$id": "217", + "kind": "property", + "name": "expiresAt", + "serializedName": "expiresAt", + "description": "The expiration of the access token.", + "type": { + "$id": "218", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCopyProjectOptions.expiresAt" + }, + { + "$id": "220", + "kind": "property", + "name": "targetResourceId", + "serializedName": "targetResourceId", + "description": "Represents the target Azure resource ID.", + "type": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCopyProjectOptions.targetResourceId" + }, + { + "$id": "222", + "kind": "property", + "name": "targetResourceRegion", + "serializedName": "targetResourceRegion", + "description": "Represents the target Azure resource region.", + "type": { + "$id": "223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCopyProjectOptions.targetResourceRegion" + } + ] + }, + { + "$id": "224", + "kind": "model", + "name": "ExportedProject", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedProject", + "usage": "Input,Json", + "description": "Represents an exported project.", + "decorators": [], + "properties": [ + { + "$id": "225", + "kind": "property", + "name": "projectFileVersion", + "serializedName": "projectFileVersion", + "description": "The version of the exported file.", + "type": { + "$id": "226", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedProject.projectFileVersion" + }, + { + "$id": "227", + "kind": "property", + "name": "stringIndexType", + "serializedName": "stringIndexType", + "description": "Specifies the method used to interpret string offsets. For additional\ninformation see https://aka.ms/text-analytics-offsets.", + "type": { + "$ref": "84" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedProject.stringIndexType" + }, + { + "$id": "228", + "kind": "property", + "name": "metadata", + "serializedName": "metadata", + "description": "Represents the project metadata.", + "type": { + "$ref": "192" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedProject.metadata" + }, + { + "$id": "229", + "kind": "property", + "name": "assets", + "serializedName": "assets", + "description": "Represents the project assets.", + "type": { + "$id": "230", + "kind": "model", + "name": "ExportedProjectAssets", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedProjectAssets", + "usage": "Input,Json", + "description": "Represents the assets of an exported project.", + "decorators": [], + "discriminatorProperty": { + "$id": "231", + "kind": "property", + "name": "projectKind", + "serializedName": "projectKind", + "description": "The type of project containing the assets.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedProjectAssets.projectKind" + }, + "properties": [ + { + "$ref": "231" + } + ], + "discriminatedSubtypes": { + "$id": "232", + "Conversation": { + "$id": "233", + "kind": "model", + "name": "ConversationExportedProjectAssets", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedProjectAssets", + "usage": "Input,Json", + "description": "Represents the exported assets of a conversational project.", + "discriminatorValue": "Conversation", + "decorators": [], + "baseModel": { + "$ref": "230" + }, + "properties": [ + { + "$id": "234", + "kind": "property", + "name": "intents", + "serializedName": "intents", + "description": "The intents defined in the project.", + "type": { + "$id": "235", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringConversationExportedIntent", + "valueType": { + "$id": "236", + "kind": "model", + "name": "ConversationExportedIntent", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedIntent", + "usage": "Input,Json", + "description": "Represents an exported intent of a conversational project.", + "decorators": [], + "properties": [ + { + "$id": "237", + "kind": "property", + "name": "category", + "serializedName": "category", + "description": "The intent category.", + "type": { + "$id": "238", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedIntent.category" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedProjectAssets.intents" + }, + { + "$id": "239", + "kind": "property", + "name": "entities", + "serializedName": "entities", + "description": "The entities defined in the project.", + "type": { + "$id": "240", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringConversationExportedEntity", + "valueType": { + "$id": "241", + "kind": "model", + "name": "ConversationExportedEntity", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedEntity", + "usage": "Input,Json", + "description": "Represents an entity with its components.", + "decorators": [], + "properties": [ + { + "$id": "242", + "kind": "property", + "name": "category", + "serializedName": "category", + "description": "The category of the entity.", + "type": { + "$id": "243", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedEntity.category" + }, + { + "$id": "244", + "kind": "property", + "name": "compositionSetting", + "serializedName": "compositionSetting", + "description": "The behavior to follow when the entity's components overlap with each other.", + "type": { + "$ref": "88" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedEntity.compositionSetting" + }, + { + "$id": "245", + "kind": "property", + "name": "list", + "serializedName": "list", + "description": "The list component of the entity.", + "type": { + "$id": "246", + "kind": "model", + "name": "ExportedEntityList", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityList", + "usage": "Input,Json", + "description": "Represents a list component of an entity.", + "decorators": [], + "properties": [ + { + "$id": "247", + "kind": "property", + "name": "sublists", + "serializedName": "sublists", + "description": "The sub-lists of the list component.", + "type": { + "$id": "248", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringExportedEntitySublist", + "valueType": { + "$id": "249", + "kind": "model", + "name": "ExportedEntitySublist", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntitySublist", + "usage": "Input,Json", + "description": "Represents a sub-list inside a list component.", + "decorators": [], + "properties": [ + { + "$id": "250", + "kind": "property", + "name": "listKey", + "serializedName": "listKey", + "description": "The key of the sub-list.", + "type": { + "$id": "251", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntitySublist.listKey" + }, + { + "$id": "252", + "kind": "property", + "name": "synonyms", + "serializedName": "synonyms", + "description": "The phrases of that correspond to the sub-list.", + "type": { + "$id": "253", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringExportedEntityListSynonym", + "valueType": { + "$id": "254", + "kind": "model", + "name": "ExportedEntityListSynonym", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityListSynonym", + "usage": "Input,Json", + "description": "Represents a list of synonyms inside a list component", + "decorators": [], + "properties": [ + { + "$id": "255", + "kind": "property", + "name": "language", + "serializedName": "language", + "description": "Represents the language of the synonyms. This is BCP-47 representation of a\nlanguage. For example, use \"en\" for English, \"en-gb\" for English (UK), \"es\" for\nSpanish etc.", + "type": { + "$id": "256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityListSynonym.language" + }, + { + "$id": "257", + "kind": "property", + "name": "values", + "serializedName": "values", + "description": "The list of synonyms.", + "type": { + "$id": "258", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityListSynonym.values" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntitySublist.synonyms" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityList.sublists" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedEntity.list" + }, + { + "$id": "260", + "kind": "property", + "name": "prebuilts", + "serializedName": "prebuilts", + "description": "The prebuilt entities components.", + "type": { + "$id": "261", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringExportedPrebuiltEntity", + "valueType": { + "$id": "262", + "kind": "model", + "name": "ExportedPrebuiltEntity", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedPrebuiltEntity", + "usage": "Input,Json", + "description": "Represents an exported prebuilt entity component", + "decorators": [], + "properties": [ + { + "$id": "263", + "kind": "property", + "name": "category", + "serializedName": "category", + "description": "The prebuilt entity category.", + "type": { + "$id": "264", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedPrebuiltEntity.category" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedEntity.prebuilts" + }, + { + "$id": "265", + "kind": "property", + "name": "regex", + "serializedName": "regex", + "description": "The regex component of the entity.", + "type": { + "$id": "266", + "kind": "model", + "name": "ExportedEntityRegex", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityRegex", + "usage": "Input,Json", + "description": "Represents a regex component of an entity.", + "decorators": [], + "properties": [ + { + "$id": "267", + "kind": "property", + "name": "expressions", + "serializedName": "expressions", + "description": "The regex expressions of the regex component. These expressions follow the .NET\nregex syntax. For reference, check here:\nhttps://learn.microsoft.com/dotnet/standard/base-types/regular-expressions", + "type": { + "$id": "268", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringExportedEntityRegexExpression", + "valueType": { + "$id": "269", + "kind": "model", + "name": "ExportedEntityRegexExpression", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityRegexExpression", + "usage": "Input,Json", + "description": "Represents a regex expression inside a regex component. This expression follows\nthe .NET regex syntax. For reference, check here:\nhttps://learn.microsoft.com/dotnet/standard/base-types/regular-expressions", + "decorators": [], + "properties": [ + { + "$id": "270", + "kind": "property", + "name": "regexKey", + "serializedName": "regexKey", + "description": "The key of the regex expression.", + "type": { + "$id": "271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityRegexExpression.regexKey" + }, + { + "$id": "272", + "kind": "property", + "name": "language", + "serializedName": "language", + "description": "Represents the language of the regex expression. This is BCP-47 representation\nof a language. For example, use \"en\" for English, \"en-gb\" for English (UK),\n\"es\" for Spanish etc.", + "type": { + "$id": "273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityRegexExpression.language" + }, + { + "$id": "274", + "kind": "property", + "name": "regexPattern", + "serializedName": "regexPattern", + "description": "The regex pattern.", + "type": { + "$id": "275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityRegexExpression.regexPattern" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedEntityRegex.expressions" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedEntity.regex" + }, + { + "$id": "276", + "kind": "property", + "name": "requiredComponents", + "serializedName": "requiredComponents", + "description": "The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'.", + "type": { + "$id": "277", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "278", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedEntity.requiredComponents" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedProjectAssets.entities" + }, + { + "$id": "279", + "kind": "property", + "name": "utterances", + "serializedName": "utterances", + "description": "The utterances defined in the project.", + "type": { + "$id": "280", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringConversationExportedUtterance", + "valueType": { + "$id": "281", + "kind": "model", + "name": "ConversationExportedUtterance", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedUtterance", + "usage": "Input,Json", + "description": "Represents an exported utterance for a conversational project.", + "decorators": [], + "properties": [ + { + "$id": "282", + "kind": "property", + "name": "entities", + "serializedName": "entities", + "description": "Represents the entity labels of the utterance.", + "type": { + "$id": "283", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringExportedUtteranceEntityLabel", + "valueType": { + "$id": "284", + "kind": "model", + "name": "ExportedUtteranceEntityLabel", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedUtteranceEntityLabel", + "usage": "Input,Json", + "description": "Represents an entity label for an utterance.", + "decorators": [], + "properties": [ + { + "$id": "285", + "kind": "property", + "name": "category", + "serializedName": "category", + "description": "The category of the entity label.", + "type": { + "$id": "286", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedUtteranceEntityLabel.category" + }, + { + "$id": "287", + "kind": "property", + "name": "offset", + "serializedName": "offset", + "description": "Start position for the entity text.", + "type": { + "$id": "288", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedUtteranceEntityLabel.offset" + }, + { + "$id": "289", + "kind": "property", + "name": "length", + "serializedName": "length", + "description": "Length for the entity text.", + "type": { + "$id": "290", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedUtteranceEntityLabel.length" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedUtterance.entities" + }, + { + "$id": "291", + "kind": "property", + "name": "text", + "serializedName": "text", + "description": "The utterance text.", + "type": { + "$id": "292", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedUtterance.text" + }, + { + "$id": "293", + "kind": "property", + "name": "language", + "serializedName": "language", + "description": "Represents the utterance's language. This is BCP-47 representation of a\nlanguage. For example, use \"en\" for English, \"en-gb\" for English (UK), \"es\" for\nSpanish etc.", + "type": { + "$id": "294", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedUtterance.language" + }, + { + "$id": "295", + "kind": "property", + "name": "intent", + "serializedName": "intent", + "description": "The intent of the utterance.", + "type": { + "$id": "296", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedUtterance.intent" + }, + { + "$id": "297", + "kind": "property", + "name": "dataset", + "serializedName": "dataset", + "description": "The dataset for this utterance. Allowed values are 'Train' and 'Test'.", + "type": { + "$id": "298", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedUtterance.dataset" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedProjectAssets.utterances" + }, + { + "$id": "299", + "kind": "property", + "name": "projectKind", + "serializedName": "projectKind", + "description": "The type of project containing the assets.", + "type": { + "$id": "300", + "kind": "constant", + "valueType": { + "$id": "301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Conversation", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConversationExportedProjectAssets.projectKind" + } + ] + }, + "Orchestration": { + "$id": "302", + "kind": "model", + "name": "OrchestrationExportedProjectAssets", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedProjectAssets", + "usage": "Input,Json", + "description": "Represents the assets of an orchestration project.", + "discriminatorValue": "Orchestration", + "decorators": [], + "baseModel": { + "$ref": "230" + }, + "properties": [ + { + "$id": "303", + "kind": "property", + "name": "intents", + "serializedName": "intents", + "description": "Represents the intents of the project.", + "type": { + "$id": "304", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringOrchestrationExportedIntent", + "valueType": { + "$id": "305", + "kind": "model", + "name": "OrchestrationExportedIntent", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedIntent", + "usage": "Input,Json", + "description": "Represents an exported intent for an orchestration project.", + "decorators": [], + "properties": [ + { + "$id": "306", + "kind": "property", + "name": "orchestration", + "serializedName": "orchestration", + "description": "Specifies the behavior of this intent in the orchestration flow.", + "type": { + "$id": "307", + "kind": "model", + "name": "ExportedOrchestrationOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedOrchestrationOptions", + "usage": "Input,Json", + "description": "Represents the options used to define the orchestration behavior of an intent.", + "decorators": [], + "discriminatorProperty": { + "$id": "308", + "kind": "property", + "name": "targetProjectKind", + "serializedName": "targetProjectKind", + "type": { + "$ref": "98" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedOrchestrationOptions.targetProjectKind" + }, + "properties": [ + { + "$ref": "308" + } + ], + "discriminatedSubtypes": { + "$id": "309", + "Conversation": { + "$id": "310", + "kind": "model", + "name": "ExportedConversationOrchestrationOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedConversationOrchestrationOptions", + "usage": "Input,Json", + "description": "Represents the orchestration options for a Conversational project target.", + "discriminatorValue": "Conversation", + "decorators": [], + "baseModel": { + "$ref": "307" + }, + "properties": [ + { + "$id": "311", + "kind": "property", + "name": "conversationOrchestration", + "serializedName": "conversationOrchestration", + "description": "The Conversational project target details.", + "type": { + "$id": "312", + "kind": "model", + "name": "ExportedConversationOrchestration", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedConversationOrchestration", + "usage": "Input,Json", + "description": "Defines the orchestration details for a Conversational project target.", + "decorators": [], + "properties": [ + { + "$id": "313", + "kind": "property", + "name": "projectName", + "serializedName": "projectName", + "description": "The name of the targeted project.", + "type": { + "$id": "314", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedConversationOrchestration.projectName" + }, + { + "$id": "315", + "kind": "property", + "name": "deploymentName", + "serializedName": "deploymentName", + "description": "The name of the targeted deployment.", + "type": { + "$id": "316", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedConversationOrchestration.deploymentName" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedConversationOrchestrationOptions.conversationOrchestration" + }, + { + "$id": "317", + "kind": "property", + "name": "targetProjectKind", + "serializedName": "targetProjectKind", + "description": "The kind of the target used in the orchestration flow.", + "type": { + "$id": "318", + "kind": "constant", + "valueType": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Conversation", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedConversationOrchestrationOptions.targetProjectKind" + } + ] + }, + "Luis": { + "$id": "320", + "kind": "model", + "name": "ExportedLuisOrchestrationOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedLuisOrchestrationOptions", + "usage": "Input,Json", + "description": "Represents the orchestration options for a LUIS application target.", + "discriminatorValue": "Luis", + "decorators": [], + "baseModel": { + "$ref": "307" + }, + "properties": [ + { + "$id": "321", + "kind": "property", + "name": "luisOrchestration", + "serializedName": "luisOrchestration", + "description": "The LUIS application target details.", + "type": { + "$id": "322", + "kind": "model", + "name": "ExportedLuisOrchestration", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedLuisOrchestration", + "usage": "Input,Json", + "description": "Defines the orchestration details for a LUIS application target.", + "decorators": [], + "properties": [ + { + "$id": "323", + "kind": "property", + "name": "appId", + "serializedName": "appId", + "description": "The LUIS application ID.", + "type": { + "$id": "324", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedLuisOrchestration.appId" + }, + { + "$id": "326", + "kind": "property", + "name": "appVersion", + "serializedName": "appVersion", + "description": "The targeted version Id.", + "type": { + "$id": "327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedLuisOrchestration.appVersion" + }, + { + "$id": "328", + "kind": "property", + "name": "slotName", + "serializedName": "slotName", + "description": "The targeted slot name.", + "type": { + "$id": "329", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedLuisOrchestration.slotName" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedLuisOrchestrationOptions.luisOrchestration" + }, + { + "$id": "330", + "kind": "property", + "name": "targetProjectKind", + "serializedName": "targetProjectKind", + "description": "The kind of the target used in the orchestration flow.", + "type": { + "$id": "331", + "kind": "constant", + "valueType": { + "$id": "332", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Luis", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedLuisOrchestrationOptions.targetProjectKind" + } + ] + }, + "QuestionAnswering": { + "$id": "333", + "kind": "model", + "name": "ExportedQuestionAnsweringOrchestrationOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedQuestionAnsweringOrchestrationOptions", + "usage": "Input,Json", + "description": "Represents the orchestration options for a Question Answering project target.", + "discriminatorValue": "QuestionAnswering", + "decorators": [], + "baseModel": { + "$ref": "307" + }, + "properties": [ + { + "$id": "334", + "kind": "property", + "name": "questionAnsweringOrchestration", + "serializedName": "questionAnsweringOrchestration", + "description": "The Question Answering project details.", + "type": { + "$id": "335", + "kind": "model", + "name": "ExportedQuestionAnsweringOrchestration", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedQuestionAnsweringOrchestration", + "usage": "Input,Json", + "description": "Defines the orchestration details for a Question Answering project target.", + "decorators": [], + "properties": [ + { + "$id": "336", + "kind": "property", + "name": "projectName", + "serializedName": "projectName", + "description": "The name of the target project.", + "type": { + "$id": "337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedQuestionAnsweringOrchestration.projectName" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedQuestionAnsweringOrchestrationOptions.questionAnsweringOrchestration" + }, + { + "$id": "338", + "kind": "property", + "name": "targetProjectKind", + "serializedName": "targetProjectKind", + "description": "The kind of the target used in the orchestration flow.", + "type": { + "$id": "339", + "kind": "constant", + "valueType": { + "$id": "340", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "QuestionAnswering", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedQuestionAnsweringOrchestrationOptions.targetProjectKind" + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedIntent.orchestration" + }, + { + "$id": "341", + "kind": "property", + "name": "category", + "serializedName": "category", + "description": "The intent category.", + "type": { + "$id": "342", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedIntent.category" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedProjectAssets.intents" + }, + { + "$id": "343", + "kind": "property", + "name": "utterances", + "serializedName": "utterances", + "description": "Represents the utterances of the project.", + "type": { + "$id": "344", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringOrchestrationExportedUtterance", + "valueType": { + "$id": "345", + "kind": "model", + "name": "OrchestrationExportedUtterance", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedUtterance", + "usage": "Input,Json", + "description": "Represents an utterance of an orchestration project.", + "decorators": [], + "properties": [ + { + "$id": "346", + "kind": "property", + "name": "text", + "serializedName": "text", + "description": "The utterance text.", + "type": { + "$id": "347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedUtterance.text" + }, + { + "$id": "348", + "kind": "property", + "name": "language", + "serializedName": "language", + "description": "Represents the utterance's language. This is BCP-47 representation of a\nlanguage. For example, use \"en\" for English, \"en-gb\" for English (UK), \"es\" for\nSpanish etc.", + "type": { + "$id": "349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedUtterance.language" + }, + { + "$id": "350", + "kind": "property", + "name": "intent", + "serializedName": "intent", + "description": "The intent of the utterance.", + "type": { + "$id": "351", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedUtterance.intent" + }, + { + "$id": "352", + "kind": "property", + "name": "dataset", + "serializedName": "dataset", + "description": "The dataset for this utterance. Allowed values are 'Train' and 'Test'.", + "type": { + "$id": "353", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedUtterance.dataset" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedProjectAssets.utterances" + }, + { + "$id": "354", + "kind": "property", + "name": "projectKind", + "serializedName": "projectKind", + "description": "The type of project containing the assets.", + "type": { + "$id": "355", + "kind": "constant", + "valueType": { + "$id": "356", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "Orchestration", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringOrchestrationExportedProjectAssets.projectKind" + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringExportedProject.assets" + } + ] + }, + { + "$ref": "230" + }, + { + "$ref": "233" + }, + { + "$ref": "236" + }, + { + "$ref": "241" + }, + { + "$ref": "246" + }, + { + "$ref": "249" + }, + { + "$ref": "254" + }, + { + "$ref": "262" + }, + { + "$ref": "266" + }, + { + "$ref": "269" + }, + { + "$ref": "281" + }, + { + "$ref": "284" + }, + { + "$ref": "302" + }, + { + "$ref": "305" + }, + { + "$ref": "307" + }, + { + "$ref": "310" + }, + { + "$ref": "312" + }, + { + "$ref": "320" + }, + { + "$ref": "322" + }, + { + "$ref": "333" + }, + { + "$ref": "335" + }, + { + "$ref": "345" + }, + { + "$id": "357", + "kind": "model", + "name": "TrainingJobOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobOptions", + "usage": "Input,Json", + "description": "Represents the options for starting a new training job.", + "decorators": [], + "properties": [ + { + "$id": "358", + "kind": "property", + "name": "modelLabel", + "serializedName": "modelLabel", + "description": "Represents the output model label.", + "type": { + "$id": "359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobOptions.modelLabel" + }, + { + "$id": "360", + "kind": "property", + "name": "trainingConfigVersion", + "serializedName": "trainingConfigVersion", + "description": "Represents training config version. By default, \"latest\" value is used which\nuses the latest released training config version.", + "type": { + "$id": "361", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobOptions.trainingConfigVersion" + }, + { + "$id": "362", + "kind": "property", + "name": "trainingMode", + "serializedName": "trainingMode", + "description": "Represents the mode of the training operation.", + "type": { + "$ref": "106" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobOptions.trainingMode" + }, + { + "$id": "363", + "kind": "property", + "name": "evaluationOptions", + "serializedName": "evaluationOptions", + "description": "Represents the evaluation options. By default, the evaluation kind is\npercentage, with training split percentage as 80, and testing split percentage\nas 20.", + "type": { + "$id": "364", + "kind": "model", + "name": "EvaluationOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationOptions", + "usage": "Input,Output,Json", + "description": "Represents the options used running the evaluation.", + "decorators": [], + "properties": [ + { + "$id": "365", + "kind": "property", + "name": "kind", + "serializedName": "kind", + "description": "Represents the evaluation kind. By default, the evaluation kind is set to\npercentage.", + "type": { + "$ref": "112" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationOptions.kind" + }, + { + "$id": "366", + "kind": "property", + "name": "trainingSplitPercentage", + "serializedName": "trainingSplitPercentage", + "description": "Represents the training dataset split percentage. Only needed in case the\nevaluation kind is percentage.", + "type": { + "$id": "367", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationOptions.trainingSplitPercentage" + }, + { + "$id": "368", + "kind": "property", + "name": "testingSplitPercentage", + "serializedName": "testingSplitPercentage", + "description": "Represents the testing dataset split percentage. Only needed in case the\nevaluation kind is percentage.", + "type": { + "$id": "369", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationOptions.testingSplitPercentage" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobOptions.evaluationOptions" + } + ] + }, + { + "$ref": "364" + }, + { + "$id": "370", + "kind": "model", + "name": "TrainingJobResult", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobResult", + "usage": "Output,Json", + "description": "Represents the output of a training job.", + "decorators": [], + "properties": [ + { + "$id": "371", + "kind": "property", + "name": "modelLabel", + "serializedName": "modelLabel", + "description": "Represents trained model label.", + "type": { + "$id": "372", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobResult.modelLabel" + }, + { + "$id": "373", + "kind": "property", + "name": "trainingConfigVersion", + "serializedName": "trainingConfigVersion", + "description": "Represents training config version.", + "type": { + "$id": "374", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobResult.trainingConfigVersion" + }, + { + "$id": "375", + "kind": "property", + "name": "trainingMode", + "serializedName": "trainingMode", + "description": "Represents the mode of the training operation.", + "type": { + "$ref": "106" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobResult.trainingMode" + }, + { + "$id": "376", + "kind": "property", + "name": "trainingStatus", + "serializedName": "trainingStatus", + "description": "Represents the model training status.", + "type": { + "$id": "377", + "kind": "model", + "name": "SubTrainingJobState", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSubTrainingJobState", + "usage": "Output,Json", + "description": "Represents the detailed state of a training sub-operation.", + "decorators": [], + "properties": [ + { + "$id": "378", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "description": "Represents progress percentage.", + "type": { + "$id": "379", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSubTrainingJobState.percentComplete" + }, + { + "$id": "380", + "kind": "property", + "name": "startDateTime", + "serializedName": "startDateTime", + "description": "Represents the start date time.", + "type": { + "$id": "381", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "382", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSubTrainingJobState.startDateTime" + }, + { + "$id": "383", + "kind": "property", + "name": "endDateTime", + "serializedName": "endDateTime", + "description": "Represents the end date time.", + "type": { + "$id": "384", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "385", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSubTrainingJobState.endDateTime" + }, + { + "$id": "386", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "Represents the status of the sub-operation.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSubTrainingJobState.status" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobResult.trainingStatus" + }, + { + "$id": "387", + "kind": "property", + "name": "evaluationStatus", + "serializedName": "evaluationStatus", + "description": "Represents model evaluation status.", + "type": { + "$ref": "377" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobResult.evaluationStatus" + }, + { + "$id": "388", + "kind": "property", + "name": "estimatedEndDateTime", + "serializedName": "estimatedEndDateTime", + "description": "Represents the estimated end date time for training and evaluation.", + "type": { + "$id": "389", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "390", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobResult.estimatedEndDateTime" + } + ] + }, + { + "$ref": "377" + }, + { + "$id": "391", + "kind": "model", + "name": "TrainingJobState", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobState", + "usage": "Output,Json", + "description": "Represents the state of a training job.", + "decorators": [], + "properties": [ + { + "$id": "392", + "kind": "property", + "name": "jobId", + "serializedName": "jobId", + "description": "The job ID.", + "type": { + "$id": "393", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobState.jobId" + }, + { + "$id": "394", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "395", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobState.createdDateTime" + }, + { + "$id": "397", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "398", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "399", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobState.lastUpdatedDateTime" + }, + { + "$id": "400", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "401", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "402", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobState.expirationDateTime" + }, + { + "$id": "403", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobState.status" + }, + { + "$id": "404", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "405", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$id": "406", + "kind": "model", + "name": "Warning", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Warning", + "usage": "Output,Json", + "description": "Represents a warning that was encountered while executing the request.", + "decorators": [], + "properties": [ + { + "$id": "407", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "The warning code.", + "type": { + "$id": "408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Warning.code" + }, + { + "$id": "409", + "kind": "property", + "name": "message", + "serializedName": "message", + "description": "The warning message.", + "type": { + "$id": "410", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.Warning.message" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobState.warnings" + }, + { + "$id": "411", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "412", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobState.errors" + }, + { + "$id": "413", + "kind": "property", + "name": "result", + "serializedName": "result", + "description": "Represents training tasks detailed result.", + "type": { + "$ref": "370" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingJobState.result" + } + ] + }, + { + "$ref": "406" + }, + { + "$id": "414", + "kind": "model", + "name": "GetCopyProjectStatusResponse", + "crossLanguageDefinitionId": "getCopyProjectStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "415", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "416", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "417", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getCopyProjectStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "418", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "419", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getCopyProjectStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "421", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "422", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "423", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getCopyProjectStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "424", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getCopyProjectStatus.Response.anonymous.status" + }, + { + "$id": "425", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "426", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getCopyProjectStatus.Response.anonymous.warnings" + }, + { + "$id": "427", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "428", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getCopyProjectStatus.Response.anonymous.errors" + } + ] + }, + { + "$id": "429", + "kind": "model", + "name": "ProjectDeployment", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectDeployment", + "usage": "Output,Json", + "description": "Represents a project deployment.", + "decorators": [], + "properties": [ + { + "$id": "430", + "kind": "property", + "name": "deploymentName", + "serializedName": "deploymentName", + "description": "Represents deployment name.", + "type": { + "$id": "431", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectDeployment.deploymentName" + }, + { + "$id": "432", + "kind": "property", + "name": "modelId", + "serializedName": "modelId", + "description": "Represents deployment modelId.", + "type": { + "$id": "433", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectDeployment.modelId" + }, + { + "$id": "434", + "kind": "property", + "name": "lastTrainedDateTime", + "serializedName": "lastTrainedDateTime", + "description": "Represents deployment last trained time.", + "type": { + "$id": "435", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectDeployment.lastTrainedDateTime" + }, + { + "$id": "437", + "kind": "property", + "name": "lastDeployedDateTime", + "serializedName": "lastDeployedDateTime", + "description": "Represents deployment last deployed time.", + "type": { + "$id": "438", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "439", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectDeployment.lastDeployedDateTime" + }, + { + "$id": "440", + "kind": "property", + "name": "deploymentExpirationDate", + "serializedName": "deploymentExpirationDate", + "description": "Represents deployment expiration date in the runtime.", + "type": { + "$id": "441", + "kind": "plainDate", + "name": "plainDate", + "crossLanguageDefinitionId": "TypeSpec.plainDate", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectDeployment.deploymentExpirationDate" + }, + { + "$id": "442", + "kind": "property", + "name": "modelTrainingConfigVersion", + "serializedName": "modelTrainingConfigVersion", + "description": "Represents model training config version.", + "type": { + "$id": "443", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectDeployment.modelTrainingConfigVersion" + }, + { + "$id": "444", + "kind": "property", + "name": "assignedResources", + "serializedName": "assignedResources", + "description": "Represents the metadata of the assigned Azure resources.", + "type": { + "$id": "445", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringDeploymentResource", + "valueType": { + "$id": "446", + "kind": "model", + "name": "DeploymentResource", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringDeploymentResource", + "usage": "Output,Json", + "description": "Represents an Azure resource assigned to a deployment.", + "decorators": [], + "properties": [ + { + "$id": "447", + "kind": "property", + "name": "resourceId", + "serializedName": "resourceId", + "description": "Represents the Azure resource Id.", + "type": { + "$id": "448", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringDeploymentResource.resourceId" + }, + { + "$id": "449", + "kind": "property", + "name": "region", + "serializedName": "region", + "description": "Represents the resource region.", + "type": { + "$id": "450", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringDeploymentResource.region" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectDeployment.assignedResources" + } + ] + }, + { + "$ref": "446" + }, + { + "$id": "451", + "kind": "model", + "name": "SwapDeploymentsOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSwapDeploymentsOptions", + "usage": "Input,Json", + "description": "Represents the options for swapping two deployments together.", + "decorators": [], + "properties": [ + { + "$id": "452", + "kind": "property", + "name": "firstDeploymentName", + "serializedName": "firstDeploymentName", + "description": "Represents the first deployment name.", + "type": { + "$id": "453", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSwapDeploymentsOptions.firstDeploymentName" + }, + { + "$id": "454", + "kind": "property", + "name": "secondDeploymentName", + "serializedName": "secondDeploymentName", + "description": "Represents the second deployment name.", + "type": { + "$id": "455", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSwapDeploymentsOptions.secondDeploymentName" + } + ] + }, + { + "$id": "456", + "kind": "model", + "name": "GetDeploymentResponse", + "crossLanguageDefinitionId": "getDeployment.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "457", + "kind": "property", + "name": "modelId", + "serializedName": "modelId", + "description": "Represents deployment modelId.", + "type": { + "$id": "458", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeployment.Response.anonymous.modelId" + }, + { + "$id": "459", + "kind": "property", + "name": "lastTrainedDateTime", + "serializedName": "lastTrainedDateTime", + "description": "Represents deployment last trained time.", + "type": { + "$id": "460", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeployment.Response.anonymous.lastTrainedDateTime" + }, + { + "$id": "462", + "kind": "property", + "name": "lastDeployedDateTime", + "serializedName": "lastDeployedDateTime", + "description": "Represents deployment last deployed time.", + "type": { + "$id": "463", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "464", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeployment.Response.anonymous.lastDeployedDateTime" + }, + { + "$id": "465", + "kind": "property", + "name": "deploymentExpirationDate", + "serializedName": "deploymentExpirationDate", + "description": "Represents deployment expiration date in the runtime.", + "type": { + "$id": "466", + "kind": "plainDate", + "name": "plainDate", + "crossLanguageDefinitionId": "TypeSpec.plainDate", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeployment.Response.anonymous.deploymentExpirationDate" + }, + { + "$id": "467", + "kind": "property", + "name": "modelTrainingConfigVersion", + "serializedName": "modelTrainingConfigVersion", + "description": "Represents model training config version.", + "type": { + "$id": "468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeployment.Response.anonymous.modelTrainingConfigVersion" + }, + { + "$id": "469", + "kind": "property", + "name": "assignedResources", + "serializedName": "assignedResources", + "description": "Represents the metadata of the assigned Azure resources.", + "type": { + "$id": "470", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringDeploymentResource", + "valueType": { + "$ref": "446" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeployment.Response.anonymous.assignedResources" + } + ] + }, + { + "$id": "471", + "kind": "model", + "name": "CreateDeploymentOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateDeploymentOptions", + "usage": "Input,Json", + "description": "Represents the options for creating or updating a project deployment.", + "decorators": [], + "properties": [ + { + "$id": "472", + "kind": "property", + "name": "trainedModelLabel", + "serializedName": "trainedModelLabel", + "description": "Represents the trained model label.", + "type": { + "$id": "473", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateDeploymentOptions.trainedModelLabel" + }, + { + "$id": "474", + "kind": "property", + "name": "assignedResourceIds", + "serializedName": "assignedResourceIds", + "description": "Represents the resource IDs to be assigned to the deployment.\nIf provided, the deployment will be rolled out to the resources\nprovided here as well as the original resource in which the project is created.", + "type": { + "$id": "475", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "476", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringCreateDeploymentOptions.assignedResourceIds" + } + ] + }, + { + "$id": "477", + "kind": "model", + "name": "DeleteDeploymentOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringDeleteDeploymentOptions", + "usage": "Input,Json", + "description": "Represents the options for deleting a project deployment.", + "decorators": [], + "properties": [ + { + "$id": "478", + "kind": "property", + "name": "assignedResourceIds", + "serializedName": "assignedResourceIds", + "description": "Represents the resource IDs to delete the deployment from.\nIf not provided, the deployment will be rolled out from all the\nresources it is deployed to.\nIf provided, it will delete the deployment only from the specified\nassigned resources, and leave it for the rest.", + "type": { + "$id": "479", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "480", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringDeleteDeploymentOptions.assignedResourceIds" + } + ] + }, + { + "$id": "481", + "kind": "model", + "name": "GetDeploymentDeleteFromResourcesStatusResponse", + "crossLanguageDefinitionId": "getDeploymentDeleteFromResourcesStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "482", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "483", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "484", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentDeleteFromResourcesStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "485", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "486", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "487", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentDeleteFromResourcesStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "488", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "489", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentDeleteFromResourcesStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "491", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentDeleteFromResourcesStatus.Response.anonymous.status" + }, + { + "$id": "492", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "493", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentDeleteFromResourcesStatus.Response.anonymous.warnings" + }, + { + "$id": "494", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "495", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentDeleteFromResourcesStatus.Response.anonymous.errors" + } + ] + }, + { + "$id": "496", + "kind": "model", + "name": "GetDeploymentStatusResponse", + "crossLanguageDefinitionId": "getDeploymentStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "497", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "498", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "499", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "500", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "501", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "503", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "504", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "505", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "506", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentStatus.Response.anonymous.status" + }, + { + "$id": "507", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "508", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentStatus.Response.anonymous.warnings" + }, + { + "$id": "509", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "510", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getDeploymentStatus.Response.anonymous.errors" + } + ] + }, + { + "$id": "511", + "kind": "model", + "name": "GetSwapDeploymentsStatusResponse", + "crossLanguageDefinitionId": "getSwapDeploymentsStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "512", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "513", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "514", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getSwapDeploymentsStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "515", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "516", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "517", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getSwapDeploymentsStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "518", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "519", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "520", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getSwapDeploymentsStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "521", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getSwapDeploymentsStatus.Response.anonymous.status" + }, + { + "$id": "522", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "523", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getSwapDeploymentsStatus.Response.anonymous.warnings" + }, + { + "$id": "524", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "525", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getSwapDeploymentsStatus.Response.anonymous.errors" + } + ] + }, + { + "$id": "526", + "kind": "model", + "name": "GetExportStatusResponse", + "crossLanguageDefinitionId": "getExportStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "527", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "528", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getExportStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "530", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "531", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "532", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getExportStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "533", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "534", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getExportStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "536", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getExportStatus.Response.anonymous.status" + }, + { + "$id": "537", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "538", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getExportStatus.Response.anonymous.warnings" + }, + { + "$id": "539", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "540", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getExportStatus.Response.anonymous.errors" + }, + { + "$id": "541", + "kind": "property", + "name": "resultUrl", + "serializedName": "resultUrl", + "description": "The URL to use in order to download the exported project.", + "type": { + "$id": "542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getExportStatus.Response.anonymous.resultUrl" + } + ] + }, + { + "$id": "543", + "kind": "model", + "name": "GetImportStatusResponse", + "crossLanguageDefinitionId": "getImportStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "544", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "545", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "546", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getImportStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "547", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "548", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getImportStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "550", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "551", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "552", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getImportStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "553", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getImportStatus.Response.anonymous.status" + }, + { + "$id": "554", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "555", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getImportStatus.Response.anonymous.warnings" + }, + { + "$id": "556", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "557", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getImportStatus.Response.anonymous.errors" + } + ] + }, + { + "$id": "558", + "kind": "model", + "name": "ProjectTrainedModel", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectTrainedModel", + "usage": "Output,Json", + "description": "Represents a trained model.", + "decorators": [], + "properties": [ + { + "$id": "559", + "kind": "property", + "name": "label", + "serializedName": "label", + "description": "The trained model label.", + "type": { + "$id": "560", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectTrainedModel.label" + }, + { + "$id": "561", + "kind": "property", + "name": "modelId", + "serializedName": "modelId", + "description": "The model ID.", + "type": { + "$id": "562", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectTrainedModel.modelId" + }, + { + "$id": "563", + "kind": "property", + "name": "lastTrainedDateTime", + "serializedName": "lastTrainedDateTime", + "description": "The last trained date time of the model.", + "type": { + "$id": "564", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectTrainedModel.lastTrainedDateTime" + }, + { + "$id": "566", + "kind": "property", + "name": "lastTrainingDurationInSeconds", + "serializedName": "lastTrainingDurationInSeconds", + "description": "The duration of the model's last training request in seconds.", + "type": { + "$id": "567", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectTrainedModel.lastTrainingDurationInSeconds" + }, + { + "$id": "568", + "kind": "property", + "name": "modelExpirationDate", + "serializedName": "modelExpirationDate", + "description": "The model expiration date.", + "type": { + "$id": "569", + "kind": "plainDate", + "name": "plainDate", + "crossLanguageDefinitionId": "TypeSpec.plainDate", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectTrainedModel.modelExpirationDate" + }, + { + "$id": "570", + "kind": "property", + "name": "modelTrainingConfigVersion", + "serializedName": "modelTrainingConfigVersion", + "description": "The model training config version.", + "type": { + "$id": "571", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectTrainedModel.modelTrainingConfigVersion" + }, + { + "$id": "572", + "kind": "property", + "name": "hasSnapshot", + "serializedName": "hasSnapshot", + "description": "The flag to indicate if the trained model has a snapshot ready.", + "type": { + "$id": "573", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringProjectTrainedModel.hasSnapshot" + } + ] + }, + { + "$id": "574", + "kind": "model", + "name": "GetTrainedModelResponse", + "crossLanguageDefinitionId": "getTrainedModel.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "575", + "kind": "property", + "name": "modelId", + "serializedName": "modelId", + "description": "The model ID.", + "type": { + "$id": "576", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainedModel.Response.anonymous.modelId" + }, + { + "$id": "577", + "kind": "property", + "name": "lastTrainedDateTime", + "serializedName": "lastTrainedDateTime", + "description": "The last trained date time of the model.", + "type": { + "$id": "578", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "579", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainedModel.Response.anonymous.lastTrainedDateTime" + }, + { + "$id": "580", + "kind": "property", + "name": "lastTrainingDurationInSeconds", + "serializedName": "lastTrainingDurationInSeconds", + "description": "The duration of the model's last training request in seconds.", + "type": { + "$id": "581", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainedModel.Response.anonymous.lastTrainingDurationInSeconds" + }, + { + "$id": "582", + "kind": "property", + "name": "modelExpirationDate", + "serializedName": "modelExpirationDate", + "description": "The model expiration date.", + "type": { + "$id": "583", + "kind": "plainDate", + "name": "plainDate", + "crossLanguageDefinitionId": "TypeSpec.plainDate", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainedModel.Response.anonymous.modelExpirationDate" + }, + { + "$id": "584", + "kind": "property", + "name": "modelTrainingConfigVersion", + "serializedName": "modelTrainingConfigVersion", + "description": "The model training config version.", + "type": { + "$id": "585", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainedModel.Response.anonymous.modelTrainingConfigVersion" + }, + { + "$id": "586", + "kind": "property", + "name": "hasSnapshot", + "serializedName": "hasSnapshot", + "description": "The flag to indicate if the trained model has a snapshot ready.", + "type": { + "$id": "587", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainedModel.Response.anonymous.hasSnapshot" + } + ] + }, + { + "$id": "588", + "kind": "model", + "name": "EvaluationJobResult", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobResult", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "589", + "kind": "property", + "name": "evaluationOptions", + "serializedName": "evaluationOptions", + "description": "Represents the options used running the evaluation.", + "type": { + "$ref": "364" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobResult.evaluationOptions" + }, + { + "$id": "590", + "kind": "property", + "name": "modelLabel", + "serializedName": "modelLabel", + "description": "Represents trained model label.", + "type": { + "$id": "591", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobResult.modelLabel" + }, + { + "$id": "592", + "kind": "property", + "name": "trainingConfigVersion", + "serializedName": "trainingConfigVersion", + "description": "Represents training config version.", + "type": { + "$id": "593", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobResult.trainingConfigVersion" + }, + { + "$id": "594", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "description": "Represents progress percentage.", + "type": { + "$id": "595", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobResult.percentComplete" + } + ] + }, + { + "$id": "596", + "kind": "model", + "name": "EvaluationJobState", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobState", + "usage": "Output", + "description": "Represents the state of a evaluation job.", + "decorators": [], + "properties": [ + { + "$id": "597", + "kind": "property", + "name": "jobId", + "serializedName": "jobId", + "description": "The job ID.", + "type": { + "$id": "598", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobState.jobId" + }, + { + "$id": "599", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "600", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "601", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobState.createdDateTime" + }, + { + "$id": "602", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "603", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "604", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobState.lastUpdatedDateTime" + }, + { + "$id": "605", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "606", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "607", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobState.expirationDateTime" + }, + { + "$id": "608", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobState.status" + }, + { + "$id": "609", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "610", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobState.warnings" + }, + { + "$id": "611", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "612", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobState.errors" + }, + { + "$id": "613", + "kind": "property", + "name": "result", + "serializedName": "result", + "description": "Represents evaluation task detailed result.", + "type": { + "$ref": "588" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationJobState.result" + } + ] + }, + { + "$id": "614", + "kind": "model", + "name": "GetEvaluationStatusResponse", + "crossLanguageDefinitionId": "getEvaluationStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "615", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "616", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "617", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getEvaluationStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "618", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "619", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "620", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getEvaluationStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "621", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "622", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "623", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getEvaluationStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "624", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getEvaluationStatus.Response.anonymous.status" + }, + { + "$id": "625", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "626", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getEvaluationStatus.Response.anonymous.warnings" + }, + { + "$id": "627", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "628", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getEvaluationStatus.Response.anonymous.errors" + }, + { + "$id": "629", + "kind": "property", + "name": "result", + "serializedName": "result", + "description": "Represents evaluation task detailed result.", + "type": { + "$ref": "588" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getEvaluationStatus.Response.anonymous.result" + } + ] + }, + { + "$id": "630", + "kind": "model", + "name": "UtteranceEvaluationResult", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEvaluationResult", + "usage": "Output,Json", + "description": "Represents the evaluation result for an utterance.", + "decorators": [], + "properties": [ + { + "$id": "631", + "kind": "property", + "name": "text", + "serializedName": "text", + "description": "Represents the utterance text.", + "type": { + "$id": "632", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEvaluationResult.text" + }, + { + "$id": "633", + "kind": "property", + "name": "language", + "serializedName": "language", + "description": "Represents the utterance language. This is BCP-47 representation of a language.\nFor example, use \"en\" for English, \"en-gb\" for English (UK), \"es\" for Spanish\netc.", + "type": { + "$id": "634", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEvaluationResult.language" + }, + { + "$id": "635", + "kind": "property", + "name": "entitiesResult", + "serializedName": "entitiesResult", + "description": "Represents the entities results for the utterance.", + "type": { + "$id": "636", + "kind": "model", + "name": "UtteranceEntitiesEvaluationResult", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEntitiesEvaluationResult", + "usage": "Output,Json", + "description": "Represents the comparison between the expected and predicted entities for an\nutterance.", + "decorators": [], + "properties": [ + { + "$id": "637", + "kind": "property", + "name": "expectedEntities", + "serializedName": "expectedEntities", + "description": "Represents the expected entity labels.", + "type": { + "$id": "638", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringUtteranceEntityEvaluationResult", + "valueType": { + "$id": "639", + "kind": "model", + "name": "UtteranceEntityEvaluationResult", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEntityEvaluationResult", + "usage": "Output,Json", + "description": "Represents the evaluation output of an entity label or prediction.", + "decorators": [], + "properties": [ + { + "$id": "640", + "kind": "property", + "name": "category", + "serializedName": "category", + "description": "Represents the entity category.", + "type": { + "$id": "641", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEntityEvaluationResult.category" + }, + { + "$id": "642", + "kind": "property", + "name": "offset", + "serializedName": "offset", + "description": "Represents the entity offset index relative to the original text.", + "type": { + "$id": "643", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEntityEvaluationResult.offset" + }, + { + "$id": "644", + "kind": "property", + "name": "length", + "serializedName": "length", + "description": "Represents the entity length.", + "type": { + "$id": "645", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEntityEvaluationResult.length" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEntitiesEvaluationResult.expectedEntities" + }, + { + "$id": "646", + "kind": "property", + "name": "predictedEntities", + "serializedName": "predictedEntities", + "description": "Represents the predicted entity labels.", + "type": { + "$id": "647", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringUtteranceEntityEvaluationResult", + "valueType": { + "$ref": "639" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEntitiesEvaluationResult.predictedEntities" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEvaluationResult.entitiesResult" + }, + { + "$id": "648", + "kind": "property", + "name": "intentsResult", + "serializedName": "intentsResult", + "description": "Represents the intents results for the utterance.", + "type": { + "$id": "649", + "kind": "model", + "name": "UtteranceIntentsEvaluationResult", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceIntentsEvaluationResult", + "usage": "Output,Json", + "description": "Represents the comparison between the expected and the predicted intent for an\nutterance.", + "decorators": [], + "properties": [ + { + "$id": "650", + "kind": "property", + "name": "expectedIntent", + "serializedName": "expectedIntent", + "description": "Represents the utterance's expected intent.", + "type": { + "$id": "651", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceIntentsEvaluationResult.expectedIntent" + }, + { + "$id": "652", + "kind": "property", + "name": "predictedIntent", + "serializedName": "predictedIntent", + "description": "Represents the utterance's predicted intent.", + "type": { + "$id": "653", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceIntentsEvaluationResult.predictedIntent" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUtteranceEvaluationResult.intentsResult" + } + ] + }, + { + "$ref": "636" + }, + { + "$ref": "639" + }, + { + "$ref": "649" + }, + { + "$id": "654", + "kind": "model", + "name": "EvaluationSummary", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationSummary", + "usage": "Output,Json", + "description": "Represents the evaluation result summary.", + "decorators": [], + "properties": [ + { + "$id": "655", + "kind": "property", + "name": "entitiesEvaluation", + "serializedName": "entitiesEvaluation", + "description": "Contains the data related to entities evaluation.", + "type": { + "$id": "656", + "kind": "model", + "name": "EntitiesEvaluationSummary", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntitiesEvaluationSummary", + "usage": "Output,Json", + "description": "Represents the evaluation result summary for the project's entities.", + "decorators": [], + "properties": [ + { + "$id": "657", + "kind": "property", + "name": "confusionMatrix", + "serializedName": "confusionMatrix", + "description": "Represents the confusion matrix between two entities (the two entities can be\nthe same). The matrix is between the entity that was labelled and the entity\nthat was predicted.", + "type": { + "$id": "658", + "kind": "model", + "name": "ConfusionMatrix", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConfusionMatrix", + "usage": "Output,Json", + "decorators": [], + "additionalProperties": { + "$id": "659", + "kind": "model", + "name": "ConfusionMatrixRow", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConfusionMatrixRow", + "usage": "Output,Json", + "decorators": [], + "additionalProperties": { + "$id": "660", + "kind": "model", + "name": "ConfusionMatrixCell", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConfusionMatrixCell", + "usage": "Output,Json", + "description": "Represents a cell in a confusion matrix.", + "decorators": [], + "properties": [ + { + "$id": "661", + "kind": "property", + "name": "normalizedValue", + "serializedName": "normalizedValue", + "description": "Represents normalized value in percentages.", + "type": { + "$id": "662", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConfusionMatrixCell.normalizedValue" + }, + { + "$id": "663", + "kind": "property", + "name": "rawValue", + "serializedName": "rawValue", + "description": "Represents raw value.", + "type": { + "$id": "664", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringConfusionMatrixCell.rawValue" + } + ] + }, + "properties": [] + }, + "properties": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntitiesEvaluationSummary.confusionMatrix" + }, + { + "$id": "665", + "kind": "property", + "name": "entities", + "serializedName": "entities", + "description": "Represents the entities evaluation summary.", + "type": { + "$id": "666", + "kind": "dict", + "keyType": { + "$id": "667", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "668", + "kind": "model", + "name": "EntityEvaluationSummary", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntityEvaluationSummary", + "usage": "Output,Json", + "description": "Represents the evaluation result for an entity.", + "decorators": [], + "properties": [ + { + "$id": "669", + "kind": "property", + "name": "f1", + "serializedName": "f1", + "description": "Represents the model precision", + "type": { + "$id": "670", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntityEvaluationSummary.f1" + }, + { + "$id": "671", + "kind": "property", + "name": "precision", + "serializedName": "precision", + "description": "Represents the model recall", + "type": { + "$id": "672", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntityEvaluationSummary.precision" + }, + { + "$id": "673", + "kind": "property", + "name": "recall", + "serializedName": "recall", + "description": "Represents the model F1 score", + "type": { + "$id": "674", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntityEvaluationSummary.recall" + }, + { + "$id": "675", + "kind": "property", + "name": "truePositiveCount", + "serializedName": "truePositiveCount", + "description": "Represents the count of true positive", + "type": { + "$id": "676", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntityEvaluationSummary.truePositiveCount" + }, + { + "$id": "677", + "kind": "property", + "name": "trueNegativeCount", + "serializedName": "trueNegativeCount", + "description": "Represents the count of true negative", + "type": { + "$id": "678", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntityEvaluationSummary.trueNegativeCount" + }, + { + "$id": "679", + "kind": "property", + "name": "falsePositiveCount", + "serializedName": "falsePositiveCount", + "description": "Represents the count of false positive", + "type": { + "$id": "680", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntityEvaluationSummary.falsePositiveCount" + }, + { + "$id": "681", + "kind": "property", + "name": "falseNegativeCount", + "serializedName": "falseNegativeCount", + "description": "Represents the count of false negative", + "type": { + "$id": "682", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntityEvaluationSummary.falseNegativeCount" + } + ] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntitiesEvaluationSummary.entities" + }, + { + "$id": "683", + "kind": "property", + "name": "microF1", + "serializedName": "microF1", + "description": "Represents the micro F1. Expected value is a float between 0 and 1 inclusive.", + "type": { + "$id": "684", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntitiesEvaluationSummary.microF1" + }, + { + "$id": "685", + "kind": "property", + "name": "microPrecision", + "serializedName": "microPrecision", + "description": "Represents the micro precision. Expected value is a float between 0 and 1\ninclusive.", + "type": { + "$id": "686", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntitiesEvaluationSummary.microPrecision" + }, + { + "$id": "687", + "kind": "property", + "name": "microRecall", + "serializedName": "microRecall", + "description": "Represents the micro recall. Expected value is a float between 0 and 1\ninclusive.", + "type": { + "$id": "688", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntitiesEvaluationSummary.microRecall" + }, + { + "$id": "689", + "kind": "property", + "name": "macroF1", + "serializedName": "macroF1", + "description": "Represents the macro F1. Expected value is a float between 0 and 1 inclusive.", + "type": { + "$id": "690", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntitiesEvaluationSummary.macroF1" + }, + { + "$id": "691", + "kind": "property", + "name": "macroPrecision", + "serializedName": "macroPrecision", + "description": "Represents the macro precision. Expected value is a float between 0 and 1\ninclusive.", + "type": { + "$id": "692", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntitiesEvaluationSummary.macroPrecision" + }, + { + "$id": "693", + "kind": "property", + "name": "macroRecall", + "serializedName": "macroRecall", + "description": "Represents the macro recall. Expected value is a float between 0 and 1\ninclusive.", + "type": { + "$id": "694", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEntitiesEvaluationSummary.macroRecall" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationSummary.entitiesEvaluation" + }, + { + "$id": "695", + "kind": "property", + "name": "intentsEvaluation", + "serializedName": "intentsEvaluation", + "description": "Contains the data related to intents evaluation.", + "type": { + "$id": "696", + "kind": "model", + "name": "IntentsEvaluationSummary", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentsEvaluationSummary", + "usage": "Output,Json", + "description": "Represents the evaluation summary for the project's intents.", + "decorators": [], + "properties": [ + { + "$id": "697", + "kind": "property", + "name": "confusionMatrix", + "serializedName": "confusionMatrix", + "description": "Represents the confusion matrix between two intents (the two intents can be the\nsame). The matrix is between the intent that was labelled and the intent that\nwas predicted.", + "type": { + "$ref": "658" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentsEvaluationSummary.confusionMatrix" + }, + { + "$id": "698", + "kind": "property", + "name": "intents", + "serializedName": "intents", + "description": "Represents the intents evaluation summary.", + "type": { + "$id": "699", + "kind": "dict", + "keyType": { + "$id": "700", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "701", + "kind": "model", + "name": "IntentEvaluationSummary", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentEvaluationSummary", + "usage": "Output,Json", + "description": "The evaluation summary for an intent.", + "decorators": [], + "properties": [ + { + "$id": "702", + "kind": "property", + "name": "f1", + "serializedName": "f1", + "description": "Represents the model precision", + "type": { + "$id": "703", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentEvaluationSummary.f1" + }, + { + "$id": "704", + "kind": "property", + "name": "precision", + "serializedName": "precision", + "description": "Represents the model recall", + "type": { + "$id": "705", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentEvaluationSummary.precision" + }, + { + "$id": "706", + "kind": "property", + "name": "recall", + "serializedName": "recall", + "description": "Represents the model F1 score", + "type": { + "$id": "707", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentEvaluationSummary.recall" + }, + { + "$id": "708", + "kind": "property", + "name": "truePositiveCount", + "serializedName": "truePositiveCount", + "description": "Represents the count of true positive", + "type": { + "$id": "709", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentEvaluationSummary.truePositiveCount" + }, + { + "$id": "710", + "kind": "property", + "name": "trueNegativeCount", + "serializedName": "trueNegativeCount", + "description": "Represents the count of true negative", + "type": { + "$id": "711", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentEvaluationSummary.trueNegativeCount" + }, + { + "$id": "712", + "kind": "property", + "name": "falsePositiveCount", + "serializedName": "falsePositiveCount", + "description": "Represents the count of false positive", + "type": { + "$id": "713", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentEvaluationSummary.falsePositiveCount" + }, + { + "$id": "714", + "kind": "property", + "name": "falseNegativeCount", + "serializedName": "falseNegativeCount", + "description": "Represents the count of false negative", + "type": { + "$id": "715", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentEvaluationSummary.falseNegativeCount" + } + ] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentsEvaluationSummary.intents" + }, + { + "$id": "716", + "kind": "property", + "name": "microF1", + "serializedName": "microF1", + "description": "Represents the micro F1. Expected value is a float between 0 and 1 inclusive.", + "type": { + "$id": "717", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentsEvaluationSummary.microF1" + }, + { + "$id": "718", + "kind": "property", + "name": "microPrecision", + "serializedName": "microPrecision", + "description": "Represents the micro precision. Expected value is a float between 0 and 1\ninclusive.", + "type": { + "$id": "719", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentsEvaluationSummary.microPrecision" + }, + { + "$id": "720", + "kind": "property", + "name": "microRecall", + "serializedName": "microRecall", + "description": "Represents the micro recall. Expected value is a float between 0 and 1\ninclusive.", + "type": { + "$id": "721", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentsEvaluationSummary.microRecall" + }, + { + "$id": "722", + "kind": "property", + "name": "macroF1", + "serializedName": "macroF1", + "description": "Represents the macro F1. Expected value is a float between 0 and 1 inclusive.", + "type": { + "$id": "723", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentsEvaluationSummary.macroF1" + }, + { + "$id": "724", + "kind": "property", + "name": "macroPrecision", + "serializedName": "macroPrecision", + "description": "Represents the macro precision. Expected value is a float between 0 and 1\ninclusive.", + "type": { + "$id": "725", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentsEvaluationSummary.macroPrecision" + }, + { + "$id": "726", + "kind": "property", + "name": "macroRecall", + "serializedName": "macroRecall", + "description": "Represents the macro recall. Expected value is a float between 0 and 1\ninclusive.", + "type": { + "$id": "727", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringIntentsEvaluationSummary.macroRecall" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationSummary.intentsEvaluation" + }, + { + "$id": "728", + "kind": "property", + "name": "evaluationOptions", + "serializedName": "evaluationOptions", + "description": "The options that were used while running the evaluation.", + "type": { + "$ref": "364" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringEvaluationSummary.evaluationOptions" + } + ] + }, + { + "$ref": "656" + }, + { + "$ref": "658" + }, + { + "$ref": "659" + }, + { + "$ref": "660" + }, + { + "$ref": "668" + }, + { + "$ref": "696" + }, + { + "$ref": "701" + }, + { + "$id": "729", + "kind": "model", + "name": "GetLoadSnapshotStatusResponse", + "crossLanguageDefinitionId": "getLoadSnapshotStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "730", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "731", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "732", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getLoadSnapshotStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "733", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "734", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "735", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getLoadSnapshotStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "736", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "737", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "738", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getLoadSnapshotStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "739", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getLoadSnapshotStatus.Response.anonymous.status" + }, + { + "$id": "740", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "741", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getLoadSnapshotStatus.Response.anonymous.warnings" + }, + { + "$id": "742", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "743", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getLoadSnapshotStatus.Response.anonymous.errors" + } + ] + }, + { + "$id": "744", + "kind": "model", + "name": "AssignedDeploymentResource", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedDeploymentResource", + "usage": "Output,Json", + "description": "Represents the assigned deployment resource.", + "decorators": [], + "properties": [ + { + "$id": "745", + "kind": "property", + "name": "azureResourceId", + "serializedName": "azureResourceId", + "description": "The resource ID.", + "type": { + "$id": "746", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedDeploymentResource.azureResourceId" + }, + { + "$id": "747", + "kind": "property", + "name": "region", + "serializedName": "region", + "description": "The resource region.", + "type": { + "$id": "748", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedDeploymentResource.region" + } + ] + }, + { + "$id": "749", + "kind": "model", + "name": "AssignDeploymentResourcesOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignDeploymentResourcesOptions", + "usage": "Input,Json", + "description": "Represents the options for assigning Azure resources to a project.", + "decorators": [], + "properties": [ + { + "$id": "750", + "kind": "property", + "name": "resourcesMetadata", + "serializedName": "resourcesMetadata", + "description": "Represents the metadata for the resources to be assigned.", + "type": { + "$id": "751", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringResourceMetadata", + "valueType": { + "$id": "752", + "kind": "model", + "name": "ResourceMetadata", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringResourceMetadata", + "usage": "Input,Json", + "description": "Represents metadata for the Azure resource..", + "decorators": [], + "properties": [ + { + "$id": "753", + "kind": "property", + "name": "azureResourceId", + "serializedName": "azureResourceId", + "description": "Represents the Azure resource ID.", + "type": { + "$id": "754", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringResourceMetadata.azureResourceId" + }, + { + "$id": "755", + "kind": "property", + "name": "customDomain", + "serializedName": "customDomain", + "description": "Represents the Azure resource custom domain.", + "type": { + "$id": "756", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringResourceMetadata.customDomain" + }, + { + "$id": "757", + "kind": "property", + "name": "region", + "serializedName": "region", + "description": "Represents the Azure resource region.", + "type": { + "$id": "758", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringResourceMetadata.region" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignDeploymentResourcesOptions.resourcesMetadata" + } + ] + }, + { + "$ref": "752" + }, + { + "$id": "759", + "kind": "model", + "name": "UnassignDeploymentResourcesOptions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUnassignDeploymentResourcesOptions", + "usage": "Input,Json", + "description": "Represents the options to unassign Azure resources from a project.", + "decorators": [], + "properties": [ + { + "$id": "760", + "kind": "property", + "name": "assignedResourceIds", + "serializedName": "assignedResourceIds", + "description": "Represents the assigned resource IDs to be unassigned.", + "type": { + "$id": "761", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "762", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringUnassignDeploymentResourcesOptions.assignedResourceIds" + } + ] + }, + { + "$id": "763", + "kind": "model", + "name": "GetAssignDeploymentResourcesStatusResponse", + "crossLanguageDefinitionId": "getAssignDeploymentResourcesStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "764", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "765", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "766", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getAssignDeploymentResourcesStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "767", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "768", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "769", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getAssignDeploymentResourcesStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "770", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "771", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "772", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getAssignDeploymentResourcesStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "773", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getAssignDeploymentResourcesStatus.Response.anonymous.status" + }, + { + "$id": "774", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "775", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getAssignDeploymentResourcesStatus.Response.anonymous.warnings" + }, + { + "$id": "776", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "777", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getAssignDeploymentResourcesStatus.Response.anonymous.errors" + } + ] + }, + { + "$id": "778", + "kind": "model", + "name": "GetUnassignDeploymentResourcesStatusResponse", + "crossLanguageDefinitionId": "getUnassignDeploymentResourcesStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "779", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "780", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "781", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getUnassignDeploymentResourcesStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "782", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "783", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "784", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getUnassignDeploymentResourcesStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "785", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "786", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "787", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getUnassignDeploymentResourcesStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "788", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getUnassignDeploymentResourcesStatus.Response.anonymous.status" + }, + { + "$id": "789", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "790", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getUnassignDeploymentResourcesStatus.Response.anonymous.warnings" + }, + { + "$id": "791", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "792", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getUnassignDeploymentResourcesStatus.Response.anonymous.errors" + } + ] + }, + { + "$id": "793", + "kind": "model", + "name": "GetTrainingStatusResponse", + "crossLanguageDefinitionId": "getTrainingStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "794", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "795", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "796", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainingStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "797", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "798", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "799", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainingStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "800", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "801", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "802", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainingStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "803", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainingStatus.Response.anonymous.status" + }, + { + "$id": "804", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "805", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainingStatus.Response.anonymous.warnings" + }, + { + "$id": "806", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "807", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainingStatus.Response.anonymous.errors" + }, + { + "$id": "808", + "kind": "property", + "name": "result", + "serializedName": "result", + "description": "Represents training tasks detailed result.", + "type": { + "$ref": "370" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getTrainingStatus.Response.anonymous.result" + } + ] + }, + { + "$id": "809", + "kind": "model", + "name": "GetProjectDeletionStatusResponse", + "crossLanguageDefinitionId": "getProjectDeletionStatus.Response.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "810", + "kind": "property", + "name": "createdDateTime", + "serializedName": "createdDateTime", + "description": "The creation date time of the job.", + "type": { + "$id": "811", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "812", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getProjectDeletionStatus.Response.anonymous.createdDateTime" + }, + { + "$id": "813", + "kind": "property", + "name": "lastUpdatedDateTime", + "serializedName": "lastUpdatedDateTime", + "description": "The last date time the job was updated.", + "type": { + "$id": "814", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "815", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getProjectDeletionStatus.Response.anonymous.lastUpdatedDateTime" + }, + { + "$id": "816", + "kind": "property", + "name": "expirationDateTime", + "serializedName": "expirationDateTime", + "description": "The expiration date time of the job.", + "type": { + "$id": "817", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "818", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getProjectDeletionStatus.Response.anonymous.expirationDateTime" + }, + { + "$id": "819", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The job status.", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getProjectDeletionStatus.Response.anonymous.status" + }, + { + "$id": "820", + "kind": "property", + "name": "warnings", + "serializedName": "warnings", + "description": "The warnings that were encountered while executing the job.", + "type": { + "$id": "821", + "kind": "array", + "name": "ArrayWarning", + "valueType": { + "$ref": "406" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getProjectDeletionStatus.Response.anonymous.warnings" + }, + { + "$id": "822", + "kind": "property", + "name": "errors", + "serializedName": "errors", + "description": "The errors encountered while executing the job.", + "type": { + "$id": "823", + "kind": "array", + "name": "ArrayError", + "valueType": { + "$ref": "172" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "getProjectDeletionStatus.Response.anonymous.errors" + } + ] + }, + { + "$id": "824", + "kind": "model", + "name": "AssignedResourceDeploymentsMetadata", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedResourceDeploymentsMetadata", + "usage": "Output,Json", + "description": "Represents the metadata for deployments assigned to a resource.", + "decorators": [], + "properties": [ + { + "$id": "825", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The list of retrieved assigned project deployments.", + "type": { + "$id": "826", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringAssignedProjectDeploymentsMetadata", + "valueType": { + "$id": "827", + "kind": "model", + "name": "AssignedProjectDeploymentsMetadata", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedProjectDeploymentsMetadata", + "usage": "Output,Json", + "description": "Represents the metadata for assigned deployments for a project.", + "decorators": [], + "properties": [ + { + "$id": "828", + "kind": "property", + "name": "projectName", + "serializedName": "projectName", + "description": "Represents the project name.", + "type": { + "$id": "829", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedProjectDeploymentsMetadata.projectName" + }, + { + "$id": "830", + "kind": "property", + "name": "deploymentsMetadata", + "serializedName": "deploymentsMetadata", + "description": "Represents the resource region.", + "type": { + "$id": "831", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringAssignedProjectDeploymentMetadata", + "valueType": { + "$id": "832", + "kind": "model", + "name": "AssignedProjectDeploymentMetadata", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedProjectDeploymentMetadata", + "usage": "Output,Json", + "description": "Represents the metadata for an assigned deployment", + "decorators": [], + "properties": [ + { + "$id": "833", + "kind": "property", + "name": "deploymentName", + "serializedName": "deploymentName", + "description": "Represents the deployment name.", + "type": { + "$id": "834", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedProjectDeploymentMetadata.deploymentName" + }, + { + "$id": "835", + "kind": "property", + "name": "lastDeployedDateTime", + "serializedName": "lastDeployedDateTime", + "description": "Represents deployment last deployed time.", + "type": { + "$id": "836", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "837", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedProjectDeploymentMetadata.lastDeployedDateTime" + }, + { + "$id": "838", + "kind": "property", + "name": "deploymentExpirationDate", + "serializedName": "deploymentExpirationDate", + "description": "Represents deployment expiration date in the runtime.", + "type": { + "$id": "839", + "kind": "plainDate", + "name": "plainDate", + "crossLanguageDefinitionId": "TypeSpec.plainDate", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedProjectDeploymentMetadata.deploymentExpirationDate" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedProjectDeploymentsMetadata.deploymentsMetadata" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedResourceDeploymentsMetadata.value" + }, + { + "$id": "840", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The next page link.", + "type": { + "$id": "841", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringAssignedResourceDeploymentsMetadata.nextLink" + } + ] + }, + { + "$ref": "827" + }, + { + "$ref": "832" + }, + { + "$id": "842", + "kind": "model", + "name": "SupportedLanguages", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSupportedLanguages", + "usage": "Output,Json", + "description": "Represents a list of retrieved languages.", + "decorators": [], + "properties": [ + { + "$id": "843", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The list of the languages.", + "type": { + "$id": "844", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringSupportedLanguage", + "valueType": { + "$id": "845", + "kind": "model", + "name": "SupportedLanguage", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSupportedLanguage", + "usage": "Output,Json", + "description": "Represents a supported language.", + "decorators": [], + "properties": [ + { + "$id": "846", + "kind": "property", + "name": "languageName", + "serializedName": "languageName", + "description": "The language name.", + "type": { + "$id": "847", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSupportedLanguage.languageName" + }, + { + "$id": "848", + "kind": "property", + "name": "languageCode", + "serializedName": "languageCode", + "description": "The language code. This is BCP-47 representation of a language. For example,\n\"en\" for English, \"en-gb\" for English (UK), \"es\" for Spanish etc.", + "type": { + "$id": "849", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSupportedLanguage.languageCode" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSupportedLanguages.value" + }, + { + "$id": "850", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The next page link.", + "type": { + "$id": "851", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringSupportedLanguages.nextLink" + } + ] + }, + { + "$ref": "845" + }, + { + "$id": "852", + "kind": "model", + "name": "PrebuiltEntities", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringPrebuiltEntities", + "usage": "Output,Json", + "description": "Represents a list of the retrieved supported prebuilt entities.", + "decorators": [], + "properties": [ + { + "$id": "853", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The supported prebuilt entities.", + "type": { + "$id": "854", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringPrebuiltEntity", + "valueType": { + "$id": "855", + "kind": "model", + "name": "PrebuiltEntity", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringPrebuiltEntity", + "usage": "Output,Json", + "description": "Represents a supported prebuilt entity.", + "decorators": [], + "properties": [ + { + "$id": "856", + "kind": "property", + "name": "category", + "serializedName": "category", + "description": "The prebuilt entity category.", + "type": { + "$id": "857", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringPrebuiltEntity.category" + }, + { + "$id": "858", + "kind": "property", + "name": "description", + "serializedName": "description", + "description": "The description.", + "type": { + "$id": "859", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringPrebuiltEntity.description" + }, + { + "$id": "860", + "kind": "property", + "name": "examples", + "serializedName": "examples", + "description": "English examples for the entity.", + "type": { + "$id": "861", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringPrebuiltEntity.examples" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringPrebuiltEntities.value" + }, + { + "$id": "862", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The next page link.", + "type": { + "$id": "863", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringPrebuiltEntities.nextLink" + } + ] + }, + { + "$ref": "855" + }, + { + "$id": "864", + "kind": "model", + "name": "TrainingConfigVersions", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingConfigVersions", + "usage": "Output,Json", + "description": "Represents a list of training config versions.", + "decorators": [], + "properties": [ + { + "$id": "865", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The list of the training config versions.", + "type": { + "$id": "866", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringTrainingConfigVersion", + "valueType": { + "$id": "867", + "kind": "model", + "name": "TrainingConfigVersion", + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingConfigVersion", + "usage": "Output,Json", + "description": "Represents a training config version.", + "decorators": [], + "properties": [ + { + "$id": "868", + "kind": "property", + "name": "trainingConfigVersion", + "serializedName": "trainingConfigVersion", + "description": "Represents the version of the config.", + "type": { + "$id": "869", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingConfigVersion.trainingConfigVersion" + }, + { + "$id": "870", + "kind": "property", + "name": "modelExpirationDate", + "serializedName": "modelExpirationDate", + "description": "Represents the training config version expiration date.", + "type": { + "$id": "871", + "kind": "plainDate", + "name": "plainDate", + "crossLanguageDefinitionId": "TypeSpec.plainDate", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingConfigVersion.modelExpirationDate" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingConfigVersions.value" + }, + { + "$id": "872", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The next page link.", + "type": { + "$id": "873", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoringTrainingConfigVersions.nextLink" + } + ] + }, + { + "$ref": "867" + }, + { + "$id": "874", + "kind": "model", + "name": "PagedConversationalAnalysisAuthoringProjectMetadata", + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", + "usage": "Output,Json", + "description": "Paged collection of ConversationalAnalysisAuthoringProjectMetadata items", + "decorators": [], + "properties": [ + { + "$id": "875", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The ConversationalAnalysisAuthoringProjectMetadata items on this page", + "type": { + "$id": "876", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringProjectMetadata", + "valueType": { + "$ref": "142" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + }, + { + "$id": "877", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The link to the next page of items", + "type": { + "$id": "878", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "879", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + } + ] + }, + { + "$id": "880", + "kind": "model", + "name": "PagedConversationalAnalysisAuthoringProjectDeployment", + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", + "usage": "Output,Json", + "description": "Paged collection of ConversationalAnalysisAuthoringProjectDeployment items", + "decorators": [], + "properties": [ + { + "$id": "881", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The ConversationalAnalysisAuthoringProjectDeployment items on this page", + "type": { + "$id": "882", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringProjectDeployment", + "valueType": { + "$ref": "429" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + }, + { + "$id": "883", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The link to the next page of items", + "type": { + "$id": "884", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "885", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + } + ] + }, + { + "$id": "886", + "kind": "model", + "name": "PagedConversationalAnalysisAuthoringProjectTrainedModel", + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", + "usage": "Output,Json", + "description": "Paged collection of ConversationalAnalysisAuthoringProjectTrainedModel items", + "decorators": [], + "properties": [ + { + "$id": "887", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The ConversationalAnalysisAuthoringProjectTrainedModel items on this page", + "type": { + "$id": "888", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringProjectTrainedModel", + "valueType": { + "$ref": "558" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + }, + { + "$id": "889", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The link to the next page of items", + "type": { + "$id": "890", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "891", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + } + ] + }, + { + "$id": "892", + "kind": "model", + "name": "PagedConversationalAnalysisAuthoringUtteranceEvaluationResult", + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", + "usage": "Output,Json", + "description": "Paged collection of ConversationalAnalysisAuthoringUtteranceEvaluationResult items", + "decorators": [], + "properties": [ + { + "$id": "893", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The ConversationalAnalysisAuthoringUtteranceEvaluationResult items on this page", + "type": { + "$id": "894", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringUtteranceEvaluationResult", + "valueType": { + "$ref": "630" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + }, + { + "$id": "895", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The link to the next page of items", + "type": { + "$id": "896", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "897", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + } + ] + }, + { + "$id": "898", + "kind": "model", + "name": "PagedConversationalAnalysisAuthoringAssignedDeploymentResource", + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", + "usage": "Output,Json", + "description": "Paged collection of ConversationalAnalysisAuthoringAssignedDeploymentResource items", + "decorators": [], + "properties": [ + { + "$id": "899", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The ConversationalAnalysisAuthoringAssignedDeploymentResource items on this page", + "type": { + "$id": "900", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringAssignedDeploymentResource", + "valueType": { + "$ref": "744" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + }, + { + "$id": "901", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The link to the next page of items", + "type": { + "$id": "902", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "903", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + } + ] + }, + { + "$id": "904", + "kind": "model", + "name": "PagedConversationalAnalysisAuthoringTrainingJobState", + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage", + "usage": "Output,Json", + "description": "Paged collection of ConversationalAnalysisAuthoringTrainingJobState items", + "decorators": [], + "properties": [ + { + "$id": "905", + "kind": "property", + "name": "value", + "serializedName": "value", + "description": "The ConversationalAnalysisAuthoringTrainingJobState items on this page", + "type": { + "$id": "906", + "kind": "array", + "name": "ArrayConversationalAnalysisAuthoringTrainingJobState", + "valueType": { + "$ref": "391" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.value" + }, + { + "$id": "907", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "description": "The link to the next page of items", + "type": { + "$id": "908", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "909", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.Core.Foundations.CustomPage.nextLink" + } + ] + } + ], + "Clients": [ + { + "$id": "910", + "Name": "ConversationsClient", + "Description": "The language service API is a suite of natural language processing (NLP) skills\nbuilt with best-in-class Microsoft machine learning algorithms. The API can be\nused to analyze unstructured text for tasks such as sentiment analysis, key\nphrase extraction, language detection and question answering. Further\ndocumentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview.The language service conversations API is a suite of natural language processing (NLP) skills that can be used to analyze structured conversations (textual or spoken). The synchronous API in this suite accepts a request and mediates among multiple language projects, such as LUIS Generally Available, Question Answering, Conversational Language Understanding, and then calls the best candidate service to handle the request. At last, it returns a response with the candidate service's response as a payload.\\n\\n In some cases, this API needs to forward requests and responses between the caller and an upstream service. The asynchronous APIs in this suite enable tasks like Conversation Summarization and Conversational PII detection.", + "Operations": [], + "Protocol": { + "$id": "911" + }, + "Parameters": [ + { + "$id": "912", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoint (e.g.,\nhttps://.api.cognitiveservices.azure.com).", + "Type": { + "$id": "913", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "914", + "Name": "Endpoint", + "NameInRequest": "Endpoint", + "Type": { + "$id": "915", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "916", + "Name": "ConversationalAnalysisAuthoring", + "Operations": [ + { + "$id": "917", + "Name": "listProjects", + "ResourceName": "ConversationalAnalysisAuthoringProjectMetadata", + "Description": "Lists the existing projects.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "918", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoint (e.g.,\nhttps://.api.cognitiveservices.azure.com).", + "Type": { + "$id": "919", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "920", + "Name": "Endpoint", + "NameInRequest": "Endpoint", + "Type": { + "$id": "921", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "922", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "923", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "924", + "Type": { + "$id": "925", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "926", + "Name": "top", + "NameInRequest": "top", + "Description": "The number of result items to return.", + "Type": { + "$id": "927", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "928", + "Name": "skip", + "NameInRequest": "skip", + "Description": "The number of result items to skip.", + "Type": { + "$id": "929", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "930", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of result items per page.", + "Type": { + "$id": "931", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "932", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "933", + "kind": "constant", + "valueType": { + "$id": "934", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "935", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "874" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects", + "BufferResponse": true, + "Paging": { + "$id": "936", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.listProjects", + "Decorators": [] + }, + { + "$id": "937", + "Name": "getProject", + "ResourceName": "ConversationalAnalysisAuthoringProjectMetadata", + "Description": "Gets the details of a project.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "938", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "939", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "940", + "Type": { + "$id": "941", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "942", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "943", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "944", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "945", + "kind": "constant", + "valueType": { + "$id": "946", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "947", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "142" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getProject", + "Decorators": [] + }, + { + "$id": "948", + "Name": "createProject", + "ResourceName": "ConversationalAnalysisAuthoringProjectMetadata", + "Description": "Creates a new project or updates an existing one.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "949", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "950", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "951", + "Type": { + "$id": "952", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "953", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "954", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "955", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "This request has a JSON Merge Patch body.", + "Type": { + "$id": "956", + "kind": "constant", + "valueType": { + "$id": "957", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/merge-patch+json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "958", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "959", + "kind": "constant", + "valueType": { + "$id": "960", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "961", + "Name": "body", + "NameInRequest": "body", + "Description": "The request body", + "Type": { + "$ref": "192" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "962", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "142" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + }, + { + "$id": "963", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "142" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.createProject", + "Decorators": [] + }, + { + "$id": "964", + "Name": "deleteProject", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Deletes a project.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "965", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "966", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "967", + "Type": { + "$id": "968", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "969", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "970", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "971", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "972", + "kind": "constant", + "valueType": { + "$id": "973", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "974", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "975", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "976", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "977", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}", + "BufferResponse": true, + "LongRunning": { + "$id": "978", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "979", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.deleteProject", + "Decorators": [] + }, + { + "$id": "980", + "Name": "copyProjectAuthorization", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Generates a copy project operation authorization to the current target Azure\nresource.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "981", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "982", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "983", + "Type": { + "$id": "984", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "985", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "986", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "987", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "988", + "kind": "constant", + "valueType": { + "$id": "989", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "990", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "991", + "kind": "constant", + "valueType": { + "$id": "992", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "993", + "Name": "copyProjectAuthorizationRequest", + "NameInRequest": "copyProjectAuthorizationRequest", + "Type": { + "$ref": "205" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Spread", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "994", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "211" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/:authorize-copy", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.copyProjectAuthorization", + "Decorators": [] + }, + { + "$id": "995", + "Name": "copyProject", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Copies an existing project to another Azure resource.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "996", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "997", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "998", + "Type": { + "$id": "999", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1000", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1001", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1002", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1003", + "kind": "constant", + "valueType": { + "$id": "1004", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1005", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1006", + "kind": "constant", + "valueType": { + "$id": "1007", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1008", + "Name": "body", + "NameInRequest": "body", + "Description": "The copy project info.", + "Type": { + "$ref": "211" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1009", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1010", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1011", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1012", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/:copy", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1013", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1014", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.copyProject", + "Decorators": [] + }, + { + "$id": "1015", + "Name": "export", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Triggers a job to export a project's data.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1016", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1017", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1018", + "Type": { + "$id": "1019", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1020", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1021", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1022", + "Name": "ExportedProjectFormat", + "NameInRequest": "format", + "Description": "The format of the exported project file to use.", + "Type": { + "$ref": "78" + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1023", + "Name": "stringIndexType", + "NameInRequest": "stringIndexType", + "Description": "Specifies the method used to interpret string offsets. For additional\ninformation see https://aka.ms/text-analytics-offsets.", + "Type": { + "$ref": "84" + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1024", + "Name": "assetKind", + "NameInRequest": "assetKind", + "Description": "Kind of asset to export.", + "Type": { + "$id": "1025", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1026", + "Name": "trainedModelLabel", + "NameInRequest": "trainedModelLabel", + "Description": "Trained model label to export. If the trainedModelLabel is null, the default behavior is to export the current working copy.", + "Type": { + "$id": "1027", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1028", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1029", + "kind": "constant", + "valueType": { + "$id": "1030", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1031", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1032", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1033", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1034", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/:export", + "BufferResponse": true, + "LongRunning": { + "$id": "1035", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1036", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.export", + "Decorators": [] + }, + { + "$id": "1037", + "Name": "import", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Triggers a job to import a project. If a project with the same name already\nexists, the data of that project is replaced.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1038", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1039", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1040", + "Type": { + "$id": "1041", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1042", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1044", + "Name": "ExportedProjectFormat", + "NameInRequest": "format", + "Description": "The format of the exported project file to use.", + "Type": { + "$ref": "78" + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1045", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1046", + "kind": "constant", + "valueType": { + "$id": "1047", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1048", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1049", + "kind": "constant", + "valueType": { + "$id": "1050", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1051", + "Name": "body", + "NameInRequest": "body", + "Description": "The project data to import.", + "Type": { + "$ref": "224" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1052", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1053", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1054", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1055", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/:import", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1056", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1057", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.import", + "Decorators": [] + }, + { + "$id": "1058", + "Name": "train", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Triggers a training job for a project.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1059", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1060", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1061", + "Type": { + "$id": "1062", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1063", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1064", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1065", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1066", + "kind": "constant", + "valueType": { + "$id": "1067", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1068", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1069", + "kind": "constant", + "valueType": { + "$id": "1070", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1071", + "Name": "body", + "NameInRequest": "body", + "Description": "The training input parameters.", + "Type": { + "$ref": "357" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1072", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1073", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1074", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1075", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/:train", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1076", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1077", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "391" + }, + "BodyMediaType": "Json" + }, + "ResultPath": "result" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.train", + "Decorators": [] + }, + { + "$id": "1078", + "Name": "getCopyProjectStatus", + "ResourceName": "ConversationalAnalysisAuthoringCopyProjectJobState", + "Description": "Gets the status of an existing copy project job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1079", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1080", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1081", + "Type": { + "$id": "1082", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1083", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1084", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1085", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1086", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1087", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1088", + "kind": "constant", + "valueType": { + "$id": "1089", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1090", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "414" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/copy/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getCopyProjectStatus", + "Decorators": [] + }, + { + "$id": "1091", + "Name": "listDeployments", + "ResourceName": "ConversationalAnalysisAuthoringProjectDeployment", + "Description": "Lists the deployments belonging to a project.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1092", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1093", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1094", + "Type": { + "$id": "1095", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1096", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1097", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1098", + "Name": "top", + "NameInRequest": "top", + "Description": "The number of result items to return.", + "Type": { + "$id": "1099", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1100", + "Name": "skip", + "NameInRequest": "skip", + "Description": "The number of result items to skip.", + "Type": { + "$id": "1101", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1102", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of result items per page.", + "Type": { + "$id": "1103", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1104", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1105", + "kind": "constant", + "valueType": { + "$id": "1106", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1107", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "880" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/deployments", + "BufferResponse": true, + "Paging": { + "$id": "1108", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.listDeployments", + "Decorators": [] + }, + { + "$id": "1109", + "Name": "swapDeployments", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Swaps two existing deployments with each other.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1110", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1112", + "Type": { + "$id": "1113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1114", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1116", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1117", + "kind": "constant", + "valueType": { + "$id": "1118", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1119", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1120", + "kind": "constant", + "valueType": { + "$id": "1121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1122", + "Name": "body", + "NameInRequest": "body", + "Description": "The job object to swap two deployments.", + "Type": { + "$ref": "451" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1123", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1124", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1125", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1126", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/deployments/:swap", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1127", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1128", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.swapDeployments", + "Decorators": [] + }, + { + "$id": "1129", + "Name": "getDeployment", + "ResourceName": "ConversationalAnalysisAuthoringProjectDeployment", + "Description": "Gets the details of a deployment.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1130", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1132", + "Type": { + "$id": "1133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1134", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1136", + "Name": "deploymentName", + "NameInRequest": "deploymentName", + "Description": "Represents deployment name.", + "Type": { + "$id": "1137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1138", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1139", + "kind": "constant", + "valueType": { + "$id": "1140", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1141", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "456" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getDeployment", + "Decorators": [] + }, + { + "$id": "1142", + "Name": "deployProject", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Creates a new deployment or replaces an existing one.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1143", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1144", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1145", + "Type": { + "$id": "1146", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1147", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1148", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1149", + "Name": "deploymentName", + "NameInRequest": "deploymentName", + "Description": "The name of the specific deployment of the project to use.", + "Type": { + "$id": "1150", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1151", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1152", + "kind": "constant", + "valueType": { + "$id": "1153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1154", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1155", + "kind": "constant", + "valueType": { + "$id": "1156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1157", + "Name": "body", + "NameInRequest": "body", + "Description": "The new deployment info.", + "Type": { + "$ref": "471" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1158", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1159", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1160", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1161", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "PUT", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1162", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1163", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.deployProject", + "Decorators": [] + }, + { + "$id": "1164", + "Name": "deleteDeployment", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Deletes a project deployment.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1165", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1166", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1167", + "Type": { + "$id": "1168", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1169", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1170", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1171", + "Name": "deploymentName", + "NameInRequest": "deploymentName", + "Description": "The name of the specific deployment of the project to use.", + "Type": { + "$id": "1172", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1173", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1174", + "kind": "constant", + "valueType": { + "$id": "1175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1176", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1177", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1178", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1179", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}", + "BufferResponse": true, + "LongRunning": { + "$id": "1180", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1181", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.deleteDeployment", + "Decorators": [] + }, + { + "$id": "1182", + "Name": "deleteDeploymentFromResources", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Deletes a project deployment from the specified assigned resources.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1183", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1184", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1185", + "Type": { + "$id": "1186", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1187", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1188", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1189", + "Name": "deploymentName", + "NameInRequest": "deploymentName", + "Description": "The name of the specific deployment of the project to use.", + "Type": { + "$id": "1190", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1191", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1192", + "kind": "constant", + "valueType": { + "$id": "1193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1194", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1195", + "kind": "constant", + "valueType": { + "$id": "1196", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1197", + "Name": "body", + "NameInRequest": "body", + "Description": "The options for deleting the deployment.", + "Type": { + "$ref": "477" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1198", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1199", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1200", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1201", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}/:delete-from-resources", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1202", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1203", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.deleteDeploymentFromResources", + "Decorators": [] + }, + { + "$id": "1204", + "Name": "getDeploymentDeleteFromResourcesStatus", + "ResourceName": "ConversationalAnalysisAuthoringDeploymentDeleteFromResourcesJobState", + "Description": "Gets the status of an existing delete deployment from specific resources job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1205", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1206", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1207", + "Type": { + "$id": "1208", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1209", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1210", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1211", + "Name": "deploymentName", + "NameInRequest": "deploymentName", + "Description": "Represents deployment name.", + "Type": { + "$id": "1212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1213", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1214", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1215", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1216", + "kind": "constant", + "valueType": { + "$id": "1217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1218", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "481" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}/delete-from-resources/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getDeploymentDeleteFromResourcesStatus", + "Decorators": [] + }, + { + "$id": "1219", + "Name": "getDeploymentStatus", + "ResourceName": "ConversationalAnalysisAuthoringDeploymentJobState", + "Description": "Gets the status of an existing deployment job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1220", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1222", + "Type": { + "$id": "1223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1224", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1226", + "Name": "deploymentName", + "NameInRequest": "deploymentName", + "Description": "Represents deployment name.", + "Type": { + "$id": "1227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1228", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1229", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1230", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1231", + "kind": "constant", + "valueType": { + "$id": "1232", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1233", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "496" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/deployments/{deploymentName}/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getDeploymentStatus", + "Decorators": [] + }, + { + "$id": "1234", + "Name": "getSwapDeploymentsStatus", + "ResourceName": "ConversationalAnalysisAuthoringSwapDeploymentsJobState", + "Description": "Gets the status of an existing swap deployment job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1235", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1236", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1237", + "Type": { + "$id": "1238", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1239", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1240", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1241", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1242", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1243", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1244", + "kind": "constant", + "valueType": { + "$id": "1245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1246", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "511" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/deployments/swap/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getSwapDeploymentsStatus", + "Decorators": [] + }, + { + "$id": "1247", + "Name": "getExportStatus", + "ResourceName": "ConversationalAnalysisAuthoringExportProjectJobState", + "Description": "Gets the status of an export job. Once job completes, returns the project\nmetadata, and assets.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1248", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1249", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1250", + "Type": { + "$id": "1251", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1252", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1253", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1254", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1255", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1256", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1257", + "kind": "constant", + "valueType": { + "$id": "1258", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1259", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "526" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/export/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getExportStatus", + "Decorators": [] + }, + { + "$id": "1260", + "Name": "getImportStatus", + "ResourceName": "ConversationalAnalysisAuthoringImportProjectJobState", + "Description": "Gets the status for an import.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1261", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1263", + "Type": { + "$id": "1264", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1265", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1267", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1268", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1269", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1270", + "kind": "constant", + "valueType": { + "$id": "1271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1272", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "543" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/import/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getImportStatus", + "Decorators": [] + }, + { + "$id": "1273", + "Name": "listTrainedModels", + "ResourceName": "ConversationalAnalysisAuthoringProjectTrainedModel", + "Description": "Lists the trained models belonging to a project.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1274", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1276", + "Type": { + "$id": "1277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1278", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1280", + "Name": "top", + "NameInRequest": "top", + "Description": "The number of result items to return.", + "Type": { + "$id": "1281", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1282", + "Name": "skip", + "NameInRequest": "skip", + "Description": "The number of result items to skip.", + "Type": { + "$id": "1283", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1284", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of result items per page.", + "Type": { + "$id": "1285", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1286", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1287", + "kind": "constant", + "valueType": { + "$id": "1288", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1289", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "886" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/models", + "BufferResponse": true, + "Paging": { + "$id": "1290", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.listTrainedModels", + "Decorators": [] + }, + { + "$id": "1291", + "Name": "getTrainedModel", + "ResourceName": "ConversationalAnalysisAuthoringProjectTrainedModel", + "Description": "Gets the details of a trained model.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1292", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1293", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1294", + "Type": { + "$id": "1295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1296", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1298", + "Name": "trainedModelLabel", + "NameInRequest": "trainedModelLabel", + "Description": "The trained model label.", + "Type": { + "$id": "1299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1300", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1301", + "kind": "constant", + "valueType": { + "$id": "1302", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1303", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "574" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getTrainedModel", + "Decorators": [] + }, + { + "$id": "1304", + "Name": "deleteTrainedModel", + "ResourceName": "ConversationalAnalysisAuthoringProjectTrainedModel", + "Description": "Deletes an existing trained model.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1305", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1306", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1307", + "Type": { + "$id": "1308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1309", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1310", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1311", + "Name": "trainedModelLabel", + "NameInRequest": "trainedModelLabel", + "Description": "The trained model label.", + "Type": { + "$id": "1312", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1313", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1314", + "kind": "constant", + "valueType": { + "$id": "1315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1316", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.deleteTrainedModel", + "Decorators": [] + }, + { + "$id": "1317", + "Name": "evaluateModel", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Triggers evaluation operation on a trained model.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1318", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1320", + "Type": { + "$id": "1321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1322", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1324", + "Name": "trainedModelLabel", + "NameInRequest": "trainedModelLabel", + "Description": "The trained model label.", + "Type": { + "$id": "1325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1326", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1327", + "kind": "constant", + "valueType": { + "$id": "1328", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1329", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1330", + "kind": "constant", + "valueType": { + "$id": "1331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1332", + "Name": "body", + "NameInRequest": "body", + "Description": "The training input parameters.", + "Type": { + "$ref": "364" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1333", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1334", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1335", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1336", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/:evaluate", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1337", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1338", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "596" + }, + "BodyMediaType": "Json" + }, + "ResultPath": "result" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.evaluateModel", + "Decorators": [] + }, + { + "$id": "1339", + "Name": "loadSnapshot", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Restores the snapshot of this trained model to be the current working directory\nof the project.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1340", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1342", + "Type": { + "$id": "1343", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1344", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1345", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1346", + "Name": "trainedModelLabel", + "NameInRequest": "trainedModelLabel", + "Description": "The trained model label.", + "Type": { + "$id": "1347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1348", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1349", + "kind": "constant", + "valueType": { + "$id": "1350", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1351", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1352", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1353", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1354", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/:load-snapshot", + "BufferResponse": true, + "LongRunning": { + "$id": "1355", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1356", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.loadSnapshot", + "Decorators": [] + }, + { + "$id": "1357", + "Name": "getEvaluationStatus", + "ResourceName": "ConversationalAnalysisAuthoringEvaluationJobState", + "Description": "Gets the status for an evaluation job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1358", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1360", + "Type": { + "$id": "1361", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1362", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1363", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1364", + "Name": "trainedModelLabel", + "NameInRequest": "trainedModelLabel", + "Description": "The trained model label.", + "Type": { + "$id": "1365", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1366", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1367", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1368", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1369", + "kind": "constant", + "valueType": { + "$id": "1370", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1371", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "614" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/evaluate/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getEvaluationStatus", + "Decorators": [] + }, + { + "$id": "1372", + "Name": "getModelEvaluationResults", + "ResourceName": "ConversationalAnalysisAuthoringUtteranceEvaluationResult", + "Description": "Gets the detailed results of the evaluation for a trained model. This includes\nthe raw inference results for the data included in the evaluation process.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1373", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1374", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1375", + "Type": { + "$id": "1376", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1377", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1378", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1379", + "Name": "trainedModelLabel", + "NameInRequest": "trainedModelLabel", + "Description": "The trained model label.", + "Type": { + "$id": "1380", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1381", + "Name": "top", + "NameInRequest": "top", + "Description": "The number of result items to return.", + "Type": { + "$id": "1382", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1383", + "Name": "skip", + "NameInRequest": "skip", + "Description": "The number of result items to skip.", + "Type": { + "$id": "1384", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1385", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of result items per page.", + "Type": { + "$id": "1386", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1387", + "Name": "stringIndexType", + "NameInRequest": "stringIndexType", + "Description": "Specifies the method used to interpret string offsets. For additional\ninformation see https://aka.ms/text-analytics-offsets.", + "Type": { + "$ref": "84" + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1388", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1389", + "kind": "constant", + "valueType": { + "$id": "1390", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1391", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "892" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/evaluation/result", + "BufferResponse": true, + "Paging": { + "$id": "1392", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getModelEvaluationResults", + "Decorators": [] + }, + { + "$id": "1393", + "Name": "getModelEvaluationSummary", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Gets the evaluation summary of a trained model. The summary includes high level\nperformance measurements of the model e.g., F1, Precision, Recall, etc.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1394", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1395", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1396", + "Type": { + "$id": "1397", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1398", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1399", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1400", + "Name": "trainedModelLabel", + "NameInRequest": "trainedModelLabel", + "Description": "The trained model label.", + "Type": { + "$id": "1401", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1402", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1403", + "kind": "constant", + "valueType": { + "$id": "1404", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1405", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "654" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/evaluation/summary-result", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getModelEvaluationSummary", + "Decorators": [] + }, + { + "$id": "1406", + "Name": "getLoadSnapshotStatus", + "ResourceName": "ConversationalAnalysisAuthoringLoadSnapshotJobState", + "Description": "Gets the status for loading a snapshot.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1407", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1409", + "Type": { + "$id": "1410", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1411", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1412", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1413", + "Name": "trainedModelLabel", + "NameInRequest": "trainedModelLabel", + "Description": "The trained model label.", + "Type": { + "$id": "1414", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1415", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1416", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1417", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1418", + "kind": "constant", + "valueType": { + "$id": "1419", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1420", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "729" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/models/{trainedModelLabel}/load-snapshot/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getLoadSnapshotStatus", + "Decorators": [] + }, + { + "$id": "1421", + "Name": "listDeploymentResources", + "ResourceName": "ConversationalAnalysisAuthoringAssignedDeploymentResource", + "Description": "Lists the deployments resources assigned to the project.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1422", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1423", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1424", + "Type": { + "$id": "1425", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1426", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1427", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1428", + "Name": "top", + "NameInRequest": "top", + "Description": "The number of result items to return.", + "Type": { + "$id": "1429", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1430", + "Name": "skip", + "NameInRequest": "skip", + "Description": "The number of result items to skip.", + "Type": { + "$id": "1431", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1432", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of result items per page.", + "Type": { + "$id": "1433", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1434", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1435", + "kind": "constant", + "valueType": { + "$id": "1436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1437", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "898" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/resources", + "BufferResponse": true, + "Paging": { + "$id": "1438", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.listDeploymentResources", + "Decorators": [] + }, + { + "$id": "1439", + "Name": "assignDeploymentResources", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Assign new Azure resources to a project to allow deploying new deployments to\nthem. This API is available only via AAD authentication and not supported via\nsubscription key authentication. For more details about AAD authentication,\ncheck here:\nhttps://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1440", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1442", + "Type": { + "$id": "1443", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1444", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1445", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1446", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1447", + "kind": "constant", + "valueType": { + "$id": "1448", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1449", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1450", + "kind": "constant", + "valueType": { + "$id": "1451", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1452", + "Name": "body", + "NameInRequest": "body", + "Description": "The new project resources info.", + "Type": { + "$ref": "749" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1453", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1454", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1455", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1456", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/resources/:assign", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1457", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1458", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.assignDeploymentResources", + "Decorators": [] + }, + { + "$id": "1459", + "Name": "unassignDeploymentResources", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Unassign resources from a project. This disallows deploying new deployments to\nthese resources, and deletes existing deployments assigned to them.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1460", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1462", + "Type": { + "$id": "1463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1464", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1465", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1466", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1467", + "kind": "constant", + "valueType": { + "$id": "1468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1469", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1470", + "kind": "constant", + "valueType": { + "$id": "1471", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1472", + "Name": "body", + "NameInRequest": "body", + "Description": "The info for the deployment resources to be deleted.", + "Type": { + "$ref": "759" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1473", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1474", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1475", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1476", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/resources/:unassign", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "LongRunning": { + "$id": "1477", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1478", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json" + } + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.unassignDeploymentResources", + "Decorators": [] + }, + { + "$id": "1479", + "Name": "getAssignDeploymentResourcesStatus", + "ResourceName": "ConversationalAnalysisAuthoringDeploymentResourcesJobState", + "Description": "Gets the status of an existing assign deployment resources job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1480", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1481", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1482", + "Type": { + "$id": "1483", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1484", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1485", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1486", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1487", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1488", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1489", + "kind": "constant", + "valueType": { + "$id": "1490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1491", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "763" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/resources/assign/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getAssignDeploymentResourcesStatus", + "Decorators": [] + }, + { + "$id": "1492", + "Name": "getUnassignDeploymentResourcesStatus", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Gets the status of an existing unassign deployment resources job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1493", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1494", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1495", + "Type": { + "$id": "1496", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1497", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1498", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1499", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1500", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1501", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1502", + "kind": "constant", + "valueType": { + "$id": "1503", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1504", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "778" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/resources/unassign/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getUnassignDeploymentResourcesStatus", + "Decorators": [] + }, + { + "$id": "1505", + "Name": "listTrainingJobs", + "ResourceName": "ConversationalAnalysisAuthoringTrainingJobState", + "Description": "Lists the non-expired training jobs created for a project.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1506", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1507", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1508", + "Type": { + "$id": "1509", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1510", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1511", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1512", + "Name": "top", + "NameInRequest": "top", + "Description": "The number of result items to return.", + "Type": { + "$id": "1513", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1514", + "Name": "skip", + "NameInRequest": "skip", + "Description": "The number of result items to skip.", + "Type": { + "$id": "1515", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1516", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of result items per page.", + "Type": { + "$id": "1517", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1518", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1519", + "kind": "constant", + "valueType": { + "$id": "1520", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1521", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "904" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/train/jobs", + "BufferResponse": true, + "Paging": { + "$id": "1522", + "ItemName": "value", + "NextLinkName": "nextLink" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.listTrainingJobs", + "Decorators": [] + }, + { + "$id": "1523", + "Name": "getTrainingStatus", + "ResourceName": "ConversationalAnalysisAuthoringTrainingJobState", + "Description": "Gets the status for a training job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1524", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1525", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1526", + "Type": { + "$id": "1527", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1528", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The new project name.", + "Type": { + "$id": "1529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1530", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1532", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1533", + "kind": "constant", + "valueType": { + "$id": "1534", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1535", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "793" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/train/jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getTrainingStatus", + "Decorators": [] + }, + { + "$id": "1536", + "Name": "cancelTrainingJob", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Triggers a cancellation for a running training job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1537", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1539", + "Type": { + "$id": "1540", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1541", + "Name": "projectName", + "NameInRequest": "projectName", + "Description": "The name of the project to use.", + "Type": { + "$id": "1542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1543", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1544", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1545", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1546", + "kind": "constant", + "valueType": { + "$id": "1547", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1548", + "StatusCodes": [ + 202 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "1549", + "Name": "operationLocation", + "NameInResponse": "Operation-Location", + "Description": "The location for monitoring the operation state.", + "Type": { + "$id": "1550", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1551", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/{projectName}/train/jobs/{jobId}/:cancel", + "BufferResponse": true, + "LongRunning": { + "$id": "1552", + "FinalStateVia": 3, + "FinalResponse": { + "$id": "1553", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "391" + }, + "BodyMediaType": "Json" + }, + "ResultPath": "result" + }, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.cancelTrainingJob", + "Decorators": [] + }, + { + "$id": "1554", + "Name": "getProjectDeletionStatus", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Gets the status for a project deletion job.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1555", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1556", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1557", + "Type": { + "$id": "1558", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1559", + "Name": "jobId", + "NameInRequest": "jobId", + "Description": "The job ID.", + "Type": { + "$id": "1560", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1561", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1562", + "kind": "constant", + "valueType": { + "$id": "1563", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1564", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "809" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/global/deletion-jobs/{jobId}", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getProjectDeletionStatus", + "Decorators": [] + }, + { + "$id": "1565", + "Name": "listAssignedResourceDeployments", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Lists the deployments to which an Azure resource is assigned. This doesn't\nreturn deployments belonging to projects owned by this resource. It only\nreturns deployments belonging to projects owned by other resources.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1566", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1567", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1568", + "Type": { + "$id": "1569", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1570", + "Name": "top", + "NameInRequest": "top", + "Description": "The maximum number of resources to return from the collection.", + "Type": { + "$id": "1571", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1572", + "Name": "skip", + "NameInRequest": "skip", + "Description": "An offset into the collection of the first resource to be returned.", + "Type": { + "$id": "1573", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1574", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of resources to include in a single response.", + "Type": { + "$id": "1575", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1576", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1577", + "kind": "constant", + "valueType": { + "$id": "1578", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1579", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "824" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/global/deployments/resources", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.listAssignedResourceDeployments", + "Decorators": [] + }, + { + "$id": "1580", + "Name": "getSupportedLanguages", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Lists the supported languages for the given project type.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1581", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1582", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1583", + "Type": { + "$id": "1584", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1585", + "Name": "ProjectKind", + "NameInRequest": "projectKind", + "Description": "The project kind.", + "Type": { + "$ref": "2" + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1586", + "Name": "top", + "NameInRequest": "top", + "Description": "The maximum number of resources to return from the collection.", + "Type": { + "$id": "1587", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1588", + "Name": "skip", + "NameInRequest": "skip", + "Description": "An offset into the collection of the first resource to be returned.", + "Type": { + "$id": "1589", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1590", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of resources to include in a single response.", + "Type": { + "$id": "1591", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1592", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1593", + "kind": "constant", + "valueType": { + "$id": "1594", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1595", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "842" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/global/languages", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getSupportedLanguages", + "Decorators": [] + }, + { + "$id": "1596", + "Name": "getSupportedPrebuiltEntities", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Lists the supported prebuilt entities that can be used while creating composed\nentities.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1597", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1598", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1599", + "Type": { + "$id": "1600", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1601", + "Name": "language", + "NameInRequest": "language", + "Description": "The language to get supported prebuilt entities for. Required if multilingual\nis false. This is BCP-47 representation of a language. For example, use \"en\"\nfor English, \"en-gb\" for English (UK), \"es\" for Spanish etc.", + "Type": { + "$id": "1602", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1603", + "Name": "multilingual", + "NameInRequest": "multilingual", + "Description": "Whether to get the support prebuilt entities for multilingual or monolingual\nprojects. If true, the language parameter is ignored.", + "Type": { + "$id": "1604", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1605", + "Name": "top", + "NameInRequest": "top", + "Description": "The maximum number of resources to return from the collection.", + "Type": { + "$id": "1606", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1607", + "Name": "skip", + "NameInRequest": "skip", + "Description": "An offset into the collection of the first resource to be returned.", + "Type": { + "$id": "1608", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1609", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of resources to include in a single response.", + "Type": { + "$id": "1610", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1611", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1612", + "kind": "constant", + "valueType": { + "$id": "1613", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1614", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "852" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/global/prebuilt-entities", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.getSupportedPrebuiltEntities", + "Decorators": [] + }, + { + "$id": "1615", + "Name": "listTrainingConfigVersions", + "ResourceName": "ConversationalAnalysisAuthoring", + "Description": "Lists the support training config version for a given project type.", + "Accessibility": "public", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + }, + { + "$id": "1616", + "Name": "apiVersion", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "1617", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": true, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Client", + "DefaultValue": { + "$id": "1618", + "Type": { + "$id": "1619", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "2024-11-15-preview" + }, + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1620", + "Name": "ProjectKind", + "NameInRequest": "projectKind", + "Description": "The project kind.", + "Type": { + "$ref": "2" + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1621", + "Name": "top", + "NameInRequest": "top", + "Description": "The maximum number of resources to return from the collection.", + "Type": { + "$id": "1622", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1623", + "Name": "skip", + "NameInRequest": "skip", + "Description": "An offset into the collection of the first resource to be returned.", + "Type": { + "$id": "1624", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1625", + "Name": "maxpagesize", + "NameInRequest": "maxpagesize", + "Description": "The maximum number of resources to include in a single response.", + "Type": { + "$id": "1626", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1627", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1628", + "kind": "constant", + "valueType": { + "$id": "1629", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1630", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "864" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "None", + "Uri": "{Endpoint}/language", + "Path": "/authoring/analyze-conversations/projects/global/training-config-versions", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Language.Authoring.Conversations.ConversationalAnalysisAuthoring.listTrainingConfigVersions", + "Decorators": [] + } + ], + "Protocol": { + "$id": "1631" + }, + "Parent": "ConversationsClient", + "Parameters": [ + { + "$ref": "918" + }, + { + "$ref": "920" + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "1632", + "ApiKey": { + "$id": "1633", + "Name": "Ocp-Apim-Subscription-Key" + }, + "OAuth2": { + "$id": "1634", + "Scopes": [ + "https://cognitiveservices.azure.com/.default" + ] + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/Azure.AI.Language.Authoring.Analyzetext.sln b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/Azure.AI.Language.Authoring.Analyzetext.sln new file mode 100644 index 0000000000000..fe0dc0df00a84 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/Azure.AI.Language.Authoring.Analyzetext.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Authoring.Analyzetext", "src\Azure.AI.Language.Authoring.Analyzetext.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Authoring.Analyzetext.Tests", "tests\Azure.AI.Language.Authoring.Analyzetext.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/CHANGELOG.md b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/CHANGELOG.md new file mode 100644 index 0000000000000..13dd08af78abe --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/Directory.Build.props b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/Directory.Build.props new file mode 100644 index 0000000000000..63bd836ad44b7 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/README.md b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/README.md new file mode 100644 index 0000000000000..ee58a277c15c0 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/README.md @@ -0,0 +1,107 @@ +# Azure.AI.Language.Authoring.Analyzetext client library for .NET + +Azure.AI.Language.Authoring.Analyzetext is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.AI.Language.Authoring.Analyzetext --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateClientForSpecificApiVersion +Uri endpoint = new Uri(""); +DefaultAzureCredential credential = new DefaultAzureCredential(); +ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.) +var client = new Client(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/analyzetext/Azure.AI.Language.Authoring.Analyzetext/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/analyzetext/Azure.AI.Language.Authoring.Analyzetext/README.png) diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Azure.AI.Language.Authoring.Analyzetext.csproj b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Azure.AI.Language.Authoring.Analyzetext.csproj new file mode 100644 index 0000000000000..6429bf706d3ff --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Azure.AI.Language.Authoring.Analyzetext.csproj @@ -0,0 +1,20 @@ + + + This is the Azure.AI.Language.Authoring.Analyzetext client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.AI.Language.Authoring.Analyzetext for Azure Data Plane + 1.0.0-beta.1 + Azure.AI.Language.Authoring.Analyzetext + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextClientBuilderExtensions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextClientBuilderExtensions.cs new file mode 100644 index 0000000000000..42e2eed9ccf3f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextClientBuilderExtensions.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.AI.Language.Authoring.Analyzetext; +using Azure.Core.Extensions; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class AILanguageAuthoringAnalyzetextClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// + /// Supported Cognitive Services endpoint (e.g., + /// https://<resource-name>.api.cognitiveservices.azure.com). + /// + /// A credential used to authenticate to an Azure Service. + public static IAzureClientBuilder AddTextClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new TextClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// + /// Supported Cognitive Services endpoint (e.g., + /// https://<resource-name>.api.cognitiveservices.azure.com). + /// + public static IAzureClientBuilder AddTextClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new TextClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddTextClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextModelFactory.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextModelFactory.cs new file mode 100644 index 0000000000000..52e7cd0d15ab3 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextModelFactory.cs @@ -0,0 +1,1362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Model factory for models. + public static partial class AILanguageAuthoringAnalyzetextModelFactory + { + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// Represents the project last training datetime. + /// Represents the project last deployment datetime. + /// The project kind. + /// The storage container name. + /// The project settings. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// A new instance for mocking. + public static ProjectMetadata ProjectMetadata(DateTimeOffset createdDateTime = default, DateTimeOffset lastModifiedDateTime = default, DateTimeOffset? lastTrainedDateTime = null, DateTimeOffset? lastDeployedDateTime = null, ProjectKind projectKind = default, string storageInputContainerName = null, ProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new ProjectMetadata( + createdDateTime, + lastModifiedDateTime, + lastTrainedDateTime, + lastDeployedDateTime, + projectKind, + storageInputContainerName, + settings, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. + /// The target of the error. + /// An array of details about specific errors that led to this reported error. + /// + /// An object containing more specific information than the current object about + /// the error. + /// + /// A new instance for mocking. + public static Error Error(ErrorCode code = default, string message = null, string target = null, IEnumerable details = null, InnerErrorModel innererror = null) + { + details ??= new List(); + + return new Error( + code, + message, + target, + details?.ToList(), + innererror, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// Error message. + /// Error details. + /// Error target. + /// + /// An object containing more specific information than the current object about + /// the error. + /// + /// A new instance for mocking. + public static InnerErrorModel InnerErrorModel(InnerErrorCode code = default, string message = null, IReadOnlyDictionary details = null, string target = null, InnerErrorModel innererror = null) + { + details ??= new Dictionary(); + + return new InnerErrorModel( + code, + message, + details, + target, + innererror, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// Represents the project last training datetime. + /// Represents the project last deployment datetime. + /// The project kind. + /// The storage container name. + /// The project settings. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// A new instance for mocking. + public static GetProjectResponse GetProjectResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastModifiedDateTime = default, DateTimeOffset? lastTrainedDateTime = null, DateTimeOffset? lastDeployedDateTime = null, ProjectKind projectKind = default, string storageInputContainerName = null, ProjectSettings settings = null, bool? multilingual = null, string description = null, string language = null) + { + return new GetProjectResponse( + createdDateTime, + lastModifiedDateTime, + lastTrainedDateTime, + lastDeployedDateTime, + projectKind, + storageInputContainerName, + settings, + multilingual, + description, + language, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The project kind. + /// The storage container name. + /// The project settings. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// A new instance for mocking. + public static CreateProjectOptions CreateProjectOptions(ProjectKind projectKind = default, string storageInputContainerName = null, ProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new CreateProjectOptions( + projectKind, + storageInputContainerName, + settings, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The version of the exported file. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. + /// + /// Represents the project metadata. + /// + /// Represents the project assets. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// A new instance for mocking. + public static ExportedProject ExportedProject(string projectFileVersion = null, StringIndexType stringIndexType = default, CreateProjectOptions metadata = null, ExportedProjectAssets assets = null) + { + return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Represents the summary file location in the blob store container associated + /// with the project. + /// + /// The location of the document in the storage. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// A new instance for mocking. + public static ExportedCustomAbstractiveSummarizationDocument ExportedCustomAbstractiveSummarizationDocument(string summaryLocation = null, string location = null, string language = null, string dataset = null) + { + return new ExportedCustomAbstractiveSummarizationDocument(summaryLocation, location, language, dataset, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. + /// + /// Represents the evaluation options. By default, the evaluation kind is + /// percentage, with training split percentage as 80, and testing split percentage + /// as 20. + /// + /// Represents the settings for using data generation as part of training a custom model. + /// A new instance for mocking. + public static TrainingJobOptions TrainingJobOptions(string modelLabel = null, string trainingConfigVersion = null, EvaluationOptions evaluationOptions = null, DataGenerationSettings dataGenerationSettings = null) + { + return new TrainingJobOptions(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Connection type for data generation settings. Currently only supports Azure Open AI. + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + /// Deployment name of model to be used for synthetic data generation. + /// A new instance for mocking. + public static DataGenerationConnectionInfo DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind = default, string resourceId = null, string deploymentName = null) + { + return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents model train status. + /// Represents model evaluation status. + /// Represents the estimate end date time for training and evaluation. + /// A new instance for mocking. + public static TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, SubTrainingJobState trainingStatus = null, SubTrainingJobState evaluationStatus = null, DateTimeOffset? estimatedEndDateTime = null) + { + return new TrainingJobResult( + modelLabel, + trainingConfigVersion, + trainingStatus, + evaluationStatus, + estimatedEndDateTime, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents progress percentage. + /// Represents the start date time. + /// Represents the end date time. + /// Represents the status of the sub-operation. + /// A new instance for mocking. + public static SubTrainingJobState SubTrainingJobState(int percentComplete = default, DateTimeOffset? startDateTime = null, DateTimeOffset? endDateTime = null, JobStatus status = default) + { + return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents training tasks detailed result. + /// A new instance for mocking. + public static TrainingJobState TrainingJobState(string jobId = null, DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, TrainingJobResult result = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new TrainingJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + result, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The warning code. + /// The warning message. + /// A new instance for mocking. + public static Warning Warning(string code = null, string message = null) + { + return new Warning(code, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetCopyProjectStatusResponse GetCopyProjectStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetCopyProjectStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents deployment name. + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// A new instance for mocking. + public static ProjectDeployment ProjectDeployment(string deploymentName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default, string modelTrainingConfigVersion = null, IEnumerable assignedResources = null) + { + assignedResources ??= new List(); + + return new ProjectDeployment( + deploymentName, + modelId, + lastTrainedDateTime, + lastDeployedDateTime, + deploymentExpirationDate, + modelTrainingConfigVersion, + assignedResources?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// A new instance for mocking. + public static DeploymentResource DeploymentResource(string resourceId = null, string region = null) + { + return new DeploymentResource(resourceId, region, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// A new instance for mocking. + public static GetDeploymentResponse GetDeploymentResponse(string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default, string modelTrainingConfigVersion = null, IEnumerable assignedResources = null) + { + assignedResources ??= new List(); + + return new GetDeploymentResponse( + modelId, + lastTrainedDateTime, + lastDeployedDateTime, + deploymentExpirationDate, + modelTrainingConfigVersion, + assignedResources?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the trained model label. + /// + /// Represents the resource IDs to be assigned to the deployment. + /// If provided, the deployment will be rolled out to the resources + /// provided here as well as the original resource in which the project is created. + /// + /// A new instance for mocking. + public static CreateDeploymentOptions CreateDeploymentOptions(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) + { + assignedResourceIds ??= new List(); + + return new CreateDeploymentOptions(trainedModelLabel, assignedResourceIds?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetDeploymentDeleteFromResourcesStatusResponse GetDeploymentDeleteFromResourcesStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetDeploymentDeleteFromResourcesStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetDeploymentStatusResponse GetDeploymentStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetDeploymentStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetSwapDeploymentsStatusResponse GetSwapDeploymentsStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetSwapDeploymentsStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// The URL to use in order to download the exported project. + /// A new instance for mocking. + public static GetExportStatusResponse GetExportStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, string resultUrl = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetExportStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + resultUrl, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The exported model name. + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// A new instance for mocking. + public static ExportedTrainedModel ExportedTrainedModel(string exportedModelName = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastExportedModelDateTime = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null) + { + return new ExportedTrainedModel( + exportedModelName, + modelId, + lastTrainedDateTime, + lastExportedModelDateTime, + modelExpirationDate, + modelTrainingConfigVersion, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// A new instance for mocking. + public static GetExportedModelResponse GetExportedModelResponse(string modelId = null, DateTimeOffset lastTrainedDateTime = default, DateTimeOffset lastExportedModelDateTime = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null) + { + return new GetExportedModelResponse( + modelId, + lastTrainedDateTime, + lastExportedModelDateTime, + modelExpirationDate, + modelTrainingConfigVersion, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetExportedModelJobStatusResponse GetExportedModelJobStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetExportedModelJobStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The model files belonging to this model. + /// A new instance for mocking. + public static ExportedModelManifest ExportedModelManifest(IEnumerable modelFiles = null) + { + modelFiles ??= new List(); + + return new ExportedModelManifest(modelFiles?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the file. + /// The URI to retrieve the content of the file. + /// A new instance for mocking. + public static ModelFile ModelFile(string name = null, Uri contentUri = null) + { + return new ModelFile(name, contentUri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetImportStatusResponse GetImportStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetImportStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The trained model label. + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// A new instance for mocking. + public static ProjectTrainedModel ProjectTrainedModel(string label = null, string modelId = null, DateTimeOffset lastTrainedDateTime = default, int lastTrainingDurationInSeconds = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null, bool hasSnapshot = default) + { + return new ProjectTrainedModel( + label, + modelId, + lastTrainedDateTime, + lastTrainingDurationInSeconds, + modelExpirationDate, + modelTrainingConfigVersion, + hasSnapshot, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// A new instance for mocking. + public static GetTrainedModelResponse GetTrainedModelResponse(string modelId = null, DateTimeOffset lastTrainedDateTime = default, int lastTrainingDurationInSeconds = default, DateTimeOffset modelExpirationDate = default, string modelTrainingConfigVersion = null, bool hasSnapshot = default) + { + return new GetTrainedModelResponse( + modelId, + lastTrainedDateTime, + lastTrainingDurationInSeconds, + modelExpirationDate, + modelTrainingConfigVersion, + hasSnapshot, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Represents trained model label. + /// Represents training config version. + /// Represents progress percentage. + /// A new instance for mocking. + public static EvaluationJobResult EvaluationJobResult(EvaluationOptions evaluationOptions = null, string modelLabel = null, string trainingConfigVersion = null, int percentComplete = default) + { + return new EvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents evaluation task detailed result. + /// A new instance for mocking. + public static GetEvaluationStatusResponse GetEvaluationStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, EvaluationJobResult result = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetEvaluationStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + result, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// A new instance for mocking. + public static DocumentEvaluationResult DocumentEvaluationResult(string projectKind = null, string location = null, string language = null) + { + return new UnknownDocumentEvaluationResult(projectKind == null ? default : new ProjectKind(projectKind), location, language, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for entity recognition. + /// A new instance for mocking. + public static CustomEntityRecognitionDocumentEvaluationResult CustomEntityRecognitionDocumentEvaluationResult(string location = null, string language = null, DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult = null) + { + return new CustomEntityRecognitionDocumentEvaluationResult(ProjectKind.CustomEntityRecognition, location, language, serializedAdditionalRawData: null, customEntityRecognitionResult); + } + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// A new instance for mocking. + public static DocumentEntityRecognitionEvaluationResult DocumentEntityRecognitionEvaluationResult(IEnumerable entities = null) + { + entities ??= new List(); + + return new DocumentEntityRecognitionEvaluationResult(entities?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the region's expected entity labels. + /// Represents the region's predicted entity labels. + /// Represents the region offset. + /// Represents the region length. + /// A new instance for mocking. + public static DocumentEntityRegionEvaluationResult DocumentEntityRegionEvaluationResult(IEnumerable expectedEntities = null, IEnumerable predictedEntities = null, int regionOffset = default, int regionLength = default) + { + expectedEntities ??= new List(); + predictedEntities ??= new List(); + + return new DocumentEntityRegionEvaluationResult(expectedEntities?.ToList(), predictedEntities?.ToList(), regionOffset, regionLength, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the entity category. + /// Represents the entity offset index relative to the original text. + /// Represents the entity length. + /// A new instance for mocking. + public static DocumentEntityLabelEvaluationResult DocumentEntityLabelEvaluationResult(string category = null, int offset = default, int length = default) + { + return new DocumentEntityLabelEvaluationResult(category, offset, length, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for entity recognition. + /// A new instance for mocking. + public static CustomHealthcareDocumentEvaluationResult CustomHealthcareDocumentEvaluationResult(string location = null, string language = null, DocumentHealthcareEvaluationResult customHealthcareResult = null) + { + return new CustomHealthcareDocumentEvaluationResult(ProjectKind.CustomHealthcare, location, language, serializedAdditionalRawData: null, customHealthcareResult); + } + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// A new instance for mocking. + public static DocumentHealthcareEvaluationResult DocumentHealthcareEvaluationResult(IEnumerable entities = null) + { + entities ??= new List(); + + return new DocumentHealthcareEvaluationResult(entities?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for multi label classification. + /// A new instance for mocking. + public static CustomMultiLabelClassificationDocumentEvaluationResult CustomMultiLabelClassificationDocumentEvaluationResult(string location = null, string language = null, DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult = null) + { + return new CustomMultiLabelClassificationDocumentEvaluationResult(ProjectKind.CustomMultiLabelClassification, location, language, serializedAdditionalRawData: null, customMultiLabelClassificationResult); + } + + /// Initializes a new instance of . + /// Represents the document's expected classes. + /// Represents the document's predicted classes. + /// A new instance for mocking. + public static DocumentMultiLabelClassificationEvaluationResult DocumentMultiLabelClassificationEvaluationResult(IEnumerable expectedClasses = null, IEnumerable predictedClasses = null) + { + expectedClasses ??= new List(); + predictedClasses ??= new List(); + + return new DocumentMultiLabelClassificationEvaluationResult(expectedClasses?.ToList(), predictedClasses?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for single label classification. + /// A new instance for mocking. + public static CustomSingleLabelClassificationDocumentEvaluationResult CustomSingleLabelClassificationDocumentEvaluationResult(string location = null, string language = null, DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult = null) + { + return new CustomSingleLabelClassificationDocumentEvaluationResult(ProjectKind.CustomSingleLabelClassification, location, language, serializedAdditionalRawData: null, customSingleLabelClassificationResult); + } + + /// Initializes a new instance of . + /// Represents the document's expected class. + /// Represents the document's predicted class. + /// A new instance for mocking. + public static DocumentSingleLabelClassificationEvaluationResult DocumentSingleLabelClassificationEvaluationResult(string expectedClass = null, string predictedClass = null) + { + return new DocumentSingleLabelClassificationEvaluationResult(expectedClass, predictedClass, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for text sentiment. + /// A new instance for mocking. + public static CustomTextSentimentDocumentEvaluationResult CustomTextSentimentDocumentEvaluationResult(string location = null, string language = null, DocumentTextSentimentEvaluationResult customTextSentimentResult = null) + { + return new CustomTextSentimentDocumentEvaluationResult(ProjectKind.CustomTextSentiment, location, language, serializedAdditionalRawData: null, customTextSentimentResult); + } + + /// Initializes a new instance of . + /// Represents the document's expected sentiment labels. + /// Represents the document's predicted sentiment labels. + /// A new instance for mocking. + public static DocumentTextSentimentEvaluationResult DocumentTextSentimentEvaluationResult(IEnumerable expectedSentimentSpans = null, IEnumerable predictedSentimentSpans = null) + { + expectedSentimentSpans ??= new List(); + predictedSentimentSpans ??= new List(); + + return new DocumentTextSentimentEvaluationResult(expectedSentimentSpans?.ToList(), predictedSentimentSpans?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the sentiment category. + /// Represents the sentiment offset index relative to the original text. + /// Represents the sentiment length. + /// A new instance for mocking. + public static DocumentSentimentLabelEvaluationResult DocumentSentimentLabelEvaluationResult(Sentiment category = default, int offset = default, int length = default) + { + return new DocumentSentimentLabelEvaluationResult(category, offset, length, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// A new instance for mocking. + public static EvaluationSummary EvaluationSummary(string projectKind = null, EvaluationOptions evaluationOptions = null) + { + return new UnknownEvaluationSummary(projectKind == null ? default : new ProjectKind(projectKind), evaluationOptions, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to extraction evaluation. + /// A new instance for mocking. + public static CustomEntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluationSummary(EvaluationOptions evaluationOptions = null, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = null) + { + return new CustomEntityRecognitionEvaluationSummary(ProjectKind.CustomEntityRecognition, evaluationOptions, serializedAdditionalRawData: null, customEntityRecognitionEvaluation); + } + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two entities (the two entities can be + /// the same). The matrix is between the entity that was labelled and the entity + /// that was predicted. + /// + /// Represents the entities evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// A new instance for mocking. + public static EntityRecognitionEvaluationSummary EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary entities = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + entities ??= new Dictionary(); + + return new EntityRecognitionEvaluationSummary( + confusionMatrix, + entities, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Additional Properties. + /// A new instance for mocking. + public static ConfusionMatrix ConfusionMatrix(IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new ConfusionMatrix(additionalProperties); + } + + /// Initializes a new instance of . + /// Additional Properties. + /// A new instance for mocking. + public static ConfusionMatrixRow ConfusionMatrixRow(IReadOnlyDictionary additionalProperties = null) + { + additionalProperties ??= new Dictionary(); + + return new ConfusionMatrixRow(additionalProperties); + } + + /// Initializes a new instance of . + /// Represents normalized value in percentages. + /// Represents raw value. + /// A new instance for mocking. + public static ConfusionMatrixCell ConfusionMatrixCell(float normalizedValue = default, float rawValue = default) + { + return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static EntityEvaluationSummary EntityEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new EntityEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to health care evaluation. + /// A new instance for mocking. + public static CustomHealthcareEvaluationSummary CustomHealthcareEvaluationSummary(EvaluationOptions evaluationOptions = null, EntityRecognitionEvaluationSummary customHealthcareEvaluation = null) + { + return new CustomHealthcareEvaluationSummary(ProjectKind.CustomHealthcare, evaluationOptions, serializedAdditionalRawData: null, customHealthcareEvaluation); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to multi label classification evaluation. + /// A new instance for mocking. + public static CustomMultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluationSummary(EvaluationOptions evaluationOptions = null, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation = null) + { + return new CustomMultiLabelClassificationEvaluationSummary(ProjectKind.CustomMultiLabelClassification, evaluationOptions, serializedAdditionalRawData: null, customMultiLabelClassificationEvaluation); + } + + /// Initializes a new instance of . + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// A new instance for mocking. + public static MultiLabelClassificationEvaluationSummary MultiLabelClassificationEvaluationSummary(IReadOnlyDictionary classes = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + classes ??= new Dictionary(); + + return new MultiLabelClassificationEvaluationSummary( + classes, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static MultiLabelClassEvaluationSummary MultiLabelClassEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new MultiLabelClassEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to single label classification evaluation. + /// A new instance for mocking. + public static CustomSingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluationSummary(EvaluationOptions evaluationOptions = null, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation = null) + { + return new CustomSingleLabelClassificationEvaluationSummary(ProjectKind.CustomSingleLabelClassification, evaluationOptions, serializedAdditionalRawData: null, customSingleLabelClassificationEvaluation); + } + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two classes (the two classes can be the + /// same). The matrix is between the class that was labelled and the class that was + /// predicted. + /// + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// A new instance for mocking. + public static SingleLabelClassificationEvaluationSummary SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary classes = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + classes ??= new Dictionary(); + + return new SingleLabelClassificationEvaluationSummary( + confusionMatrix, + classes, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static SingleLabelClassEvaluationSummary SingleLabelClassEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new SingleLabelClassEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to custom sentiment evaluation. + /// A new instance for mocking. + public static CustomTextSentimentEvaluationSummary CustomTextSentimentEvaluationSummary(EvaluationOptions evaluationOptions = null, TextSentimentEvaluationSummary customTextSentimentEvaluation = null) + { + return new CustomTextSentimentEvaluationSummary(ProjectKind.CustomTextSentiment, evaluationOptions, serializedAdditionalRawData: null, customTextSentimentEvaluation); + } + + /// Initializes a new instance of . + /// Represents evaluation of span level sentiments. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// A new instance for mocking. + public static TextSentimentEvaluationSummary TextSentimentEvaluationSummary(SpanSentimentEvaluationSummary spanSentimentsEvaluation = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + return new TextSentimentEvaluationSummary( + spanSentimentsEvaluation, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two sentiments (the two sentiments can + /// be the same). The matrix is between the sentiment that was labelled and the + /// sentiment that was predicted. + /// + /// Represents the sentiment evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// A new instance for mocking. + public static SpanSentimentEvaluationSummary SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary sentiments = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + sentiments ??= new Dictionary(); + + return new SpanSentimentEvaluationSummary( + confusionMatrix, + sentiments, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// A new instance for mocking. + public static SentimentEvaluationSummary SentimentEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new SentimentEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetLoadSnapshotStatusResponse GetLoadSnapshotStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetLoadSnapshotStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resource ID. + /// The resource region. + /// A new instance for mocking. + public static AssignedDeploymentResource AssignedDeploymentResource(string azureResourceId = null, string region = null) + { + return new AssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetAssignDeploymentResourcesStatusResponse GetAssignDeploymentResourcesStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetAssignDeploymentResourcesStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetUnassignDeploymentResourcesStatusResponse GetUnassignDeploymentResourcesStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetUnassignDeploymentResourcesStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents training tasks detailed result. + /// A new instance for mocking. + public static GetTrainingStatusResponse GetTrainingStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null, TrainingJobResult result = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetTrainingStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + result, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// A new instance for mocking. + public static GetProjectDeletionStatusResponse GetProjectDeletionStatusResponse(DateTimeOffset createdDateTime = default, DateTimeOffset lastUpdatedDateTime = default, DateTimeOffset? expirationDateTime = null, JobStatus status = default, IEnumerable warnings = null, IEnumerable errors = null) + { + warnings ??= new List(); + errors ??= new List(); + + return new GetProjectDeletionStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings?.ToList(), + errors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// A new instance for mocking. + public static AssignedProjectDeploymentsMetadata AssignedProjectDeploymentsMetadata(string projectName = null, IEnumerable deploymentsMetadata = null) + { + deploymentsMetadata ??= new List(); + + return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// A new instance for mocking. + public static AssignedProjectDeploymentMetadata AssignedProjectDeploymentMetadata(string deploymentName = null, DateTimeOffset lastDeployedDateTime = default, DateTimeOffset deploymentExpirationDate = default) + { + return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The language name. + /// + /// The language code. This is BCP-47 representation of a language. For example, + /// "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// A new instance for mocking. + public static SupportedLanguage SupportedLanguage(string languageName = null, string languageCode = null) + { + return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// A new instance for mocking. + public static PrebuiltEntity PrebuiltEntity(string category = null, string description = null, string examples = null) + { + return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// A new instance for mocking. + public static TrainingConfigVersion TrainingConfigVersion(string trainingConfigVersionProperty = null, DateTimeOffset modelExpirationDate = default) + { + return new TrainingConfigVersion(trainingConfigVersionProperty, modelExpirationDate, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Docs/TextAnalysisAuthoring.xml b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Docs/TextAnalysisAuthoring.xml new file mode 100644 index 0000000000000..a0beceaf27dc3 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Docs/TextAnalysisAuthoring.xml @@ -0,0 +1,5717 @@ + + + + + +This sample shows how to call GetProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync(""); +]]> +This sample shows how to call GetProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync(""); +]]> + + + +This sample shows how to call GetProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject(""); +]]> +This sample shows how to call GetProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject(""); +]]> + + + +This sample shows how to call GetProjectAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call GetProjectAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call GetProject and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call GetProject with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call CreateProjectAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", +}); +Response response = await client.CreateProjectAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call CreateProjectAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", +}); +Response response = await client.CreateProjectAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call CreateProject and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", +}); +Response response = client.CreateProject("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> +This sample shows how to call CreateProject with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", +}); +Response response = client.CreateProject("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); +Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); +Console.WriteLine(result.GetProperty("multilingual").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("language").ToString()); +]]> + + + +This sample shows how to call CopyProjectAuthorizationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification); +]]> +This sample shows how to call CopyProjectAuthorizationAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); +]]> + + + +This sample shows how to call CopyProjectAuthorization. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification); +]]> +This sample shows how to call CopyProjectAuthorization with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); +]]> + + + +This sample shows how to call CopyProjectAuthorizationAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", +}); +Response response = await client.CopyProjectAuthorizationAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> +This sample shows how to call CopyProjectAuthorizationAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + allowOverwrite = true, +}); +Response response = await client.CopyProjectAuthorizationAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> + + + +This sample shows how to call CopyProjectAuthorization and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", +}); +Response response = client.CopyProjectAuthorization("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> +This sample shows how to call CopyProjectAuthorization with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + allowOverwrite = true, +}); +Response response = client.CopyProjectAuthorization("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("targetProjectName").ToString()); +Console.WriteLine(result.GetProperty("accessToken").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("targetResourceId").ToString()); +Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); +]]> + + + +This sample shows how to call GetCopyProjectStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", ""); +]]> +This sample shows how to call GetCopyProjectStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", ""); +]]> + + + +This sample shows how to call GetCopyProjectStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", ""); +]]> +This sample shows how to call GetCopyProjectStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", ""); +]]> + + + +This sample shows how to call GetCopyProjectStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetCopyProjectStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetCopyProjectStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetCopyProjectStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", ""); +]]> +This sample shows how to call GetDeploymentAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", ""); +]]> + + + +This sample shows how to call GetDeployment. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", ""); +]]> +This sample shows how to call GetDeployment with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", ""); +]]> + + + +This sample shows how to call GetDeploymentAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> +This sample shows how to call GetDeploymentAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> + + + +This sample shows how to call GetDeployment and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> +This sample shows how to call GetDeployment with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); +Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", ""); +]]> +This sample shows how to call GetDeploymentStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", ""); +]]> +This sample shows how to call GetDeploymentStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetDeploymentStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetDeploymentStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", ""); +]]> +This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", ""); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", ""); +]]> +This sample shows how to call GetSwapDeploymentsStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", ""); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetSwapDeploymentsStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetExportStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", ""); +]]> +This sample shows how to call GetExportStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", ""); +]]> + + + +This sample shows how to call GetExportStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", ""); +]]> +This sample shows how to call GetExportStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", ""); +]]> + + + +This sample shows how to call GetExportStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("resultUrl").ToString()); +]]> + + + +This sample shows how to call GetExportStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("resultUrl").ToString()); +]]> + + + +This sample shows how to call GetExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", ""); +]]> +This sample shows how to call GetExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", ""); +]]> + + + +This sample shows how to call GetExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", ""); +]]> +This sample shows how to call GetExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", ""); +]]> + + + +This sample shows how to call GetExportedModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> +This sample shows how to call GetExportedModelAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> + + + +This sample shows how to call GetExportedModel and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> +This sample shows how to call GetExportedModel with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +]]> + + + +This sample shows how to call GetExportedModelJobStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", ""); +]]> +This sample shows how to call GetExportedModelJobStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetExportedModelJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", ""); +]]> +This sample shows how to call GetExportedModelJobStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", ""); +]]> + + + +This sample shows how to call GetExportedModelJobStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportedModelJobStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetExportedModelJobStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetExportedModelJobStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetExportedModelManifestAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelManifestAsync("", ""); +]]> +This sample shows how to call GetExportedModelManifestAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelManifestAsync("", ""); +]]> + + + +This sample shows how to call GetExportedModelManifest. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelManifest("", ""); +]]> +This sample shows how to call GetExportedModelManifest with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelManifest("", ""); +]]> + + + +This sample shows how to call GetExportedModelManifestAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelManifestAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); +]]> +This sample shows how to call GetExportedModelManifestAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelManifestAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); +]]> + + + +This sample shows how to call GetExportedModelManifest and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelManifest("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); +]]> +This sample shows how to call GetExportedModelManifest with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelManifest("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); +]]> + + + +This sample shows how to call GetImportStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", ""); +]]> +This sample shows how to call GetImportStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", ""); +]]> + + + +This sample shows how to call GetImportStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", ""); +]]> +This sample shows how to call GetImportStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", ""); +]]> + + + +This sample shows how to call GetImportStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetImportStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetImportStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetImportStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetTrainedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", ""); +]]> +This sample shows how to call GetTrainedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", ""); +]]> + + + +This sample shows how to call GetTrainedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", ""); +]]> +This sample shows how to call GetTrainedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", ""); +]]> + + + +This sample shows how to call GetTrainedModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> +This sample shows how to call GetTrainedModelAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> + + + +This sample shows how to call GetTrainedModel and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> +This sample shows how to call GetTrainedModel with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("modelId").ToString()); +Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); +Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +]]> + + + +This sample shows how to call DeleteTrainedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.DeleteTrainedModelAsync("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteTrainedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.DeleteTrainedModelAsync("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteTrainedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.DeleteTrainedModel("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteTrainedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.DeleteTrainedModel("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetEvaluationStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", ""); +]]> +This sample shows how to call GetEvaluationStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetEvaluationStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", ""); +]]> +This sample shows how to call GetEvaluationStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", ""); +]]> + + + +This sample shows how to call GetEvaluationStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call GetEvaluationStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call GetEvaluationStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call GetEvaluationStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call GetModelEvaluationSummaryAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", ""); +]]> +This sample shows how to call GetModelEvaluationSummaryAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", ""); +]]> + + + +This sample shows how to call GetModelEvaluationSummary. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", ""); +]]> +This sample shows how to call GetModelEvaluationSummary with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", ""); +]]> + + + +This sample shows how to call GetModelEvaluationSummaryAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +]]> +This sample shows how to call GetModelEvaluationSummaryAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +]]> + + + +This sample shows how to call GetModelEvaluationSummary and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +]]> +This sample shows how to call GetModelEvaluationSummary with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("projectKind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +]]> + + + +This sample shows how to call GetLoadSnapshotStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); +]]> +This sample shows how to call GetLoadSnapshotStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetLoadSnapshotStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", ""); +]]> +This sample shows how to call GetLoadSnapshotStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", ""); +]]> + + + +This sample shows how to call GetLoadSnapshotStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetLoadSnapshotStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetLoadSnapshotStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetLoadSnapshotStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", ""); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", ""); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", ""); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", ""); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetTrainingStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", ""); +]]> +This sample shows how to call GetTrainingStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", ""); +]]> + + + +This sample shows how to call GetTrainingStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", ""); +]]> +This sample shows how to call GetTrainingStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", ""); +]]> + + + +This sample shows how to call GetTrainingStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call GetTrainingStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call GetTrainingStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call GetTrainingStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call GetProjectDeletionStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync(""); +]]> +This sample shows how to call GetProjectDeletionStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync(""); +]]> + + + +This sample shows how to call GetProjectDeletionStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus(""); +]]> +This sample shows how to call GetProjectDeletionStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus(""); +]]> + + + +This sample shows how to call GetProjectDeletionStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetProjectDeletionStatusAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetProjectDeletionStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetProjectDeletionStatus with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); +]]> + + + +This sample shows how to call GetProjectsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectMetadata item in client.GetProjectsAsync()) +{ +} +]]> +This sample shows how to call GetProjectsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetProjects. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectMetadata item in client.GetProjects()) +{ +} +]]> +This sample shows how to call GetProjects with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetProjectsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetProjectsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetProjects and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetProjects(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetProjects with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) +{ +} +]]> +This sample shows how to call GetDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectDeployment item in client.GetDeployments("")) +{ +} +]]> +This sample shows how to call GetDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeploymentsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetDeployments and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeployments with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetExportedModelsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) +{ +} +]]> +This sample shows how to call GetExportedModelsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetExportedModels. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ExportedTrainedModel item in client.GetExportedModels("")) +{ +} +]]> +This sample shows how to call GetExportedModels with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetExportedModelsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> +This sample shows how to call GetExportedModelsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> + + + +This sample shows how to call GetExportedModels and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> +This sample shows how to call GetExportedModels with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); +} +]]> + + + +This sample shows how to call GetTrainedModelsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) +{ +} +]]> +This sample shows how to call GetTrainedModelsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainedModels. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectTrainedModel item in client.GetTrainedModels("")) +{ +} +]]> +This sample shows how to call GetTrainedModels with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainedModelsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> +This sample shows how to call GetTrainedModelsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> + + + +This sample shows how to call GetTrainedModels and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> +This sample shows how to call GetTrainedModels with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); +} +]]> + + + +This sample shows how to call GetModelEvaluationResultsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) +{ +} +]]> +This sample shows how to call GetModelEvaluationResultsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetModelEvaluationResults. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) +{ +} +]]> +This sample shows how to call GetModelEvaluationResults with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetModelEvaluationResultsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetModelEvaluationResultsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetModelEvaluationResults and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> +This sample shows how to call GetModelEvaluationResults with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) +{ +} +]]> +This sample shows how to call GetDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) +{ +} +]]> +This sample shows how to call GetDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentResourcesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeploymentResourcesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentResources and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> +This sample shows how to call GetDeploymentResources with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingJobsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) +{ +} +]]> +This sample shows how to call GetTrainingJobsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingJobs. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingJobState item in client.GetTrainingJobs("")) +{ +} +]]> +This sample shows how to call GetTrainingJobs with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingJobsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +} +]]> +This sample shows how to call GetTrainingJobsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingJobs and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); +} +]]> +This sample shows how to call GetTrainingJobs with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); +} +]]> + + + +This sample shows how to call GetAssignedResourceDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync()) +{ +} +]]> +This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetAssignedResourceDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments()) +{ +} +]]> +This sample shows how to call GetAssignedResourceDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetAssignedResourceDeploymentsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +} +]]> +This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +} +]]> + + + +This sample shows how to call GetAssignedResourceDeployments and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetAssignedResourceDeployments(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +} +]]> +This sample shows how to call GetAssignedResourceDeployments with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetAssignedResourceDeployments(1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +} +]]> + + + +This sample shows how to call GetSupportedLanguagesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync()) +{ +} +]]> +This sample shows how to call GetSupportedLanguagesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetSupportedLanguages. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (SupportedLanguage item in client.GetSupportedLanguages()) +{ +} +]]> +This sample shows how to call GetSupportedLanguages with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (SupportedLanguage item in client.GetSupportedLanguages(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetSupportedLanguagesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetSupportedLanguagesAsync(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); +} +]]> +This sample shows how to call GetSupportedLanguagesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetSupportedLanguagesAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); +} +]]> + + + +This sample shows how to call GetSupportedLanguages and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetSupportedLanguages(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); +} +]]> +This sample shows how to call GetSupportedLanguages with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetSupportedLanguages("CustomSingleLabelClassification", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); +} +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntitiesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) +{ +} +]]> +This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) +{ +} +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntities. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) +{ +} +]]> +This sample shows how to call GetSupportedPrebuiltEntities with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) +{ +} +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntitiesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); +} +]]> +This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); +} +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntities and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); +} +]]> +This sample shows how to call GetSupportedPrebuiltEntities with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingConfigVersionsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync()) +{ +} +]]> +This sample shows how to call GetTrainingConfigVersionsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingConfigVersions. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions()) +{ +} +]]> +This sample shows how to call GetTrainingConfigVersions with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTrainingConfigVersionsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +} +]]> +This sample shows how to call GetTrainingConfigVersionsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +} +]]> + + + +This sample shows how to call GetTrainingConfigVersions and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingConfigVersions(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +} +]]> +This sample shows how to call GetTrainingConfigVersions with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetTrainingConfigVersions("CustomSingleLabelClassification", 1234, 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); +} +]]> + + + +This sample shows how to call DeleteProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); +]]> +This sample shows how to call DeleteProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); +]]> + + + +This sample shows how to call DeleteProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteProject(WaitUntil.Completed, ""); +]]> +This sample shows how to call DeleteProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteProject(WaitUntil.Completed, ""); +]]> + + + +This sample shows how to call CopyProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectOptions body = new CopyProjectOptions( +ProjectKind.CustomSingleLabelClassification, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call CopyProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectOptions body = new CopyProjectOptions( +ProjectKind.CustomSingleLabelClassification, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call CopyProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectOptions body = new CopyProjectOptions( +ProjectKind.CustomSingleLabelClassification, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = client.CopyProject(WaitUntil.Completed, "", body); +]]> +This sample shows how to call CopyProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectOptions body = new CopyProjectOptions( +ProjectKind.CustomSingleLabelClassification, +"", +"", +DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), +"", +""); +Operation operation = client.CopyProject(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call CopyProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call CopyProjectAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call CopyProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = client.CopyProject(WaitUntil.Completed, "", content); +]]> +This sample shows how to call CopyProject with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", +}); +Operation operation = client.CopyProject(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call ExportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); +]]> +This sample shows how to call ExportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call Export. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); +]]> +This sample shows how to call Export with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call ExportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); +]]> +This sample shows how to call ExportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call Export. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); +]]> +This sample shows how to call Export with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call ImportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectOptions(ProjectKind.CustomSingleLabelClassification, "", "", "")); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call ImportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectOptions(ProjectKind.CustomSingleLabelClassification, "", "", "") +{ + Settings = new ProjectSettings + { + ConfidenceThreshold = 123.45F, + AmlProjectPath = "", + IsLabelingLocked = true, + RunGptPredictions = true, + GptPredictiveLookahead = 1234, + }, + Multilingual = true, + Description = "", +}) +{ + Assets = new ExportedCustomAbstractiveSummarizationProjectAssets + { + Documents = {new ExportedCustomAbstractiveSummarizationDocument("") + { + Location = "", + Language = "", + Dataset = "", + }}, + }, +}; +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, format: ""); +]]> + + + +This sample shows how to call Import. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectOptions(ProjectKind.CustomSingleLabelClassification, "", "", "")); +Operation operation = client.Import(WaitUntil.Completed, "", body); +]]> +This sample shows how to call Import with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectOptions(ProjectKind.CustomSingleLabelClassification, "", "", "") +{ + Settings = new ProjectSettings + { + ConfidenceThreshold = 123.45F, + AmlProjectPath = "", + IsLabelingLocked = true, + RunGptPredictions = true, + GptPredictiveLookahead = 1234, + }, + Multilingual = true, + Description = "", +}) +{ + Assets = new ExportedCustomAbstractiveSummarizationProjectAssets + { + Documents = {new ExportedCustomAbstractiveSummarizationDocument("") + { + Location = "", + Language = "", + Dataset = "", + }}, + }, +}; +Operation operation = client.Import(WaitUntil.Completed, "", body, format: ""); +]]> + + + +This sample shows how to call ImportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }, +}); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call ImportAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + documents = new object[] + { + new + { + summaryLocation = "", + location = "", + language = "", + dataset = "", + } + }, + projectKind = "CustomAbstractiveSummarization", + }, +}); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, format: ""); +]]> + + + +This sample shows how to call Import. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }, +}); +Operation operation = client.Import(WaitUntil.Completed, "", content); +]]> +This sample shows how to call Import with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + documents = new object[] + { + new + { + summaryLocation = "", + location = "", + language = "", + dataset = "", + } + }, + projectKind = "CustomAbstractiveSummarization", + }, +}); +Operation operation = client.Import(WaitUntil.Completed, "", content, format: ""); +]]> + + + +This sample shows how to call TrainAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobOptions body = new TrainingJobOptions("", ""); +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call TrainAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobOptions body = new TrainingJobOptions("", "") +{ + EvaluationOptions = new EvaluationOptions + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), +}; +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call Train. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobOptions body = new TrainingJobOptions("", ""); +Operation operation = client.Train(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call Train with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobOptions body = new TrainingJobOptions("", "") +{ + EvaluationOptions = new EvaluationOptions + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), +}; +Operation operation = client.Train(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call TrainAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", +}); +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call TrainAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + dataGenerationSettings = new + { + enableDataGeneration = true, + dataGenerationConnectionInfo = new + { + kind = "azureOpenAI", + resourceId = "", + deploymentName = "", + }, + }, +}); +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call Train and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", +}); +Operation operation = client.Train(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call Train with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + dataGenerationSettings = new + { + enableDataGeneration = true, + dataGenerationConnectionInfo = new + { + kind = "azureOpenAI", + resourceId = "", + deploymentName = "", + }, + }, +}); +Operation operation = client.Train(WaitUntil.Completed, "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call DeployProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentOptions body = new CreateDeploymentOptions(""); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeployProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentOptions body = new CreateDeploymentOptions("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentOptions body = new CreateDeploymentOptions(""); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeployProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentOptions body = new CreateDeploymentOptions("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeployProjectAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeployProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeployProject with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeleteDeploymentAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteDeploymentAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteDeployment. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteDeployment with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteDeploymentFromResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentOptions body = new DeleteDeploymentOptions(); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentOptions body = new DeleteDeploymentOptions +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentOptions body = new DeleteDeploymentOptions(); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeleteDeploymentFromResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentOptions body = new DeleteDeploymentOptions +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeleteDeploymentFromResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call DeleteDeploymentFromResources with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call SwapDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsOptions body = new SwapDeploymentsOptions("", ""); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call SwapDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsOptions body = new SwapDeploymentsOptions("", ""); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsOptions body = new SwapDeploymentsOptions("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> +This sample shows how to call SwapDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsOptions body = new SwapDeploymentsOptions("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call SwapDeploymentsAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call SwapDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); +]]> +This sample shows how to call SwapDeployments with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + firstDeploymentName = "", + secondDeploymentName = "", +}); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelOptions body = new ExportedModelOptions(""); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelOptions body = new ExportedModelOptions(""); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelOptions body = new ExportedModelOptions(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call CreateOrUpdateExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelOptions body = new ExportedModelOptions(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); +]]> +This sample shows how to call CreateOrUpdateExportedModel with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); +]]> + + + +This sample shows how to call DeleteExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call DeleteExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call EvaluateModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationOptions body = new EvaluationOptions(); +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> +This sample shows how to call EvaluateModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationOptions body = new EvaluationOptions +{ + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, +}; +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call EvaluateModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationOptions body = new EvaluationOptions(); +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> +This sample shows how to call EvaluateModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationOptions body = new EvaluationOptions +{ + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, +}; +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); +EvaluationJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call EvaluateModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call EvaluateModelAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, +}); +Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call EvaluateModel and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> +This sample shows how to call EvaluateModel with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, +}); +Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("percentComplete").ToString()); +]]> + + + +This sample shows how to call LoadSnapshotAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call LoadSnapshotAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call LoadSnapshot. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); +]]> +This sample shows how to call LoadSnapshot with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call AssignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesOptions body = new AssignDeploymentResourcesOptions(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call AssignDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesOptions body = new AssignDeploymentResourcesOptions(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call AssignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesOptions body = new AssignDeploymentResourcesOptions(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); +]]> +This sample shows how to call AssignDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesOptions body = new AssignDeploymentResourcesOptions(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call AssignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call AssignDeploymentResourcesAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call AssignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); +]]> +This sample shows how to call AssignDeploymentResources with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + resourcesMetadata = new object[] + { + new + { + azureResourceId = "", + customDomain = "", + region = "", + } + }, +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call UnassignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesOptions body = new UnassignDeploymentResourcesOptions(new string[] { "" }); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call UnassignDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesOptions body = new UnassignDeploymentResourcesOptions(new string[] { "" }); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesOptions body = new UnassignDeploymentResourcesOptions(new string[] { "" }); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); +]]> +This sample shows how to call UnassignDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesOptions body = new UnassignDeploymentResourcesOptions(new string[] { "" }); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> +This sample shows how to call UnassignDeploymentResourcesAsync with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call UnassignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); +]]> +This sample shows how to call UnassignDeploymentResources with all parameters and request content. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + assignedResourceIds = new object[] + { + "" + }, +}); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); +]]> + + + +This sample shows how to call CancelTrainingJobAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call CancelTrainingJobAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call CancelTrainingJob. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> +This sample shows how to call CancelTrainingJob with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call CancelTrainingJobAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call CancelTrainingJobAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + +This sample shows how to call CancelTrainingJob and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +]]> +This sample shows how to call CancelTrainingJob with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.GetProperty("modelLabel").ToString()); +Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); +Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Argument.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Argument.cs new file mode 100644 index 0000000000000..1b6d1bf0463ce --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 0000000000000..f2231f9286d3e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingList.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 0000000000000..331e1e903a651 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 0000000000000..31915600fb0ad --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Optional.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Optional.cs new file mode 100644 index 0000000000000..0b953e7a2697d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.AI.Language.Authoring.Analyzetext +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 0000000000000..6c4d8df9e9f67 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesOptions.Serialization.cs new file mode 100644 index 0000000000000..233fa7eca6fd6 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesOptions.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class AssignDeploymentResourcesOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignDeploymentResourcesOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("resourcesMetadata"u8); + writer.WriteStartArray(); + foreach (var item in ResourcesMetadata) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AssignDeploymentResourcesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignDeploymentResourcesOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignDeploymentResourcesOptions(document.RootElement, options); + } + + internal static AssignDeploymentResourcesOptions DeserializeAssignDeploymentResourcesOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList resourcesMetadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourcesMetadata"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceMetadata.DeserializeResourceMetadata(item, options)); + } + resourcesMetadata = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignDeploymentResourcesOptions(resourcesMetadata, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesOptions)} does not support writing '{options.Format}' format."); + } + } + + AssignDeploymentResourcesOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignDeploymentResourcesOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignDeploymentResourcesOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignDeploymentResourcesOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesOptions.cs new file mode 100644 index 0000000000000..8a2c7cd009e66 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesOptions.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the options for assigning Azure resources to a project. + public partial class AssignDeploymentResourcesOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the metadata for the resources to be assigned. + /// is null. + public AssignDeploymentResourcesOptions(IEnumerable resourcesMetadata) + { + Argument.AssertNotNull(resourcesMetadata, nameof(resourcesMetadata)); + + ResourcesMetadata = resourcesMetadata.ToList(); + } + + /// Initializes a new instance of . + /// Represents the metadata for the resources to be assigned. + /// Keeps track of any properties unknown to the library. + internal AssignDeploymentResourcesOptions(IList resourcesMetadata, IDictionary serializedAdditionalRawData) + { + ResourcesMetadata = resourcesMetadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignDeploymentResourcesOptions() + { + } + + /// Represents the metadata for the resources to be assigned. + public IList ResourcesMetadata { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.Serialization.cs new file mode 100644 index 0000000000000..2dbe4073ff88f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class AssignedDeploymentResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AssignedDeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedDeploymentResource(document.RootElement, options); + } + + internal static AssignedDeploymentResource DeserializeAssignedDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureResourceId = default; + string region = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureResourceId"u8)) + { + azureResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedDeploymentResource(azureResourceId, region, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support writing '{options.Format}' format."); + } + } + + AssignedDeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedDeploymentResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedDeploymentResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedDeploymentResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedDeploymentResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.cs new file mode 100644 index 0000000000000..14f083568579e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the assigned deployment resource. + public partial class AssignedDeploymentResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The resource ID. + /// The resource region. + /// or is null. + internal AssignedDeploymentResource(string azureResourceId, string region) + { + Argument.AssertNotNull(azureResourceId, nameof(azureResourceId)); + Argument.AssertNotNull(region, nameof(region)); + + AzureResourceId = azureResourceId; + Region = region; + } + + /// Initializes a new instance of . + /// The resource ID. + /// The resource region. + /// Keeps track of any properties unknown to the library. + internal AssignedDeploymentResource(string azureResourceId, string region, IDictionary serializedAdditionalRawData) + { + AzureResourceId = azureResourceId; + Region = region; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedDeploymentResource() + { + } + + /// The resource ID. + public string AzureResourceId { get; } + /// The resource region. + public string Region { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs new file mode 100644 index 0000000000000..d8a36997689a8 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class AssignedProjectDeploymentMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("deploymentName"u8); + writer.WriteStringValue(DeploymentName); + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WritePropertyName("deploymentExpirationDate"u8); + writer.WriteStringValue(DeploymentExpirationDate, "D"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AssignedProjectDeploymentMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedProjectDeploymentMetadata(document.RootElement, options); + } + + internal static AssignedProjectDeploymentMetadata DeserializeAssignedProjectDeploymentMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string deploymentName = default; + DateTimeOffset lastDeployedDateTime = default; + DateTimeOffset deploymentExpirationDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("deploymentExpirationDate"u8)) + { + deploymentExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedProjectDeploymentMetadata(deploymentName, lastDeployedDateTime, deploymentExpirationDate, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support writing '{options.Format}' format."); + } + } + + AssignedProjectDeploymentMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedProjectDeploymentMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedProjectDeploymentMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedProjectDeploymentMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.cs new file mode 100644 index 0000000000000..5b6115884e7ae --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the metadata for an assigned deployment. + public partial class AssignedProjectDeploymentMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// is null. + internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate) + { + Argument.AssertNotNull(deploymentName, nameof(deploymentName)); + + DeploymentName = deploymentName; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + } + + /// Initializes a new instance of . + /// Represents the deployment name. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Keeps track of any properties unknown to the library. + internal AssignedProjectDeploymentMetadata(string deploymentName, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, IDictionary serializedAdditionalRawData) + { + DeploymentName = deploymentName; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedProjectDeploymentMetadata() + { + } + + /// Represents the deployment name. + public string DeploymentName { get; } + /// Represents deployment last deployed time. + public DateTimeOffset LastDeployedDateTime { get; } + /// Represents deployment expiration date in the runtime. + public DateTimeOffset DeploymentExpirationDate { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs new file mode 100644 index 0000000000000..c8d9a4d4f5d93 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class AssignedProjectDeploymentsMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + writer.WritePropertyName("deploymentsMetadata"u8); + writer.WriteStartArray(); + foreach (var item in DeploymentsMetadata) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AssignedProjectDeploymentsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement, options); + } + + internal static AssignedProjectDeploymentsMetadata DeserializeAssignedProjectDeploymentsMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectName = default; + IReadOnlyList deploymentsMetadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentsMetadata"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssignedProjectDeploymentMetadata.DeserializeAssignedProjectDeploymentMetadata(item, options)); + } + deploymentsMetadata = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedProjectDeploymentsMetadata(projectName, deploymentsMetadata, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support writing '{options.Format}' format."); + } + } + + AssignedProjectDeploymentsMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedProjectDeploymentsMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssignedProjectDeploymentsMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedProjectDeploymentsMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs new file mode 100644 index 0000000000000..8fa1d8ee62a83 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the metadata for assigned deployments for a project. + public partial class AssignedProjectDeploymentsMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// or is null. + internal AssignedProjectDeploymentsMetadata(string projectName, IEnumerable deploymentsMetadata) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(deploymentsMetadata, nameof(deploymentsMetadata)); + + ProjectName = projectName; + DeploymentsMetadata = deploymentsMetadata.ToList(); + } + + /// Initializes a new instance of . + /// Represents the project name. + /// Represents the resource region. + /// Keeps track of any properties unknown to the library. + internal AssignedProjectDeploymentsMetadata(string projectName, IReadOnlyList deploymentsMetadata, IDictionary serializedAdditionalRawData) + { + ProjectName = projectName; + DeploymentsMetadata = deploymentsMetadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedProjectDeploymentsMetadata() + { + } + + /// Represents the project name. + public string ProjectName { get; } + /// Represents the resource region. + public IReadOnlyList DeploymentsMetadata { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CompositionSetting.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CompositionSetting.cs new file mode 100644 index 0000000000000..7df6584848179 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CompositionSetting.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The CompositionSetting. + public readonly partial struct CompositionSetting : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CompositionSetting(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SeparateComponentsValue = "separateComponents"; + private const string CombineComponentsValue = "combineComponents"; + + /// + /// Every component's match or prediction is returned as a separate instance of the + /// entity. + /// + public static CompositionSetting SeparateComponents { get; } = new CompositionSetting(SeparateComponentsValue); + /// + /// When two or more components are found in the text and overlap, the components' + /// spans are merged together into one span combining all of them. + /// + public static CompositionSetting CombineComponents { get; } = new CompositionSetting(CombineComponentsValue); + /// Determines if two values are the same. + public static bool operator ==(CompositionSetting left, CompositionSetting right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CompositionSetting left, CompositionSetting right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CompositionSetting(string value) => new CompositionSetting(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CompositionSetting other && Equals(other); + /// + public bool Equals(CompositionSetting other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.Serialization.cs new file mode 100644 index 0000000000000..174939d1c9d1a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ConfusionMatrix : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + ConfusionMatrix IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfusionMatrix(document.RootElement, options); + } + + internal static ConfusionMatrix DeserializeConfusionMatrix(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new ConfusionMatrix(additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support writing '{options.Format}' format."); + } + } + + ConfusionMatrix IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConfusionMatrix(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfusionMatrix)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConfusionMatrix FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConfusionMatrix(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.cs new file mode 100644 index 0000000000000..75ad5df97cde0 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The ConfusionMatrix. + public partial class ConfusionMatrix + { + /// Initializes a new instance of . + internal ConfusionMatrix() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Additional Properties. + internal ConfusionMatrix(IReadOnlyDictionary additionalProperties) + { + AdditionalProperties = additionalProperties; + } + + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.Serialization.cs new file mode 100644 index 0000000000000..41499849b88cd --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ConfusionMatrixCell : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("normalizedValue"u8); + writer.WriteNumberValue(NormalizedValue); + writer.WritePropertyName("rawValue"u8); + writer.WriteNumberValue(RawValue); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ConfusionMatrixCell IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfusionMatrixCell(document.RootElement, options); + } + + internal static ConfusionMatrixCell DeserializeConfusionMatrixCell(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float normalizedValue = default; + float rawValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("normalizedValue"u8)) + { + normalizedValue = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("rawValue"u8)) + { + rawValue = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConfusionMatrixCell(normalizedValue, rawValue, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support writing '{options.Format}' format."); + } + } + + ConfusionMatrixCell IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConfusionMatrixCell(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfusionMatrixCell)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConfusionMatrixCell FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConfusionMatrixCell(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.cs new file mode 100644 index 0000000000000..bc821bdae2ec2 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a cell in a confusion matrix. + public partial class ConfusionMatrixCell + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents normalized value in percentages. + /// Represents raw value. + internal ConfusionMatrixCell(float normalizedValue, float rawValue) + { + NormalizedValue = normalizedValue; + RawValue = rawValue; + } + + /// Initializes a new instance of . + /// Represents normalized value in percentages. + /// Represents raw value. + /// Keeps track of any properties unknown to the library. + internal ConfusionMatrixCell(float normalizedValue, float rawValue, IDictionary serializedAdditionalRawData) + { + NormalizedValue = normalizedValue; + RawValue = rawValue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConfusionMatrixCell() + { + } + + /// Represents normalized value in percentages. + public float NormalizedValue { get; } + /// Represents raw value. + public float RawValue { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.Serialization.cs new file mode 100644 index 0000000000000..c244ec5d102a9 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ConfusionMatrixRow : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + + ConfusionMatrixRow IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConfusionMatrixRow(document.RootElement, options); + } + + internal static ConfusionMatrixRow DeserializeConfusionMatrixRow(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new ConfusionMatrixRow(additionalProperties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support writing '{options.Format}' format."); + } + } + + ConfusionMatrixRow IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeConfusionMatrixRow(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConfusionMatrixRow)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ConfusionMatrixRow FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConfusionMatrixRow(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.cs new file mode 100644 index 0000000000000..9dfd8c9f28c6d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The ConfusionMatrixRow. + public partial class ConfusionMatrixRow + { + /// Initializes a new instance of . + internal ConfusionMatrixRow() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Additional Properties. + internal ConfusionMatrixRow(IReadOnlyDictionary additionalProperties) + { + AdditionalProperties = additionalProperties; + } + + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// + /// Supported types: + /// + /// + /// + /// + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs new file mode 100644 index 0000000000000..2d44b40fce8bf --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + internal partial class CopyProjectAuthorizationRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (Optional.IsDefined(StorageInputContainerName)) + { + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + } + if (Optional.IsDefined(AllowOverwrite)) + { + writer.WritePropertyName("allowOverwrite"u8); + writer.WriteBooleanValue(AllowOverwrite.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CopyProjectAuthorizationRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectAuthorizationRequest(document.RootElement, options); + } + + internal static CopyProjectAuthorizationRequest DeserializeCopyProjectAuthorizationRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + string storageInputContainerName = default; + bool? allowOverwrite = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowOverwrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowOverwrite = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectAuthorizationRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCopyProjectAuthorizationRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectAuthorizationRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CopyProjectAuthorizationRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectAuthorizationRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.cs new file mode 100644 index 0000000000000..5ada1fde5c1eb --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The CopyProjectAuthorizationRequest. + internal partial class CopyProjectAuthorizationRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project kind. + internal CopyProjectAuthorizationRequest(ProjectKind projectKind) + { + ProjectKind = projectKind; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The name of the storage container. + /// + /// Whether to allow an existing project to be overwritten using the resulting copy + /// authorization. + /// + /// Keeps track of any properties unknown to the library. + internal CopyProjectAuthorizationRequest(ProjectKind projectKind, string storageInputContainerName, bool? allowOverwrite, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + AllowOverwrite = allowOverwrite; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyProjectAuthorizationRequest() + { + } + + /// Represents the project kind. + public ProjectKind ProjectKind { get; } + /// The name of the storage container. + public string StorageInputContainerName { get; } + /// + /// Whether to allow an existing project to be overwritten using the resulting copy + /// authorization. + /// + public bool? AllowOverwrite { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectOptions.Serialization.cs new file mode 100644 index 0000000000000..854c78d12ad07 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectOptions.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CopyProjectOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("targetProjectName"u8); + writer.WriteStringValue(TargetProjectName); + writer.WritePropertyName("accessToken"u8); + writer.WriteStringValue(AccessToken); + writer.WritePropertyName("expiresAt"u8); + writer.WriteStringValue(ExpiresAt, "O"); + writer.WritePropertyName("targetResourceId"u8); + writer.WriteStringValue(TargetResourceId); + writer.WritePropertyName("targetResourceRegion"u8); + writer.WriteStringValue(TargetResourceRegion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CopyProjectOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyProjectOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectOptions(document.RootElement, options); + } + + internal static CopyProjectOptions DeserializeCopyProjectOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + string targetProjectName = default; + string accessToken = default; + DateTimeOffset expiresAt = default; + string targetResourceId = default; + string targetResourceRegion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetProjectName"u8)) + { + targetProjectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessToken"u8)) + { + accessToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiresAt"u8)) + { + expiresAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("targetResourceId"u8)) + { + targetResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetResourceRegion"u8)) + { + targetResourceRegion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyProjectOptions( + projectKind, + targetProjectName, + accessToken, + expiresAt, + targetResourceId, + targetResourceRegion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CopyProjectOptions)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCopyProjectOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CopyProjectOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectOptions.cs new file mode 100644 index 0000000000000..49ee9110e977c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectOptions.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the options for copying an existing project to another Azure + /// resource. + /// + public partial class CopyProjectOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project name to be copied-into. + /// The access token. + /// The expiration of the access token. + /// Represents the target Azure resource ID. + /// Represents the target Azure resource region. + /// , , or is null. + public CopyProjectOptions(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion) + { + Argument.AssertNotNull(targetProjectName, nameof(targetProjectName)); + Argument.AssertNotNull(accessToken, nameof(accessToken)); + Argument.AssertNotNull(targetResourceId, nameof(targetResourceId)); + Argument.AssertNotNull(targetResourceRegion, nameof(targetResourceRegion)); + + ProjectKind = projectKind; + TargetProjectName = targetProjectName; + AccessToken = accessToken; + ExpiresAt = expiresAt; + TargetResourceId = targetResourceId; + TargetResourceRegion = targetResourceRegion; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project name to be copied-into. + /// The access token. + /// The expiration of the access token. + /// Represents the target Azure resource ID. + /// Represents the target Azure resource region. + /// Keeps track of any properties unknown to the library. + internal CopyProjectOptions(ProjectKind projectKind, string targetProjectName, string accessToken, DateTimeOffset expiresAt, string targetResourceId, string targetResourceRegion, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + TargetProjectName = targetProjectName; + AccessToken = accessToken; + ExpiresAt = expiresAt; + TargetResourceId = targetResourceId; + TargetResourceRegion = targetResourceRegion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyProjectOptions() + { + } + + /// Represents the project kind. + public ProjectKind ProjectKind { get; set; } + /// The project name to be copied-into. + public string TargetProjectName { get; set; } + /// The access token. + public string AccessToken { get; set; } + /// The expiration of the access token. + public DateTimeOffset ExpiresAt { get; set; } + /// Represents the target Azure resource ID. + public string TargetResourceId { get; set; } + /// Represents the target Azure resource region. + public string TargetResourceRegion { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentOptions.Serialization.cs new file mode 100644 index 0000000000000..2b279641febe7 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentOptions.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CreateDeploymentOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateDeploymentOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("trainedModelLabel"u8); + writer.WriteStringValue(TrainedModelLabel); + if (Optional.IsCollectionDefined(AssignedResourceIds)) + { + writer.WritePropertyName("assignedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CreateDeploymentOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateDeploymentOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateDeploymentOptions(document.RootElement, options); + } + + internal static CreateDeploymentOptions DeserializeCreateDeploymentOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string trainedModelLabel = default; + IList assignedResourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("trainedModelLabel"u8)) + { + trainedModelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("assignedResourceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignedResourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateDeploymentOptions(trainedModelLabel, assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CreateDeploymentOptions)} does not support writing '{options.Format}' format."); + } + } + + CreateDeploymentOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCreateDeploymentOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateDeploymentOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CreateDeploymentOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateDeploymentOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentOptions.cs new file mode 100644 index 0000000000000..dc601c35ffee9 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentOptions.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the options for creating or updating a project deployment. + public partial class CreateDeploymentOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the trained model label. + /// is null. + public CreateDeploymentOptions(string trainedModelLabel) + { + Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); + + TrainedModelLabel = trainedModelLabel; + AssignedResourceIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Represents the trained model label. + /// + /// Represents the resource IDs to be assigned to the deployment. + /// If provided, the deployment will be rolled out to the resources + /// provided here as well as the original resource in which the project is created. + /// + /// Keeps track of any properties unknown to the library. + internal CreateDeploymentOptions(string trainedModelLabel, IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateDeploymentOptions() + { + } + + /// Represents the trained model label. + public string TrainedModelLabel { get; } + /// + /// Represents the resource IDs to be assigned to the deployment. + /// If provided, the deployment will be rolled out to the resources + /// provided here as well as the original resource in which the project is created. + /// + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectOptions.Serialization.cs new file mode 100644 index 0000000000000..a76fb65db3a23 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectOptions.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CreateProjectOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateProjectOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings, options); + } + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + if (Optional.IsDefined(Multilingual)) + { + writer.WritePropertyName("multilingual"u8); + writer.WriteBooleanValue(Multilingual.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CreateProjectOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateProjectOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateProjectOptions(document.RootElement, options); + } + + internal static CreateProjectOptions DeserializeCreateProjectOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + string storageInputContainerName = default; + ProjectSettings settings = default; + string projectName = default; + bool? multilingual = default; + string description = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + continue; + } + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("multilingual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multilingual = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateProjectOptions( + projectKind, + storageInputContainerName, + settings, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CreateProjectOptions)} does not support writing '{options.Format}' format."); + } + } + + CreateProjectOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCreateProjectOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateProjectOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CreateProjectOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateProjectOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectOptions.cs new file mode 100644 index 0000000000000..53e9f1734faf2 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectOptions.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the options used to create or update a project. + public partial class CreateProjectOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The project kind. + /// The storage container name. + /// The new project name. + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// , or is null. + public CreateProjectOptions(ProjectKind projectKind, string storageInputContainerName, string projectName, string language) + { + Argument.AssertNotNull(storageInputContainerName, nameof(storageInputContainerName)); + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(language, nameof(language)); + + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + ProjectName = projectName; + Language = language; + } + + /// Initializes a new instance of . + /// The project kind. + /// The storage container name. + /// The project settings. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// Keeps track of any properties unknown to the library. + internal CreateProjectOptions(ProjectKind projectKind, string storageInputContainerName, ProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + Settings = settings; + ProjectName = projectName; + Multilingual = multilingual; + Description = description; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateProjectOptions() + { + } + + /// The project kind. + public ProjectKind ProjectKind { get; } + /// The storage container name. + public string StorageInputContainerName { get; } + /// The project settings. + public ProjectSettings Settings { get; set; } + /// The new project name. + public string ProjectName { get; } + /// Whether the project would be used for multiple languages or not. + public bool? Multilingual { get; set; } + /// The project description. + public string Description { get; set; } + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + public string Language { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..eaddc80af075d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomEntityRecognitionDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityRecognitionDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customEntityRecognitionResult"u8); + writer.WriteObjectValue(CustomEntityRecognitionResult, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomEntityRecognitionDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityRecognitionDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomEntityRecognitionDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomEntityRecognitionDocumentEvaluationResult DeserializeCustomEntityRecognitionDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customEntityRecognitionResult"u8)) + { + customEntityRecognitionResult = DocumentEntityRecognitionEvaluationResult.DeserializeDocumentEntityRecognitionEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomEntityRecognitionDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customEntityRecognitionResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomEntityRecognitionDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomEntityRecognitionDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomEntityRecognitionDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomEntityRecognitionDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomEntityRecognitionDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomEntityRecognitionDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs new file mode 100644 index 0000000000000..02af28e899cee --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the document evaluation result for a custom entity recognition + /// project. + /// + public partial class CustomEntityRecognitionDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for entity recognition. + /// , or is null. + internal CustomEntityRecognitionDocumentEvaluationResult(string location, string language, DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customEntityRecognitionResult, nameof(customEntityRecognitionResult)); + + ProjectKind = ProjectKind.CustomEntityRecognition; + CustomEntityRecognitionResult = customEntityRecognitionResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for entity recognition. + internal CustomEntityRecognitionDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentEntityRecognitionEvaluationResult customEntityRecognitionResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomEntityRecognitionResult = customEntityRecognitionResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomEntityRecognitionDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for entity recognition. + public DocumentEntityRecognitionEvaluationResult CustomEntityRecognitionResult { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..46efbb36e764b --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomEntityRecognitionEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityRecognitionEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customEntityRecognitionEvaluation"u8); + writer.WriteObjectValue(CustomEntityRecognitionEvaluation, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomEntityRecognitionEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomEntityRecognitionEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomEntityRecognitionEvaluationSummary(document.RootElement, options); + } + + internal static CustomEntityRecognitionEvaluationSummary DeserializeCustomEntityRecognitionEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation = default; + ProjectKind projectKind = default; + EvaluationOptions evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customEntityRecognitionEvaluation"u8)) + { + customEntityRecognitionEvaluation = EntityRecognitionEvaluationSummary.DeserializeEntityRecognitionEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationOptions.DeserializeEvaluationOptions(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomEntityRecognitionEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customEntityRecognitionEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomEntityRecognitionEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomEntityRecognitionEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomEntityRecognitionEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomEntityRecognitionEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomEntityRecognitionEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomEntityRecognitionEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs new file mode 100644 index 0000000000000..c2f6127bd8470 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the evaluation summary for a custom entity recognition project. + public partial class CustomEntityRecognitionEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to extraction evaluation. + /// or is null. + internal CustomEntityRecognitionEvaluationSummary(EvaluationOptions evaluationOptions, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customEntityRecognitionEvaluation, nameof(customEntityRecognitionEvaluation)); + + ProjectKind = ProjectKind.CustomEntityRecognition; + CustomEntityRecognitionEvaluation = customEntityRecognitionEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to extraction evaluation. + internal CustomEntityRecognitionEvaluationSummary(ProjectKind projectKind, EvaluationOptions evaluationOptions, IDictionary serializedAdditionalRawData, EntityRecognitionEvaluationSummary customEntityRecognitionEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomEntityRecognitionEvaluation = customEntityRecognitionEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomEntityRecognitionEvaluationSummary() + { + } + + /// Contains the data related to extraction evaluation. + public EntityRecognitionEvaluationSummary CustomEntityRecognitionEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..cb486bcef0f4e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomHealthcareDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomHealthcareDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customHealthcareResult"u8); + writer.WriteObjectValue(CustomHealthcareResult, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomHealthcareDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomHealthcareDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomHealthcareDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomHealthcareDocumentEvaluationResult DeserializeCustomHealthcareDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentHealthcareEvaluationResult customHealthcareResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customHealthcareResult"u8)) + { + customHealthcareResult = DocumentHealthcareEvaluationResult.DeserializeDocumentHealthcareEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomHealthcareDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customHealthcareResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomHealthcareDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomHealthcareDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomHealthcareDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomHealthcareDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomHealthcareDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomHealthcareDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs new file mode 100644 index 0000000000000..a2ae3608ddf8f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the document evaluation result for a custom entity recognition + /// project. + /// + public partial class CustomHealthcareDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for entity recognition. + /// , or is null. + internal CustomHealthcareDocumentEvaluationResult(string location, string language, DocumentHealthcareEvaluationResult customHealthcareResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customHealthcareResult, nameof(customHealthcareResult)); + + ProjectKind = ProjectKind.CustomHealthcare; + CustomHealthcareResult = customHealthcareResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for entity recognition. + internal CustomHealthcareDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentHealthcareEvaluationResult customHealthcareResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomHealthcareResult = customHealthcareResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomHealthcareDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for entity recognition. + public DocumentHealthcareEvaluationResult CustomHealthcareResult { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..420ffa50614d3 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomHealthcareEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomHealthcareEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customHealthcareEvaluation"u8); + writer.WriteObjectValue(CustomHealthcareEvaluation, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomHealthcareEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomHealthcareEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomHealthcareEvaluationSummary(document.RootElement, options); + } + + internal static CustomHealthcareEvaluationSummary DeserializeCustomHealthcareEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EntityRecognitionEvaluationSummary customHealthcareEvaluation = default; + ProjectKind projectKind = default; + EvaluationOptions evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customHealthcareEvaluation"u8)) + { + customHealthcareEvaluation = EntityRecognitionEvaluationSummary.DeserializeEntityRecognitionEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationOptions.DeserializeEvaluationOptions(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomHealthcareEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customHealthcareEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomHealthcareEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomHealthcareEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomHealthcareEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomHealthcareEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomHealthcareEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomHealthcareEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.cs new file mode 100644 index 0000000000000..ab88bf1141b2f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the evaluation summary for a custom health care project. + public partial class CustomHealthcareEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to health care evaluation. + /// or is null. + internal CustomHealthcareEvaluationSummary(EvaluationOptions evaluationOptions, EntityRecognitionEvaluationSummary customHealthcareEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customHealthcareEvaluation, nameof(customHealthcareEvaluation)); + + ProjectKind = ProjectKind.CustomHealthcare; + CustomHealthcareEvaluation = customHealthcareEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to health care evaluation. + internal CustomHealthcareEvaluationSummary(ProjectKind projectKind, EvaluationOptions evaluationOptions, IDictionary serializedAdditionalRawData, EntityRecognitionEvaluationSummary customHealthcareEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomHealthcareEvaluation = customHealthcareEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomHealthcareEvaluationSummary() + { + } + + /// Contains the data related to health care evaluation. + public EntityRecognitionEvaluationSummary CustomHealthcareEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..be148297c991e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomMultiLabelClassificationDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customMultiLabelClassificationResult"u8); + writer.WriteObjectValue(CustomMultiLabelClassificationResult, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomMultiLabelClassificationDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomMultiLabelClassificationDocumentEvaluationResult DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customMultiLabelClassificationResult"u8)) + { + customMultiLabelClassificationResult = DocumentMultiLabelClassificationEvaluationResult.DeserializeDocumentMultiLabelClassificationEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomMultiLabelClassificationDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customMultiLabelClassificationResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomMultiLabelClassificationDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomMultiLabelClassificationDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs new file mode 100644 index 0000000000000..e4daa23a5436b --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the document evaluation result for a custom multi-label + /// classification project. + /// + public partial class CustomMultiLabelClassificationDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for multi label classification. + /// , or is null. + internal CustomMultiLabelClassificationDocumentEvaluationResult(string location, string language, DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customMultiLabelClassificationResult, nameof(customMultiLabelClassificationResult)); + + ProjectKind = ProjectKind.CustomMultiLabelClassification; + CustomMultiLabelClassificationResult = customMultiLabelClassificationResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for multi label classification. + internal CustomMultiLabelClassificationDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentMultiLabelClassificationEvaluationResult customMultiLabelClassificationResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomMultiLabelClassificationResult = customMultiLabelClassificationResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomMultiLabelClassificationDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for multi label classification. + public DocumentMultiLabelClassificationEvaluationResult CustomMultiLabelClassificationResult { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..33bb236e4ab0a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomMultiLabelClassificationEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customMultiLabelClassificationEvaluation"u8); + writer.WriteObjectValue(CustomMultiLabelClassificationEvaluation, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomMultiLabelClassificationEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomMultiLabelClassificationEvaluationSummary(document.RootElement, options); + } + + internal static CustomMultiLabelClassificationEvaluationSummary DeserializeCustomMultiLabelClassificationEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation = default; + ProjectKind projectKind = default; + EvaluationOptions evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customMultiLabelClassificationEvaluation"u8)) + { + customMultiLabelClassificationEvaluation = MultiLabelClassificationEvaluationSummary.DeserializeMultiLabelClassificationEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationOptions.DeserializeEvaluationOptions(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomMultiLabelClassificationEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customMultiLabelClassificationEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomMultiLabelClassificationEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomMultiLabelClassificationEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomMultiLabelClassificationEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomMultiLabelClassificationEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomMultiLabelClassificationEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs new file mode 100644 index 0000000000000..418fd3668d34f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the evaluation summary for a custom multi-label classification + /// project. + /// + public partial class CustomMultiLabelClassificationEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to multi label classification evaluation. + /// or is null. + internal CustomMultiLabelClassificationEvaluationSummary(EvaluationOptions evaluationOptions, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customMultiLabelClassificationEvaluation, nameof(customMultiLabelClassificationEvaluation)); + + ProjectKind = ProjectKind.CustomMultiLabelClassification; + CustomMultiLabelClassificationEvaluation = customMultiLabelClassificationEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to multi label classification evaluation. + internal CustomMultiLabelClassificationEvaluationSummary(ProjectKind projectKind, EvaluationOptions evaluationOptions, IDictionary serializedAdditionalRawData, MultiLabelClassificationEvaluationSummary customMultiLabelClassificationEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomMultiLabelClassificationEvaluation = customMultiLabelClassificationEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomMultiLabelClassificationEvaluationSummary() + { + } + + /// Contains the data related to multi label classification evaluation. + public MultiLabelClassificationEvaluationSummary CustomMultiLabelClassificationEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..65ec5a6b458ab --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomSingleLabelClassificationDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customSingleLabelClassificationResult"u8); + writer.WriteObjectValue(CustomSingleLabelClassificationResult, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomSingleLabelClassificationDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomSingleLabelClassificationDocumentEvaluationResult DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customSingleLabelClassificationResult"u8)) + { + customSingleLabelClassificationResult = DocumentSingleLabelClassificationEvaluationResult.DeserializeDocumentSingleLabelClassificationEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomSingleLabelClassificationDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customSingleLabelClassificationResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomSingleLabelClassificationDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomSingleLabelClassificationDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs new file mode 100644 index 0000000000000..680d1451a6551 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the document evaluation result for a custom single-label + /// classification project. + /// + public partial class CustomSingleLabelClassificationDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for single label classification. + /// , or is null. + internal CustomSingleLabelClassificationDocumentEvaluationResult(string location, string language, DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customSingleLabelClassificationResult, nameof(customSingleLabelClassificationResult)); + + ProjectKind = ProjectKind.CustomSingleLabelClassification; + CustomSingleLabelClassificationResult = customSingleLabelClassificationResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for single label classification. + internal CustomSingleLabelClassificationDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentSingleLabelClassificationEvaluationResult customSingleLabelClassificationResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomSingleLabelClassificationResult = customSingleLabelClassificationResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomSingleLabelClassificationDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for single label classification. + public DocumentSingleLabelClassificationEvaluationResult CustomSingleLabelClassificationResult { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..2eb4c727d1d17 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomSingleLabelClassificationEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customSingleLabelClassificationEvaluation"u8); + writer.WriteObjectValue(CustomSingleLabelClassificationEvaluation, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomSingleLabelClassificationEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomSingleLabelClassificationEvaluationSummary(document.RootElement, options); + } + + internal static CustomSingleLabelClassificationEvaluationSummary DeserializeCustomSingleLabelClassificationEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation = default; + ProjectKind projectKind = default; + EvaluationOptions evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customSingleLabelClassificationEvaluation"u8)) + { + customSingleLabelClassificationEvaluation = SingleLabelClassificationEvaluationSummary.DeserializeSingleLabelClassificationEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationOptions.DeserializeEvaluationOptions(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomSingleLabelClassificationEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customSingleLabelClassificationEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomSingleLabelClassificationEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomSingleLabelClassificationEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomSingleLabelClassificationEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomSingleLabelClassificationEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomSingleLabelClassificationEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs new file mode 100644 index 0000000000000..cb60367e0f935 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the evaluation summary for a custom single-label classification + /// project. + /// + public partial class CustomSingleLabelClassificationEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to single label classification evaluation. + /// or is null. + internal CustomSingleLabelClassificationEvaluationSummary(EvaluationOptions evaluationOptions, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customSingleLabelClassificationEvaluation, nameof(customSingleLabelClassificationEvaluation)); + + ProjectKind = ProjectKind.CustomSingleLabelClassification; + CustomSingleLabelClassificationEvaluation = customSingleLabelClassificationEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to single label classification evaluation. + internal CustomSingleLabelClassificationEvaluationSummary(ProjectKind projectKind, EvaluationOptions evaluationOptions, IDictionary serializedAdditionalRawData, SingleLabelClassificationEvaluationSummary customSingleLabelClassificationEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomSingleLabelClassificationEvaluation = customSingleLabelClassificationEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomSingleLabelClassificationEvaluationSummary() + { + } + + /// Contains the data related to single label classification evaluation. + public SingleLabelClassificationEvaluationSummary CustomSingleLabelClassificationEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..d570200bf0b14 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomTextSentimentDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomTextSentimentDocumentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customTextSentimentResult"u8); + writer.WriteObjectValue(CustomTextSentimentResult, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomTextSentimentDocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomTextSentimentDocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomTextSentimentDocumentEvaluationResult(document.RootElement, options); + } + + internal static CustomTextSentimentDocumentEvaluationResult DeserializeCustomTextSentimentDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentTextSentimentEvaluationResult customTextSentimentResult = default; + ProjectKind projectKind = default; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customTextSentimentResult"u8)) + { + customTextSentimentResult = DocumentTextSentimentEvaluationResult.DeserializeDocumentTextSentimentEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomTextSentimentDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData, customTextSentimentResult); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomTextSentimentDocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + CustomTextSentimentDocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomTextSentimentDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomTextSentimentDocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomTextSentimentDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomTextSentimentDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs new file mode 100644 index 0000000000000..228d09e70d1db --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the document evaluation result for a custom sentiment project. + public partial class CustomTextSentimentDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Represents the evaluation prediction for text sentiment. + /// , or is null. + internal CustomTextSentimentDocumentEvaluationResult(string location, string language, DocumentTextSentimentEvaluationResult customTextSentimentResult) : base(location, language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(customTextSentimentResult, nameof(customTextSentimentResult)); + + ProjectKind = ProjectKind.CustomTextSentiment; + CustomTextSentimentResult = customTextSentimentResult; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Keeps track of any properties unknown to the library. + /// Represents the evaluation prediction for text sentiment. + internal CustomTextSentimentDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData, DocumentTextSentimentEvaluationResult customTextSentimentResult) : base(projectKind, location, language, serializedAdditionalRawData) + { + CustomTextSentimentResult = customTextSentimentResult; + } + + /// Initializes a new instance of for deserialization. + internal CustomTextSentimentDocumentEvaluationResult() + { + } + + /// Represents the evaluation prediction for text sentiment. + public DocumentTextSentimentEvaluationResult CustomTextSentimentResult { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..bb321623f26ab --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class CustomTextSentimentEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomTextSentimentEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("customTextSentimentEvaluation"u8); + writer.WriteObjectValue(CustomTextSentimentEvaluation, options); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomTextSentimentEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomTextSentimentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomTextSentimentEvaluationSummary(document.RootElement, options); + } + + internal static CustomTextSentimentEvaluationSummary DeserializeCustomTextSentimentEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TextSentimentEvaluationSummary customTextSentimentEvaluation = default; + ProjectKind projectKind = default; + EvaluationOptions evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customTextSentimentEvaluation"u8)) + { + customTextSentimentEvaluation = TextSentimentEvaluationSummary.DeserializeTextSentimentEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationOptions.DeserializeEvaluationOptions(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomTextSentimentEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData, customTextSentimentEvaluation); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomTextSentimentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + CustomTextSentimentEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomTextSentimentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomTextSentimentEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new CustomTextSentimentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCustomTextSentimentEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs new file mode 100644 index 0000000000000..31fec6800b260 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the evaluation summary for a custom text sentiment project. + public partial class CustomTextSentimentEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Contains the data related to custom sentiment evaluation. + /// or is null. + internal CustomTextSentimentEvaluationSummary(EvaluationOptions evaluationOptions, TextSentimentEvaluationSummary customTextSentimentEvaluation) : base(evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(customTextSentimentEvaluation, nameof(customTextSentimentEvaluation)); + + ProjectKind = ProjectKind.CustomTextSentiment; + CustomTextSentimentEvaluation = customTextSentimentEvaluation; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + /// Contains the data related to custom sentiment evaluation. + internal CustomTextSentimentEvaluationSummary(ProjectKind projectKind, EvaluationOptions evaluationOptions, IDictionary serializedAdditionalRawData, TextSentimentEvaluationSummary customTextSentimentEvaluation) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + CustomTextSentimentEvaluation = customTextSentimentEvaluation; + } + + /// Initializes a new instance of for deserialization. + internal CustomTextSentimentEvaluationSummary() + { + } + + /// Contains the data related to custom sentiment evaluation. + public TextSentimentEvaluationSummary CustomTextSentimentEvaluation { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs new file mode 100644 index 0000000000000..833f35785bd58 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DataGenerationConnectionInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataGenerationConnectionInfo)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.ToString()); + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + writer.WritePropertyName("deploymentName"u8); + writer.WriteStringValue(DeploymentName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DataGenerationConnectionInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataGenerationConnectionInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataGenerationConnectionInfo(document.RootElement, options); + } + + internal static DataGenerationConnectionInfo DeserializeDataGenerationConnectionInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataGenerationConnectionInfoKind kind = default; + string resourceId = default; + string deploymentName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = new DataGenerationConnectionInfoKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataGenerationConnectionInfo(kind, resourceId, deploymentName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataGenerationConnectionInfo)} does not support writing '{options.Format}' format."); + } + } + + DataGenerationConnectionInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataGenerationConnectionInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataGenerationConnectionInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DataGenerationConnectionInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDataGenerationConnectionInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.cs new file mode 100644 index 0000000000000..61da77f366e65 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. + public partial class DataGenerationConnectionInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + /// Deployment name of model to be used for synthetic data generation. + /// or is null. + public DataGenerationConnectionInfo(string resourceId, string deploymentName) + { + Argument.AssertNotNull(resourceId, nameof(resourceId)); + Argument.AssertNotNull(deploymentName, nameof(deploymentName)); + + ResourceId = resourceId; + DeploymentName = deploymentName; + } + + /// Initializes a new instance of . + /// Connection type for data generation settings. Currently only supports Azure Open AI. + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + /// Deployment name of model to be used for synthetic data generation. + /// Keeps track of any properties unknown to the library. + internal DataGenerationConnectionInfo(DataGenerationConnectionInfoKind kind, string resourceId, string deploymentName, IDictionary serializedAdditionalRawData) + { + Kind = kind; + ResourceId = resourceId; + DeploymentName = deploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataGenerationConnectionInfo() + { + } + + /// Connection type for data generation settings. Currently only supports Azure Open AI. + public DataGenerationConnectionInfoKind Kind { get; } = DataGenerationConnectionInfoKind.AzureOpenAI; + + /// Resource ID for the data generation resource. Looks something like "/subscriptions/<SUBSCRIPTION-ID-GUID>/resourceGroups/<RG-NAME>/providers/Microsoft.CognitiveServices/accounts/<AOAI-ACCOUNT-NAME>". + public string ResourceId { get; } + /// Deployment name of model to be used for synthetic data generation. + public string DeploymentName { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfoKind.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfoKind.cs new file mode 100644 index 0000000000000..69edc95d65276 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfoKind.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The DataGenerationConnectionInfo_kind. + public readonly partial struct DataGenerationConnectionInfoKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataGenerationConnectionInfoKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureOpenAIValue = "azureOpenAI"; + + /// azureOpenAI. + public static DataGenerationConnectionInfoKind AzureOpenAI { get; } = new DataGenerationConnectionInfoKind(AzureOpenAIValue); + /// Determines if two values are the same. + public static bool operator ==(DataGenerationConnectionInfoKind left, DataGenerationConnectionInfoKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataGenerationConnectionInfoKind left, DataGenerationConnectionInfoKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataGenerationConnectionInfoKind(string value) => new DataGenerationConnectionInfoKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataGenerationConnectionInfoKind other && Equals(other); + /// + public bool Equals(DataGenerationConnectionInfoKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.Serialization.cs new file mode 100644 index 0000000000000..fec0c4ffeba87 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DataGenerationSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("enableDataGeneration"u8); + writer.WriteBooleanValue(EnableDataGeneration); + writer.WritePropertyName("dataGenerationConnectionInfo"u8); + writer.WriteObjectValue(DataGenerationConnectionInfo, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DataGenerationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataGenerationSettings(document.RootElement, options); + } + + internal static DataGenerationSettings DeserializeDataGenerationSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool enableDataGeneration = default; + DataGenerationConnectionInfo dataGenerationConnectionInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableDataGeneration"u8)) + { + enableDataGeneration = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dataGenerationConnectionInfo"u8)) + { + dataGenerationConnectionInfo = DataGenerationConnectionInfo.DeserializeDataGenerationConnectionInfo(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataGenerationSettings(enableDataGeneration, dataGenerationConnectionInfo, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support writing '{options.Format}' format."); + } + } + + DataGenerationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDataGenerationSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataGenerationSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DataGenerationSettings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDataGenerationSettings(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.cs new file mode 100644 index 0000000000000..e1b215f18b1bf --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the settings for using data generation as part of training a custom model. + public partial class DataGenerationSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// If set to true, augment customer provided training data with synthetic data to improve model quality. + /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. + /// is null. + public DataGenerationSettings(bool enableDataGeneration, DataGenerationConnectionInfo dataGenerationConnectionInfo) + { + Argument.AssertNotNull(dataGenerationConnectionInfo, nameof(dataGenerationConnectionInfo)); + + EnableDataGeneration = enableDataGeneration; + DataGenerationConnectionInfo = dataGenerationConnectionInfo; + } + + /// Initializes a new instance of . + /// If set to true, augment customer provided training data with synthetic data to improve model quality. + /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. + /// Keeps track of any properties unknown to the library. + internal DataGenerationSettings(bool enableDataGeneration, DataGenerationConnectionInfo dataGenerationConnectionInfo, IDictionary serializedAdditionalRawData) + { + EnableDataGeneration = enableDataGeneration; + DataGenerationConnectionInfo = dataGenerationConnectionInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataGenerationSettings() + { + } + + /// If set to true, augment customer provided training data with synthetic data to improve model quality. + public bool EnableDataGeneration { get; } + /// Represents the connection info for the Azure resource to use during data generation as part of training a custom model. + public DataGenerationConnectionInfo DataGenerationConnectionInfo { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentOptions.Serialization.cs new file mode 100644 index 0000000000000..941a2d862eb51 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentOptions.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DeleteDeploymentOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeleteDeploymentOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AssignedResourceIds)) + { + writer.WritePropertyName("assignedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeleteDeploymentOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeleteDeploymentOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeleteDeploymentOptions(document.RootElement, options); + } + + internal static DeleteDeploymentOptions DeserializeDeleteDeploymentOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList assignedResourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignedResourceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignedResourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeleteDeploymentOptions(assignedResourceIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeleteDeploymentOptions)} does not support writing '{options.Format}' format."); + } + } + + DeleteDeploymentOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeleteDeploymentOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeleteDeploymentOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeleteDeploymentOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeleteDeploymentOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentOptions.cs new file mode 100644 index 0000000000000..a1b73a12279b2 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentOptions.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the options for deleting a project deployment. + public partial class DeleteDeploymentOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeleteDeploymentOptions() + { + AssignedResourceIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Represents the resource IDs to delete the deployment from. + /// If not provided, the deployment will be rolled out from all the + /// resources it is deployed to. + /// If provided, it will delete the deployment only from the specified + /// assigned resources, and leave it for the rest. + /// + /// Keeps track of any properties unknown to the library. + internal DeleteDeploymentOptions(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Represents the resource IDs to delete the deployment from. + /// If not provided, the deployment will be rolled out from all the + /// resources it is deployed to. + /// If provided, it will delete the deployment only from the specified + /// assigned resources, and leave it for the rest. + /// + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.Serialization.cs new file mode 100644 index 0000000000000..f02f6fe0bf802 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DeploymentResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentResource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentResource(document.RootElement, options); + } + + internal static DeploymentResource DeserializeDeploymentResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceId = default; + string region = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentResource(resourceId, region, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentResource)} does not support writing '{options.Format}' format."); + } + } + + DeploymentResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DeploymentResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeploymentResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.cs new file mode 100644 index 0000000000000..ddaa23ddc7520 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an Azure resource assigned to a deployment. + public partial class DeploymentResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// or is null. + internal DeploymentResource(string resourceId, string region) + { + Argument.AssertNotNull(resourceId, nameof(resourceId)); + Argument.AssertNotNull(region, nameof(region)); + + ResourceId = resourceId; + Region = region; + } + + /// Initializes a new instance of . + /// Represents the Azure resource Id. + /// Represents the resource region. + /// Keeps track of any properties unknown to the library. + internal DeploymentResource(string resourceId, string region, IDictionary serializedAdditionalRawData) + { + ResourceId = resourceId; + Region = region; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentResource() + { + } + + /// Represents the Azure resource Id. + public string ResourceId { get; } + /// Represents the resource region. + public string Region { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..dd0269d485333 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DocumentEntityLabelEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityLabelEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset); + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentEntityLabelEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityLabelEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEntityLabelEvaluationResult(document.RootElement, options); + } + + internal static DocumentEntityLabelEvaluationResult DeserializeDocumentEntityLabelEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + int offset = default; + int length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("offset"u8)) + { + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentEntityLabelEvaluationResult(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEntityLabelEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEntityLabelEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEntityLabelEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEntityLabelEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentEntityLabelEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentEntityLabelEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs new file mode 100644 index 0000000000000..71040b3cfab84 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an evaluation result entity label. + public partial class DocumentEntityLabelEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the entity category. + /// Represents the entity offset index relative to the original text. + /// Represents the entity length. + /// is null. + internal DocumentEntityLabelEvaluationResult(string category, int offset, int length) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + Offset = offset; + Length = length; + } + + /// Initializes a new instance of . + /// Represents the entity category. + /// Represents the entity offset index relative to the original text. + /// Represents the entity length. + /// Keeps track of any properties unknown to the library. + internal DocumentEntityLabelEvaluationResult(string category, int offset, int length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentEntityLabelEvaluationResult() + { + } + + /// Represents the entity category. + public string Category { get; } + /// Represents the entity offset index relative to the original text. + public int Offset { get; } + /// Represents the entity length. + public int Length { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..9b53e38332038 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DocumentEntityRecognitionEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityRecognitionEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentEntityRecognitionEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityRecognitionEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEntityRecognitionEvaluationResult(document.RootElement, options); + } + + internal static DocumentEntityRecognitionEvaluationResult DeserializeDocumentEntityRecognitionEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList entities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentEntityRegionEvaluationResult.DeserializeDocumentEntityRegionEvaluationResult(item, options)); + } + entities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentEntityRecognitionEvaluationResult(entities, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEntityRecognitionEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEntityRecognitionEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEntityRecognitionEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEntityRecognitionEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentEntityRecognitionEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentEntityRecognitionEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs new file mode 100644 index 0000000000000..2085d538a469e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the entity recognition evaluation result for a document. + public partial class DocumentEntityRecognitionEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// is null. + internal DocumentEntityRecognitionEvaluationResult(IEnumerable entities) + { + Argument.AssertNotNull(entities, nameof(entities)); + + Entities = entities.ToList(); + } + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// Keeps track of any properties unknown to the library. + internal DocumentEntityRecognitionEvaluationResult(IReadOnlyList entities, IDictionary serializedAdditionalRawData) + { + Entities = entities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentEntityRecognitionEvaluationResult() + { + } + + /// Represents the document labelled entities. + public IReadOnlyList Entities { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..ec968f286133f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DocumentEntityRegionEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityRegionEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("expectedEntities"u8); + writer.WriteStartArray(); + foreach (var item in ExpectedEntities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("predictedEntities"u8); + writer.WriteStartArray(); + foreach (var item in PredictedEntities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("regionOffset"u8); + writer.WriteNumberValue(RegionOffset); + writer.WritePropertyName("regionLength"u8); + writer.WriteNumberValue(RegionLength); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentEntityRegionEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEntityRegionEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEntityRegionEvaluationResult(document.RootElement, options); + } + + internal static DocumentEntityRegionEvaluationResult DeserializeDocumentEntityRegionEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList expectedEntities = default; + IReadOnlyList predictedEntities = default; + int regionOffset = default; + int regionLength = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedEntities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentEntityLabelEvaluationResult.DeserializeDocumentEntityLabelEvaluationResult(item, options)); + } + expectedEntities = array; + continue; + } + if (property.NameEquals("predictedEntities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentEntityLabelEvaluationResult.DeserializeDocumentEntityLabelEvaluationResult(item, options)); + } + predictedEntities = array; + continue; + } + if (property.NameEquals("regionOffset"u8)) + { + regionOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("regionLength"u8)) + { + regionLength = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentEntityRegionEvaluationResult(expectedEntities, predictedEntities, regionOffset, regionLength, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEntityRegionEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEntityRegionEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEntityRegionEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEntityRegionEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentEntityRegionEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentEntityRegionEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs new file mode 100644 index 0000000000000..4f30ead5add57 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the evaluation comparison between the expected and predicted + /// entities of a document region. + /// + public partial class DocumentEntityRegionEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the region's expected entity labels. + /// Represents the region's predicted entity labels. + /// Represents the region offset. + /// Represents the region length. + /// or is null. + internal DocumentEntityRegionEvaluationResult(IEnumerable expectedEntities, IEnumerable predictedEntities, int regionOffset, int regionLength) + { + Argument.AssertNotNull(expectedEntities, nameof(expectedEntities)); + Argument.AssertNotNull(predictedEntities, nameof(predictedEntities)); + + ExpectedEntities = expectedEntities.ToList(); + PredictedEntities = predictedEntities.ToList(); + RegionOffset = regionOffset; + RegionLength = regionLength; + } + + /// Initializes a new instance of . + /// Represents the region's expected entity labels. + /// Represents the region's predicted entity labels. + /// Represents the region offset. + /// Represents the region length. + /// Keeps track of any properties unknown to the library. + internal DocumentEntityRegionEvaluationResult(IReadOnlyList expectedEntities, IReadOnlyList predictedEntities, int regionOffset, int regionLength, IDictionary serializedAdditionalRawData) + { + ExpectedEntities = expectedEntities; + PredictedEntities = predictedEntities; + RegionOffset = regionOffset; + RegionLength = regionLength; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentEntityRegionEvaluationResult() + { + } + + /// Represents the region's expected entity labels. + public IReadOnlyList ExpectedEntities { get; } + /// Represents the region's predicted entity labels. + public IReadOnlyList PredictedEntities { get; } + /// Represents the region offset. + public int RegionOffset { get; } + /// Represents the region length. + public int RegionLength { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..a48990a5bfb07 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + [PersistableModelProxy(typeof(UnknownDocumentEvaluationResult))] + public partial class DocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEvaluationResult(document.RootElement, options); + } + + internal static DocumentEvaluationResult DeserializeDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("projectKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "CustomEntityRecognition": return CustomEntityRecognitionDocumentEvaluationResult.DeserializeCustomEntityRecognitionDocumentEvaluationResult(element, options); + case "CustomHealthcare": return CustomHealthcareDocumentEvaluationResult.DeserializeCustomHealthcareDocumentEvaluationResult(element, options); + case "CustomMultiLabelClassification": return CustomMultiLabelClassificationDocumentEvaluationResult.DeserializeCustomMultiLabelClassificationDocumentEvaluationResult(element, options); + case "CustomSingleLabelClassification": return CustomSingleLabelClassificationDocumentEvaluationResult.DeserializeCustomSingleLabelClassificationDocumentEvaluationResult(element, options); + case "CustomTextSentiment": return CustomTextSentimentDocumentEvaluationResult.DeserializeCustomTextSentimentDocumentEvaluationResult(element, options); + } + } + return UnknownDocumentEvaluationResult.DeserializeUnknownDocumentEvaluationResult(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.cs new file mode 100644 index 0000000000000..ad2ecbe54d19c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the evaluation result of a document. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public abstract partial class DocumentEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// or is null. + protected DocumentEvaluationResult(string location, string language) + { + Argument.AssertNotNull(location, nameof(location)); + Argument.AssertNotNull(language, nameof(language)); + + Location = location; + Language = language; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Keeps track of any properties unknown to the library. + internal DocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + Location = location; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentEvaluationResult() + { + } + + /// Represents the project kind. + internal ProjectKind ProjectKind { get; set; } + /// Represents the document path. + public string Location { get; } + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + public string Language { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..9dcead7fd6107 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DocumentHealthcareEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentHealthcareEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentHealthcareEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentHealthcareEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentHealthcareEvaluationResult(document.RootElement, options); + } + + internal static DocumentHealthcareEvaluationResult DeserializeDocumentHealthcareEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList entities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentEntityRegionEvaluationResult.DeserializeDocumentEntityRegionEvaluationResult(item, options)); + } + entities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentHealthcareEvaluationResult(entities, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentHealthcareEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentHealthcareEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentHealthcareEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentHealthcareEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentHealthcareEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentHealthcareEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.cs new file mode 100644 index 0000000000000..ce6e7bbef7fed --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the healthcare evaluation result for a document. + public partial class DocumentHealthcareEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// is null. + internal DocumentHealthcareEvaluationResult(IEnumerable entities) + { + Argument.AssertNotNull(entities, nameof(entities)); + + Entities = entities.ToList(); + } + + /// Initializes a new instance of . + /// Represents the document labelled entities. + /// Keeps track of any properties unknown to the library. + internal DocumentHealthcareEvaluationResult(IReadOnlyList entities, IDictionary serializedAdditionalRawData) + { + Entities = entities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentHealthcareEvaluationResult() + { + } + + /// Represents the document labelled entities. + public IReadOnlyList Entities { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..bce7232f08a7a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DocumentMultiLabelClassificationEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentMultiLabelClassificationEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("expectedClasses"u8); + writer.WriteStartArray(); + foreach (var item in ExpectedClasses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("predictedClasses"u8); + writer.WriteStartArray(); + foreach (var item in PredictedClasses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentMultiLabelClassificationEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentMultiLabelClassificationEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentMultiLabelClassificationEvaluationResult(document.RootElement, options); + } + + internal static DocumentMultiLabelClassificationEvaluationResult DeserializeDocumentMultiLabelClassificationEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList expectedClasses = default; + IReadOnlyList predictedClasses = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedClasses"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + expectedClasses = array; + continue; + } + if (property.NameEquals("predictedClasses"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + predictedClasses = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentMultiLabelClassificationEvaluationResult(expectedClasses, predictedClasses, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentMultiLabelClassificationEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentMultiLabelClassificationEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentMultiLabelClassificationEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentMultiLabelClassificationEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentMultiLabelClassificationEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentMultiLabelClassificationEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs new file mode 100644 index 0000000000000..0119f0a4751d1 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the comparison between the expected and predicted classes that are + /// result from the evaluation operation. + /// + public partial class DocumentMultiLabelClassificationEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document's expected classes. + /// Represents the document's predicted classes. + /// or is null. + internal DocumentMultiLabelClassificationEvaluationResult(IEnumerable expectedClasses, IEnumerable predictedClasses) + { + Argument.AssertNotNull(expectedClasses, nameof(expectedClasses)); + Argument.AssertNotNull(predictedClasses, nameof(predictedClasses)); + + ExpectedClasses = expectedClasses.ToList(); + PredictedClasses = predictedClasses.ToList(); + } + + /// Initializes a new instance of . + /// Represents the document's expected classes. + /// Represents the document's predicted classes. + /// Keeps track of any properties unknown to the library. + internal DocumentMultiLabelClassificationEvaluationResult(IReadOnlyList expectedClasses, IReadOnlyList predictedClasses, IDictionary serializedAdditionalRawData) + { + ExpectedClasses = expectedClasses; + PredictedClasses = predictedClasses; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentMultiLabelClassificationEvaluationResult() + { + } + + /// Represents the document's expected classes. + public IReadOnlyList ExpectedClasses { get; } + /// Represents the document's predicted classes. + public IReadOnlyList PredictedClasses { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..8287382c5ad4d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DocumentSentimentLabelEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentSentimentLabelEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.ToString()); + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset); + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentSentimentLabelEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentSentimentLabelEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentSentimentLabelEvaluationResult(document.RootElement, options); + } + + internal static DocumentSentimentLabelEvaluationResult DeserializeDocumentSentimentLabelEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Sentiment category = default; + int offset = default; + int length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = new Sentiment(property.Value.GetString()); + continue; + } + if (property.NameEquals("offset"u8)) + { + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentSentimentLabelEvaluationResult(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentSentimentLabelEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentSentimentLabelEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentSentimentLabelEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentSentimentLabelEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentSentimentLabelEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentSentimentLabelEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs new file mode 100644 index 0000000000000..ea377407dfc84 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an evaluation result Sentiment label. + public partial class DocumentSentimentLabelEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the sentiment category. + /// Represents the sentiment offset index relative to the original text. + /// Represents the sentiment length. + internal DocumentSentimentLabelEvaluationResult(Sentiment category, int offset, int length) + { + Category = category; + Offset = offset; + Length = length; + } + + /// Initializes a new instance of . + /// Represents the sentiment category. + /// Represents the sentiment offset index relative to the original text. + /// Represents the sentiment length. + /// Keeps track of any properties unknown to the library. + internal DocumentSentimentLabelEvaluationResult(Sentiment category, int offset, int length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentSentimentLabelEvaluationResult() + { + } + + /// Represents the sentiment category. + public Sentiment Category { get; } + /// Represents the sentiment offset index relative to the original text. + public int Offset { get; } + /// Represents the sentiment length. + public int Length { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..199376c331d5d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DocumentSingleLabelClassificationEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentSingleLabelClassificationEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("expectedClass"u8); + writer.WriteStringValue(ExpectedClass); + writer.WritePropertyName("predictedClass"u8); + writer.WriteStringValue(PredictedClass); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentSingleLabelClassificationEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentSingleLabelClassificationEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentSingleLabelClassificationEvaluationResult(document.RootElement, options); + } + + internal static DocumentSingleLabelClassificationEvaluationResult DeserializeDocumentSingleLabelClassificationEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string expectedClass = default; + string predictedClass = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedClass"u8)) + { + expectedClass = property.Value.GetString(); + continue; + } + if (property.NameEquals("predictedClass"u8)) + { + predictedClass = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentSingleLabelClassificationEvaluationResult(expectedClass, predictedClass, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentSingleLabelClassificationEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentSingleLabelClassificationEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentSingleLabelClassificationEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentSingleLabelClassificationEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentSingleLabelClassificationEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentSingleLabelClassificationEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs new file mode 100644 index 0000000000000..c7b90168e4e11 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the comparison between the expected and predicted class that result + /// from an evaluation operation. + /// + public partial class DocumentSingleLabelClassificationEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document's expected class. + /// Represents the document's predicted class. + /// or is null. + internal DocumentSingleLabelClassificationEvaluationResult(string expectedClass, string predictedClass) + { + Argument.AssertNotNull(expectedClass, nameof(expectedClass)); + Argument.AssertNotNull(predictedClass, nameof(predictedClass)); + + ExpectedClass = expectedClass; + PredictedClass = predictedClass; + } + + /// Initializes a new instance of . + /// Represents the document's expected class. + /// Represents the document's predicted class. + /// Keeps track of any properties unknown to the library. + internal DocumentSingleLabelClassificationEvaluationResult(string expectedClass, string predictedClass, IDictionary serializedAdditionalRawData) + { + ExpectedClass = expectedClass; + PredictedClass = predictedClass; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentSingleLabelClassificationEvaluationResult() + { + } + + /// Represents the document's expected class. + public string ExpectedClass { get; } + /// Represents the document's predicted class. + public string PredictedClass { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..8e2a2ea00a0b8 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class DocumentTextSentimentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentTextSentimentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("expectedSentimentSpans"u8); + writer.WriteStartArray(); + foreach (var item in ExpectedSentimentSpans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("predictedSentimentSpans"u8); + writer.WriteStartArray(); + foreach (var item in PredictedSentimentSpans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentTextSentimentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentTextSentimentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentTextSentimentEvaluationResult(document.RootElement, options); + } + + internal static DocumentTextSentimentEvaluationResult DeserializeDocumentTextSentimentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList expectedSentimentSpans = default; + IReadOnlyList predictedSentimentSpans = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedSentimentSpans"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentSentimentLabelEvaluationResult.DeserializeDocumentSentimentLabelEvaluationResult(item, options)); + } + expectedSentimentSpans = array; + continue; + } + if (property.NameEquals("predictedSentimentSpans"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentSentimentLabelEvaluationResult.DeserializeDocumentSentimentLabelEvaluationResult(item, options)); + } + predictedSentimentSpans = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentTextSentimentEvaluationResult(expectedSentimentSpans, predictedSentimentSpans, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentTextSentimentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentTextSentimentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentTextSentimentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentTextSentimentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentTextSentimentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentTextSentimentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs new file mode 100644 index 0000000000000..32ca37acbb3f2 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the comparison between the expected and predicted sentiment that + /// result from an evaluation operation. + /// + public partial class DocumentTextSentimentEvaluationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the document's expected sentiment labels. + /// Represents the document's predicted sentiment labels. + /// or is null. + internal DocumentTextSentimentEvaluationResult(IEnumerable expectedSentimentSpans, IEnumerable predictedSentimentSpans) + { + Argument.AssertNotNull(expectedSentimentSpans, nameof(expectedSentimentSpans)); + Argument.AssertNotNull(predictedSentimentSpans, nameof(predictedSentimentSpans)); + + ExpectedSentimentSpans = expectedSentimentSpans.ToList(); + PredictedSentimentSpans = predictedSentimentSpans.ToList(); + } + + /// Initializes a new instance of . + /// Represents the document's expected sentiment labels. + /// Represents the document's predicted sentiment labels. + /// Keeps track of any properties unknown to the library. + internal DocumentTextSentimentEvaluationResult(IReadOnlyList expectedSentimentSpans, IReadOnlyList predictedSentimentSpans, IDictionary serializedAdditionalRawData) + { + ExpectedSentimentSpans = expectedSentimentSpans; + PredictedSentimentSpans = predictedSentimentSpans; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentTextSentimentEvaluationResult() + { + } + + /// Represents the document's expected sentiment labels. + public IReadOnlyList ExpectedSentimentSpans { get; } + /// Represents the document's predicted sentiment labels. + public IReadOnlyList PredictedSentimentSpans { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..82492be9a2b44 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class EntityEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EntityEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityEvaluationSummary(document.RootElement, options); + } + + internal static EntityEvaluationSummary DeserializeEntityEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EntityEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEntityEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EntityEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEntityEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.cs new file mode 100644 index 0000000000000..1ded1789e1808 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the evaluation summary for an entity. + public partial class EntityEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal EntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal EntityEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EntityEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..960c3f1cfdf80 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class EntityRecognitionEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityRecognitionEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("confusionMatrix"u8); + writer.WriteObjectValue(ConfusionMatrix, options); + writer.WritePropertyName("entities"u8); + writer.WriteStartObject(); + foreach (var item in Entities) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EntityRecognitionEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntityRecognitionEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntityRecognitionEvaluationSummary(document.RootElement, options); + } + + internal static EntityRecognitionEvaluationSummary DeserializeEntityRecognitionEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary entities = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confusionMatrix"u8)) + { + confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + continue; + } + if (property.NameEquals("entities"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, EntityEvaluationSummary.DeserializeEntityEvaluationSummary(property0.Value, options)); + } + entities = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntityRecognitionEvaluationSummary( + confusionMatrix, + entities, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EntityRecognitionEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EntityRecognitionEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEntityRecognitionEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntityRecognitionEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EntityRecognitionEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEntityRecognitionEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.cs new file mode 100644 index 0000000000000..27a856dff90d9 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the evaluation summary for a custom entity recognition project. + public partial class EntityRecognitionEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two entities (the two entities can be + /// the same). The matrix is between the entity that was labelled and the entity + /// that was predicted. + /// + /// Represents the entities evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// or is null. + internal EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); + Argument.AssertNotNull(entities, nameof(entities)); + + ConfusionMatrix = confusionMatrix; + Entities = entities; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two entities (the two entities can be + /// the same). The matrix is between the entity that was labelled and the entity + /// that was predicted. + /// + /// Represents the entities evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Keeps track of any properties unknown to the library. + internal EntityRecognitionEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary entities, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + ConfusionMatrix = confusionMatrix; + Entities = entities; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EntityRecognitionEvaluationSummary() + { + } + + /// + /// Represents the confusion matrix between two entities (the two entities can be + /// the same). The matrix is between the entity that was labelled and the entity + /// that was predicted. + /// + public ConfusionMatrix ConfusionMatrix { get; } + /// Represents the entities evaluation. + public IReadOnlyDictionary Entities { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroPrecision { get; } + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroPrecision { get; } + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Error.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Error.Serialization.cs new file mode 100644 index 0000000000000..f189a32d73dc0 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Error.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class Error : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Error)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.ToString()); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Innererror)) + { + writer.WritePropertyName("innererror"u8); + writer.WriteObjectValue(Innererror, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + Error IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Error)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeError(document.RootElement, options); + } + + internal static Error DeserializeError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ErrorCode code = default; + string message = default; + string target = default; + IReadOnlyList details = default; + InnerErrorModel innererror = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = new ErrorCode(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeError(item, options)); + } + details = array; + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = InnerErrorModel.DeserializeInnerErrorModel(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Error( + code, + message, + target, + details ?? new ChangeTrackingList(), + innererror, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Error)} does not support writing '{options.Format}' format."); + } + } + + Error IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Error)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Error FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeError(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Error.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Error.cs new file mode 100644 index 0000000000000..0507f7a2f79f9 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Error.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The error object. + public partial class Error + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. + /// is null. + internal Error(ErrorCode code, string message) + { + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// A human-readable representation of the error. + /// The target of the error. + /// An array of details about specific errors that led to this reported error. + /// + /// An object containing more specific information than the current object about + /// the error. + /// + /// Keeps track of any properties unknown to the library. + internal Error(ErrorCode code, string message, string target, IReadOnlyList details, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + Target = target; + Details = details; + Innererror = innererror; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Error() + { + } + + /// One of a server-defined set of error codes. + public ErrorCode Code { get; } + /// A human-readable representation of the error. + public string Message { get; } + /// The target of the error. + public string Target { get; } + /// An array of details about specific errors that led to this reported error. + public IReadOnlyList Details { get; } + /// + /// An object containing more specific information than the current object about + /// the error. + /// + public InnerErrorModel Innererror { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ErrorCode.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ErrorCode.cs new file mode 100644 index 0000000000000..6b3343327ef2f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ErrorCode.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Human-readable error code. + public readonly partial struct ErrorCode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ErrorCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidRequestValue = "InvalidRequest"; + private const string InvalidArgumentValue = "InvalidArgument"; + private const string UnauthorizedValue = "Unauthorized"; + private const string ForbiddenValue = "Forbidden"; + private const string NotFoundValue = "NotFound"; + private const string ProjectNotFoundValue = "ProjectNotFound"; + private const string OperationNotFoundValue = "OperationNotFound"; + private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; + private const string AzureCognitiveSearchIndexNotFoundValue = "AzureCognitiveSearchIndexNotFound"; + private const string TooManyRequestsValue = "TooManyRequests"; + private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; + private const string AzureCognitiveSearchIndexLimitReachedValue = "AzureCognitiveSearchIndexLimitReached"; + private const string InternalServerErrorValue = "InternalServerError"; + private const string ServiceUnavailableValue = "ServiceUnavailable"; + private const string TimeoutValue = "Timeout"; + private const string QuotaExceededValue = "QuotaExceeded"; + private const string ConflictValue = "Conflict"; + private const string WarningValue = "Warning"; + + /// InvalidRequest. + public static ErrorCode InvalidRequest { get; } = new ErrorCode(InvalidRequestValue); + /// InvalidArgument. + public static ErrorCode InvalidArgument { get; } = new ErrorCode(InvalidArgumentValue); + /// Unauthorized. + public static ErrorCode Unauthorized { get; } = new ErrorCode(UnauthorizedValue); + /// Forbidden. + public static ErrorCode Forbidden { get; } = new ErrorCode(ForbiddenValue); + /// NotFound. + public static ErrorCode NotFound { get; } = new ErrorCode(NotFoundValue); + /// ProjectNotFound. + public static ErrorCode ProjectNotFound { get; } = new ErrorCode(ProjectNotFoundValue); + /// OperationNotFound. + public static ErrorCode OperationNotFound { get; } = new ErrorCode(OperationNotFoundValue); + /// AzureCognitiveSearchNotFound. + public static ErrorCode AzureCognitiveSearchNotFound { get; } = new ErrorCode(AzureCognitiveSearchNotFoundValue); + /// AzureCognitiveSearchIndexNotFound. + public static ErrorCode AzureCognitiveSearchIndexNotFound { get; } = new ErrorCode(AzureCognitiveSearchIndexNotFoundValue); + /// TooManyRequests. + public static ErrorCode TooManyRequests { get; } = new ErrorCode(TooManyRequestsValue); + /// AzureCognitiveSearchThrottling. + public static ErrorCode AzureCognitiveSearchThrottling { get; } = new ErrorCode(AzureCognitiveSearchThrottlingValue); + /// AzureCognitiveSearchIndexLimitReached. + public static ErrorCode AzureCognitiveSearchIndexLimitReached { get; } = new ErrorCode(AzureCognitiveSearchIndexLimitReachedValue); + /// InternalServerError. + public static ErrorCode InternalServerError { get; } = new ErrorCode(InternalServerErrorValue); + /// ServiceUnavailable. + public static ErrorCode ServiceUnavailable { get; } = new ErrorCode(ServiceUnavailableValue); + /// Timeout. + public static ErrorCode Timeout { get; } = new ErrorCode(TimeoutValue); + /// QuotaExceeded. + public static ErrorCode QuotaExceeded { get; } = new ErrorCode(QuotaExceededValue); + /// Conflict. + public static ErrorCode Conflict { get; } = new ErrorCode(ConflictValue); + /// Warning. + public static ErrorCode Warning { get; } = new ErrorCode(WarningValue); + /// Determines if two values are the same. + public static bool operator ==(ErrorCode left, ErrorCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ErrorCode left, ErrorCode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ErrorCode(string value) => new ErrorCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ErrorCode other && Equals(other); + /// + public bool Equals(ErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.Serialization.cs new file mode 100644 index 0000000000000..bfb622761c7c0 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class EvaluationJobResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EvaluationJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationJobResult(document.RootElement, options); + } + + internal static EvaluationJobResult DeserializeEvaluationJobResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EvaluationOptions evaluationOptions = default; + string modelLabel = default; + string trainingConfigVersion = default; + int percentComplete = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationOptions.DeserializeEvaluationOptions(property.Value, options); + continue; + } + if (property.NameEquals("modelLabel"u8)) + { + modelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("percentComplete"u8)) + { + percentComplete = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationJobResult(evaluationOptions, modelLabel, trainingConfigVersion, percentComplete, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support writing '{options.Format}' format."); + } + } + + EvaluationJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationJobResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationJobResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationJobResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationJobResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.cs new file mode 100644 index 0000000000000..6b2ec322bbc8b --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The EvaluationJobResult. + public partial class EvaluationJobResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Represents trained model label. + /// Represents training config version. + /// Represents progress percentage. + /// , or is null. + internal EvaluationJobResult(EvaluationOptions evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); + + EvaluationOptions = evaluationOptions; + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + PercentComplete = percentComplete; + } + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// Represents trained model label. + /// Represents training config version. + /// Represents progress percentage. + /// Keeps track of any properties unknown to the library. + internal EvaluationJobResult(EvaluationOptions evaluationOptions, string modelLabel, string trainingConfigVersion, int percentComplete, IDictionary serializedAdditionalRawData) + { + EvaluationOptions = evaluationOptions; + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + PercentComplete = percentComplete; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationJobResult() + { + } + + /// Represents the options used running the evaluation. + public EvaluationOptions EvaluationOptions { get; } + /// Represents trained model label. + public string ModelLabel { get; } + /// Represents training config version. + public string TrainingConfigVersion { get; } + /// Represents progress percentage. + public int PercentComplete { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationKind.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationKind.cs new file mode 100644 index 0000000000000..65e6b74584ff2 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The EvaluationKind. + public readonly partial struct EvaluationKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EvaluationKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PercentageValue = "percentage"; + private const string ManualValue = "manual"; + + /// + /// Split the data into training and test sets according to user-defined + /// percentages. + /// + public static EvaluationKind Percentage { get; } = new EvaluationKind(PercentageValue); + /// Split the data according to the chosen dataset for every example in the data. + public static EvaluationKind Manual { get; } = new EvaluationKind(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(EvaluationKind left, EvaluationKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EvaluationKind left, EvaluationKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EvaluationKind(string value) => new EvaluationKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EvaluationKind other && Equals(other); + /// + public bool Equals(EvaluationKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationOptions.Serialization.cs new file mode 100644 index 0000000000000..cb277aa3d5059 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationOptions.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class EvaluationOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } + if (Optional.IsDefined(TrainingSplitPercentage)) + { + writer.WritePropertyName("trainingSplitPercentage"u8); + writer.WriteNumberValue(TrainingSplitPercentage.Value); + } + if (Optional.IsDefined(TestingSplitPercentage)) + { + writer.WritePropertyName("testingSplitPercentage"u8); + writer.WriteNumberValue(TestingSplitPercentage.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EvaluationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationOptions(document.RootElement, options); + } + + internal static EvaluationOptions DeserializeEvaluationOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EvaluationKind? kind = default; + int? trainingSplitPercentage = default; + int? testingSplitPercentage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new EvaluationKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingSplitPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trainingSplitPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("testingSplitPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + testingSplitPercentage = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationOptions(kind, trainingSplitPercentage, testingSplitPercentage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationOptions)} does not support writing '{options.Format}' format."); + } + } + + EvaluationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationOptions.cs new file mode 100644 index 0000000000000..11c37c0eb007c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationOptions.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the options used running the evaluation. + public partial class EvaluationOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public EvaluationOptions() + { + } + + /// Initializes a new instance of . + /// + /// Represents the evaluation kind. By default, the evaluation kind is set to + /// percentage. + /// + /// + /// Represents the training dataset split percentage. Only needed in case the + /// evaluation kind is percentage. + /// + /// + /// Represents the testing dataset split percentage. Only needed in case the + /// evaluation kind is percentage. + /// + /// Keeps track of any properties unknown to the library. + internal EvaluationOptions(EvaluationKind? kind, int? trainingSplitPercentage, int? testingSplitPercentage, IDictionary serializedAdditionalRawData) + { + Kind = kind; + TrainingSplitPercentage = trainingSplitPercentage; + TestingSplitPercentage = testingSplitPercentage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Represents the evaluation kind. By default, the evaluation kind is set to + /// percentage. + /// + public EvaluationKind? Kind { get; set; } + /// + /// Represents the training dataset split percentage. Only needed in case the + /// evaluation kind is percentage. + /// + public int? TrainingSplitPercentage { get; set; } + /// + /// Represents the testing dataset split percentage. Only needed in case the + /// evaluation kind is percentage. + /// + public int? TestingSplitPercentage { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..669067cb8aee5 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + [PersistableModelProxy(typeof(UnknownEvaluationSummary))] + public partial class EvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationSummary(document.RootElement, options); + } + + internal static EvaluationSummary DeserializeEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("projectKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "CustomEntityRecognition": return CustomEntityRecognitionEvaluationSummary.DeserializeCustomEntityRecognitionEvaluationSummary(element, options); + case "CustomHealthcare": return CustomHealthcareEvaluationSummary.DeserializeCustomHealthcareEvaluationSummary(element, options); + case "CustomMultiLabelClassification": return CustomMultiLabelClassificationEvaluationSummary.DeserializeCustomMultiLabelClassificationEvaluationSummary(element, options); + case "CustomSingleLabelClassification": return CustomSingleLabelClassificationEvaluationSummary.DeserializeCustomSingleLabelClassificationEvaluationSummary(element, options); + case "CustomTextSentiment": return CustomTextSentimentEvaluationSummary.DeserializeCustomTextSentimentEvaluationSummary(element, options); + } + } + return UnknownEvaluationSummary.DeserializeUnknownEvaluationSummary(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static EvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.cs new file mode 100644 index 0000000000000..1900d362c6867 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the summary for an evaluation operation. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public abstract partial class EvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the options used running the evaluation. + /// is null. + protected EvaluationSummary(EvaluationOptions evaluationOptions) + { + Argument.AssertNotNull(evaluationOptions, nameof(evaluationOptions)); + + EvaluationOptions = evaluationOptions; + } + + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + internal EvaluationSummary(ProjectKind projectKind, EvaluationOptions evaluationOptions, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + EvaluationOptions = evaluationOptions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationSummary() + { + } + + /// Represents the project type that the evaluation ran on. + internal ProjectKind ProjectKind { get; set; } + /// Represents the options used running the evaluation. + public EvaluationOptions EvaluationOptions { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.Serialization.cs new file mode 100644 index 0000000000000..6d9a80410a8c1 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedClass : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedClass)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedClass IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedClass)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedClass(document.RootElement, options); + } + + internal static ExportedClass DeserializeExportedClass(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedClass(category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedClass)} does not support writing '{options.Format}' format."); + } + } + + ExportedClass IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedClass(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedClass)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedClass FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedClass(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.cs new file mode 100644 index 0000000000000..b5ac5dcd7c98c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a class of an exported project. + public partial class ExportedClass + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedClass() + { + } + + /// Initializes a new instance of . + /// The class category. + /// Keeps track of any properties unknown to the library. + internal ExportedClass(string category, IDictionary serializedAdditionalRawData) + { + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The class category. + public string Category { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.Serialization.cs new file mode 100644 index 0000000000000..f793bb1bf4ed3 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCompositeEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCompositeEntity)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(CompositionSetting)) + { + writer.WritePropertyName("compositionSetting"u8); + writer.WriteStringValue(CompositionSetting.Value.ToString()); + } + if (Optional.IsDefined(List)) + { + writer.WritePropertyName("list"u8); + writer.WriteObjectValue(List, options); + } + if (Optional.IsCollectionDefined(Prebuilts)) + { + writer.WritePropertyName("prebuilts"u8); + writer.WriteStartArray(); + foreach (var item in Prebuilts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCompositeEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCompositeEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCompositeEntity(document.RootElement, options); + } + + internal static ExportedCompositeEntity DeserializeExportedCompositeEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CompositionSetting? compositionSetting = default; + ExportedEntityList list = default; + IList prebuilts = default; + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("compositionSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compositionSetting = new CompositionSetting(property.Value.GetString()); + continue; + } + if (property.NameEquals("list"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + list = ExportedEntityList.DeserializeExportedEntityList(property.Value, options); + continue; + } + if (property.NameEquals("prebuilts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedPrebuiltEntity.DeserializeExportedPrebuiltEntity(item, options)); + } + prebuilts = array; + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCompositeEntity(compositionSetting, list, prebuilts ?? new ChangeTrackingList(), category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCompositeEntity)} does not support writing '{options.Format}' format."); + } + } + + ExportedCompositeEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCompositeEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCompositeEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCompositeEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCompositeEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.cs new file mode 100644 index 0000000000000..9548fb9f666ab --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an entity in an exported project with composite entities enabled. + public partial class ExportedCompositeEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCompositeEntity() + { + Prebuilts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The behavior to follow when the entity's components overlap with each other. + /// The list component of the entity. + /// The prebuilt entities components. + /// The entity category. + /// Keeps track of any properties unknown to the library. + internal ExportedCompositeEntity(CompositionSetting? compositionSetting, ExportedEntityList list, IList prebuilts, string category, IDictionary serializedAdditionalRawData) + { + CompositionSetting = compositionSetting; + List = list; + Prebuilts = prebuilts; + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The behavior to follow when the entity's components overlap with each other. + public CompositionSetting? CompositionSetting { get; set; } + /// The list component of the entity. + public ExportedEntityList List { get; set; } + /// The prebuilt entities components. + public IList Prebuilts { get; } + /// The entity category. + public string Category { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs new file mode 100644 index 0000000000000..82f5a6112ab00 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomAbstractiveSummarizationDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationDocument)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("summaryLocation"u8); + writer.WriteStringValue(SummaryLocation); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomAbstractiveSummarizationDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomAbstractiveSummarizationDocument(document.RootElement, options); + } + + internal static ExportedCustomAbstractiveSummarizationDocument DeserializeExportedCustomAbstractiveSummarizationDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string summaryLocation = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("summaryLocation"u8)) + { + summaryLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomAbstractiveSummarizationDocument(summaryLocation, location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomAbstractiveSummarizationDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomAbstractiveSummarizationDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomAbstractiveSummarizationDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomAbstractiveSummarizationDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs new file mode 100644 index 0000000000000..2f7bd5c19aebf --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an exported document for a custom abstractive summarization project. + public partial class ExportedCustomAbstractiveSummarizationDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Represents the summary file location in the blob store container associated + /// with the project. + /// + /// is null. + public ExportedCustomAbstractiveSummarizationDocument(string summaryLocation) + { + Argument.AssertNotNull(summaryLocation, nameof(summaryLocation)); + + SummaryLocation = summaryLocation; + } + + /// Initializes a new instance of . + /// + /// Represents the summary file location in the blob store container associated + /// with the project. + /// + /// The location of the document in the storage. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomAbstractiveSummarizationDocument(string summaryLocation, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + SummaryLocation = summaryLocation; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedCustomAbstractiveSummarizationDocument() + { + } + + /// + /// Represents the summary file location in the blob store container associated + /// with the project. + /// + public string SummaryLocation { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs new file mode 100644 index 0000000000000..0dd8e2b0f7a7a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomAbstractiveSummarizationProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomAbstractiveSummarizationProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomAbstractiveSummarizationProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomAbstractiveSummarizationProjectAssets DeserializeExportedCustomAbstractiveSummarizationProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("documents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedCustomAbstractiveSummarizationDocument.DeserializeExportedCustomAbstractiveSummarizationDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomAbstractiveSummarizationProjectAssets(projectKind, serializedAdditionalRawData, documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomAbstractiveSummarizationProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomAbstractiveSummarizationProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomAbstractiveSummarizationProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomAbstractiveSummarizationProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomAbstractiveSummarizationProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs new file mode 100644 index 0000000000000..94db4391875b1 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the exported assets for an abstractive summarization project. + public partial class ExportedCustomAbstractiveSummarizationProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomAbstractiveSummarizationProjectAssets() + { + ProjectKind = ProjectKind.CustomAbstractiveSummarization; + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of documents belonging to this project. + internal ExportedCustomAbstractiveSummarizationProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Documents = documents; + } + + /// The list of documents belonging to this project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs new file mode 100644 index 0000000000000..97738e17333f6 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomEntityRecognitionDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionDocument)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomEntityRecognitionDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomEntityRecognitionDocument(document.RootElement, options); + } + + internal static ExportedCustomEntityRecognitionDocument DeserializeExportedCustomEntityRecognitionDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentEntityRegion.DeserializeExportedDocumentEntityRegion(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomEntityRecognitionDocument(entities ?? new ChangeTrackingList(), location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomEntityRecognitionDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomEntityRecognitionDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomEntityRecognitionDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomEntityRecognitionDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs new file mode 100644 index 0000000000000..0b07d3827f891 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an exported document for a custom entity recognition project. + public partial class ExportedCustomEntityRecognitionDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomEntityRecognitionDocument() + { + Entities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of entity labels belonging to the document. + /// The location of the document in the storage. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomEntityRecognitionDocument(IList entities, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + Entities = entities; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of entity labels belonging to the document. + public IList Entities { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs new file mode 100644 index 0000000000000..c9708fa50da4a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomEntityRecognitionProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomEntityRecognitionProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomEntityRecognitionProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomEntityRecognitionProjectAssets DeserializeExportedCustomEntityRecognitionProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntity.DeserializeExportedEntity(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("documents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedCustomEntityRecognitionDocument.DeserializeExportedCustomEntityRecognitionDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomEntityRecognitionProjectAssets(projectKind, serializedAdditionalRawData, entities ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomEntityRecognitionProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomEntityRecognitionProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomEntityRecognitionProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomEntityRecognitionProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomEntityRecognitionProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs new file mode 100644 index 0000000000000..e374015144a6a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the exported assets for a entity recognition project. + public partial class ExportedCustomEntityRecognitionProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomEntityRecognitionProjectAssets() + { + ProjectKind = ProjectKind.CustomEntityRecognition; + Entities = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of entities belonging to the project. + /// The list of documents belonging to the project. + internal ExportedCustomEntityRecognitionProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList entities, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Entities = entities; + Documents = documents; + } + + /// The list of entities belonging to the project. + public IList Entities { get; } + /// The list of documents belonging to the project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs new file mode 100644 index 0000000000000..1518a417483ab --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomHealthcareDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomHealthcareDocument)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomHealthcareDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomHealthcareDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomHealthcareDocument(document.RootElement, options); + } + + internal static ExportedCustomHealthcareDocument DeserializeExportedCustomHealthcareDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentEntityRegion.DeserializeExportedDocumentEntityRegion(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomHealthcareDocument(entities ?? new ChangeTrackingList(), location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomHealthcareDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomHealthcareDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomHealthcareDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomHealthcareDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomHealthcareDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomHealthcareDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.cs new file mode 100644 index 0000000000000..0f6f029aca885 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an exported document for a CustomHealthcare project. + public partial class ExportedCustomHealthcareDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomHealthcareDocument() + { + Entities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of entity labels belonging to the document. + /// The location of the document in the storage. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomHealthcareDocument(IList entities, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + Entities = entities; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of entity labels belonging to the document. + public IList Entities { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs new file mode 100644 index 0000000000000..faae9f08b885e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomHealthcareProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomHealthcareProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomHealthcareProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomHealthcareProjectAssets DeserializeExportedCustomHealthcareProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedCompositeEntity.DeserializeExportedCompositeEntity(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("documents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedCustomHealthcareDocument.DeserializeExportedCustomHealthcareDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomHealthcareProjectAssets(projectKind, serializedAdditionalRawData, entities ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomHealthcareProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomHealthcareProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomHealthcareProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomHealthcareProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomHealthcareProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs new file mode 100644 index 0000000000000..558a372cf49da --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the exported assets for a CustomHealthcare project. + public partial class ExportedCustomHealthcareProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomHealthcareProjectAssets() + { + ProjectKind = ProjectKind.CustomHealthcare; + Entities = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of entities belonging to the project. + /// The list of documents belonging to the project. + internal ExportedCustomHealthcareProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList entities, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Entities = entities; + Documents = documents; + } + + /// The list of entities belonging to the project. + public IList Entities { get; } + /// The list of documents belonging to the project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs new file mode 100644 index 0000000000000..c98f3a905701d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomMultiLabelClassificationDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationDocument)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Classes)) + { + writer.WritePropertyName("classes"u8); + writer.WriteStartArray(); + foreach (var item in Classes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomMultiLabelClassificationDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomMultiLabelClassificationDocument(document.RootElement, options); + } + + internal static ExportedCustomMultiLabelClassificationDocument DeserializeExportedCustomMultiLabelClassificationDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList classes = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("classes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentClass.DeserializeExportedDocumentClass(item, options)); + } + classes = array; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomMultiLabelClassificationDocument(classes ?? new ChangeTrackingList(), location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomMultiLabelClassificationDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomMultiLabelClassificationDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomMultiLabelClassificationDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomMultiLabelClassificationDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs new file mode 100644 index 0000000000000..91697ccd36d3c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an exported document of a custom multi-label classification project. + public partial class ExportedCustomMultiLabelClassificationDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomMultiLabelClassificationDocument() + { + Classes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The document classes. + /// The location of the document in the storage. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomMultiLabelClassificationDocument(IList classes, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + Classes = classes; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The document classes. + public IList Classes { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs new file mode 100644 index 0000000000000..aeeabf1b1d4f9 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomMultiLabelClassificationProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Classes)) + { + writer.WritePropertyName("classes"u8); + writer.WriteStartArray(); + foreach (var item in Classes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomMultiLabelClassificationProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomMultiLabelClassificationProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomMultiLabelClassificationProjectAssets DeserializeExportedCustomMultiLabelClassificationProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList classes = default; + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("classes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedClass.DeserializeExportedClass(item, options)); + } + classes = array; + continue; + } + if (property.NameEquals("documents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedCustomMultiLabelClassificationDocument.DeserializeExportedCustomMultiLabelClassificationDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomMultiLabelClassificationProjectAssets(projectKind, serializedAdditionalRawData, classes ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomMultiLabelClassificationProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomMultiLabelClassificationProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomMultiLabelClassificationProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomMultiLabelClassificationProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomMultiLabelClassificationProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs new file mode 100644 index 0000000000000..4bf1541e5841e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the exported assets for a custom multi-label classification project. + public partial class ExportedCustomMultiLabelClassificationProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomMultiLabelClassificationProjectAssets() + { + ProjectKind = ProjectKind.CustomMultiLabelClassification; + Classes = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of classes in the project. + /// The list of documents in the project. + internal ExportedCustomMultiLabelClassificationProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList classes, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Classes = classes; + Documents = documents; + } + + /// The list of classes in the project. + public IList Classes { get; } + /// The list of documents in the project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs new file mode 100644 index 0000000000000..6f872150618d8 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomSingleLabelClassificationDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationDocument)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Class)) + { + writer.WritePropertyName("class"u8); + writer.WriteObjectValue(Class, options); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomSingleLabelClassificationDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomSingleLabelClassificationDocument(document.RootElement, options); + } + + internal static ExportedCustomSingleLabelClassificationDocument DeserializeExportedCustomSingleLabelClassificationDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedDocumentClass @class = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("class"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @class = ExportedDocumentClass.DeserializeExportedDocumentClass(property.Value, options); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomSingleLabelClassificationDocument(@class, location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomSingleLabelClassificationDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomSingleLabelClassificationDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomSingleLabelClassificationDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomSingleLabelClassificationDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs new file mode 100644 index 0000000000000..2839a18a2bc3d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents an exported document for a custom single-label classification + /// project. + /// + public partial class ExportedCustomSingleLabelClassificationDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomSingleLabelClassificationDocument() + { + } + + /// Initializes a new instance of . + /// The class of the documents. + /// The location of the document in the storage. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomSingleLabelClassificationDocument(ExportedDocumentClass @class, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + Class = @class; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The class of the documents. + public ExportedDocumentClass Class { get; set; } + /// The location of the document in the storage. + public string Location { get; set; } + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs new file mode 100644 index 0000000000000..16e19bfc5dbfe --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomSingleLabelClassificationProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Classes)) + { + writer.WritePropertyName("classes"u8); + writer.WriteStartArray(); + foreach (var item in Classes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomSingleLabelClassificationProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomSingleLabelClassificationProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomSingleLabelClassificationProjectAssets DeserializeExportedCustomSingleLabelClassificationProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList classes = default; + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("classes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedClass.DeserializeExportedClass(item, options)); + } + classes = array; + continue; + } + if (property.NameEquals("documents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedCustomSingleLabelClassificationDocument.DeserializeExportedCustomSingleLabelClassificationDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomSingleLabelClassificationProjectAssets(projectKind, serializedAdditionalRawData, classes ?? new ChangeTrackingList(), documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomSingleLabelClassificationProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomSingleLabelClassificationProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomSingleLabelClassificationProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomSingleLabelClassificationProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomSingleLabelClassificationProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs new file mode 100644 index 0000000000000..292673a3fdd82 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the exported assets for a single-label classification project. + public partial class ExportedCustomSingleLabelClassificationProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomSingleLabelClassificationProjectAssets() + { + ProjectKind = ProjectKind.CustomSingleLabelClassification; + Classes = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of classes belonging to this project. + /// The list of documents belonging to this project. + internal ExportedCustomSingleLabelClassificationProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList classes, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Classes = classes; + Documents = documents; + } + + /// The list of classes belonging to this project. + public IList Classes { get; } + /// The list of documents belonging to this project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs new file mode 100644 index 0000000000000..33e3cc4f4be3a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomTextSentimentDocument : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentDocument)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(SentimentSpans)) + { + writer.WritePropertyName("sentimentSpans"u8); + writer.WriteStartArray(); + foreach (var item in SentimentSpans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(Dataset)) + { + writer.WritePropertyName("dataset"u8); + writer.WriteStringValue(Dataset); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomTextSentimentDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentDocument)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomTextSentimentDocument(document.RootElement, options); + } + + internal static ExportedCustomTextSentimentDocument DeserializeExportedCustomTextSentimentDocument(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList sentimentSpans = default; + string location = default; + string language = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sentimentSpans"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentSentimentLabel.DeserializeExportedDocumentSentimentLabel(item, options)); + } + sentimentSpans = array; + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataset"u8)) + { + dataset = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomTextSentimentDocument(sentimentSpans ?? new ChangeTrackingList(), location, language, dataset, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentDocument)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomTextSentimentDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomTextSentimentDocument(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentDocument)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedCustomTextSentimentDocument FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomTextSentimentDocument(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.cs new file mode 100644 index 0000000000000..62638b13ae872 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an exported document for a custom text sentiment project. + public partial class ExportedCustomTextSentimentDocument + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedCustomTextSentimentDocument() + { + SentimentSpans = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The location of the document in the storage. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ExportedCustomTextSentimentDocument(IList sentimentSpans, string location, string language, string dataset, IDictionary serializedAdditionalRawData) + { + SentimentSpans = sentimentSpans; + Location = location; + Language = language; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the sentiment spans. + public IList SentimentSpans { get; } + /// The location of the document in the storage. + public string Location { get; set; } + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + public string Language { get; set; } + /// The dataset for this document. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs new file mode 100644 index 0000000000000..35f59b6c22b99 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedCustomTextSentimentProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedCustomTextSentimentProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedCustomTextSentimentProjectAssets(document.RootElement, options); + } + + internal static ExportedCustomTextSentimentProjectAssets DeserializeExportedCustomTextSentimentProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList documents = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("documents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedCustomTextSentimentDocument.DeserializeExportedCustomTextSentimentDocument(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedCustomTextSentimentProjectAssets(projectKind, serializedAdditionalRawData, documents ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedCustomTextSentimentProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedCustomTextSentimentProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedCustomTextSentimentProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ExportedCustomTextSentimentProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedCustomTextSentimentProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs new file mode 100644 index 0000000000000..312ce18a63a8d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the exported assets for a custom text sentiment project. + public partial class ExportedCustomTextSentimentProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ExportedCustomTextSentimentProjectAssets() + { + ProjectKind = ProjectKind.CustomTextSentiment; + Documents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The list of documents belonging to the project. + internal ExportedCustomTextSentimentProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList documents) : base(projectKind, serializedAdditionalRawData) + { + Documents = documents; + } + + /// The list of documents belonging to the project. + public IList Documents { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.Serialization.cs new file mode 100644 index 0000000000000..ba9f4df9f3b77 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedDocumentClass : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentClass)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedDocumentClass IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentClass)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedDocumentClass(document.RootElement, options); + } + + internal static ExportedDocumentClass DeserializeExportedDocumentClass(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedDocumentClass(category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedDocumentClass)} does not support writing '{options.Format}' format."); + } + } + + ExportedDocumentClass IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedDocumentClass(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedDocumentClass)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedDocumentClass FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedDocumentClass(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.cs new file mode 100644 index 0000000000000..c3bc4ccbcc9bb --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a classification label for a document. + public partial class ExportedDocumentClass + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedDocumentClass() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ExportedDocumentClass(string category, IDictionary serializedAdditionalRawData) + { + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the category. + public string Category { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs new file mode 100644 index 0000000000000..842be257eab92 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedDocumentEntityLabel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentEntityLabel)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (Optional.IsDefined(Offset)) + { + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset.Value); + } + if (Optional.IsDefined(Length)) + { + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedDocumentEntityLabel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentEntityLabel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedDocumentEntityLabel(document.RootElement, options); + } + + internal static ExportedDocumentEntityLabel DeserializeExportedDocumentEntityLabel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + int? offset = default; + int? length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("offset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedDocumentEntityLabel(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedDocumentEntityLabel)} does not support writing '{options.Format}' format."); + } + } + + ExportedDocumentEntityLabel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedDocumentEntityLabel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedDocumentEntityLabel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedDocumentEntityLabel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedDocumentEntityLabel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.cs new file mode 100644 index 0000000000000..42d863a62eecf --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an entity label for a document. + public partial class ExportedDocumentEntityLabel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedDocumentEntityLabel() + { + } + + /// Initializes a new instance of . + /// The entity category. + /// Start position for the entity text. + /// Length for the entity text. + /// Keeps track of any properties unknown to the library. + internal ExportedDocumentEntityLabel(string category, int? offset, int? length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The entity category. + public string Category { get; set; } + /// Start position for the entity text. + public int? Offset { get; set; } + /// Length for the entity text. + public int? Length { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs new file mode 100644 index 0000000000000..35d6e3ca38239 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedDocumentEntityRegion : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentEntityRegion)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(RegionOffset)) + { + writer.WritePropertyName("regionOffset"u8); + writer.WriteNumberValue(RegionOffset.Value); + } + if (Optional.IsDefined(RegionLength)) + { + writer.WritePropertyName("regionLength"u8); + writer.WriteNumberValue(RegionLength.Value); + } + if (Optional.IsCollectionDefined(Labels)) + { + writer.WritePropertyName("labels"u8); + writer.WriteStartArray(); + foreach (var item in Labels) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedDocumentEntityRegion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentEntityRegion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedDocumentEntityRegion(document.RootElement, options); + } + + internal static ExportedDocumentEntityRegion DeserializeExportedDocumentEntityRegion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? regionOffset = default; + int? regionLength = default; + IList labels = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("regionOffset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regionOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("regionLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regionLength = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedDocumentEntityLabel.DeserializeExportedDocumentEntityLabel(item, options)); + } + labels = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedDocumentEntityRegion(regionOffset, regionLength, labels ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedDocumentEntityRegion)} does not support writing '{options.Format}' format."); + } + } + + ExportedDocumentEntityRegion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedDocumentEntityRegion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedDocumentEntityRegion)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedDocumentEntityRegion FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedDocumentEntityRegion(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.cs new file mode 100644 index 0000000000000..ed879a5da600a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a region in a document for entity labeling. + public partial class ExportedDocumentEntityRegion + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedDocumentEntityRegion() + { + Labels = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Start position for the region. + /// Length for the region text. + /// The list of entity labels belonging to this region. + /// Keeps track of any properties unknown to the library. + internal ExportedDocumentEntityRegion(int? regionOffset, int? regionLength, IList labels, IDictionary serializedAdditionalRawData) + { + RegionOffset = regionOffset; + RegionLength = regionLength; + Labels = labels; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Start position for the region. + public int? RegionOffset { get; set; } + /// Length for the region text. + public int? RegionLength { get; set; } + /// The list of entity labels belonging to this region. + public IList Labels { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs new file mode 100644 index 0000000000000..147aadbaab12b --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedDocumentSentimentLabel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentSentimentLabel)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (Optional.IsDefined(Offset)) + { + writer.WritePropertyName("offset"u8); + writer.WriteNumberValue(Offset.Value); + } + if (Optional.IsDefined(Length)) + { + writer.WritePropertyName("length"u8); + writer.WriteNumberValue(Length.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedDocumentSentimentLabel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedDocumentSentimentLabel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedDocumentSentimentLabel(document.RootElement, options); + } + + internal static ExportedDocumentSentimentLabel DeserializeExportedDocumentSentimentLabel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Sentiment? category = default; + int? offset = default; + int? length = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new Sentiment(property.Value.GetString()); + continue; + } + if (property.NameEquals("offset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("length"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + length = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedDocumentSentimentLabel(category, offset, length, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedDocumentSentimentLabel)} does not support writing '{options.Format}' format."); + } + } + + ExportedDocumentSentimentLabel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedDocumentSentimentLabel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedDocumentSentimentLabel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedDocumentSentimentLabel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedDocumentSentimentLabel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.cs new file mode 100644 index 0000000000000..17a8018858734 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an entity label for a document. + public partial class ExportedDocumentSentimentLabel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedDocumentSentimentLabel() + { + } + + /// Initializes a new instance of . + /// The sentiment category. + /// Start position for the sentiment text. + /// Length for the sentiment text. + /// Keeps track of any properties unknown to the library. + internal ExportedDocumentSentimentLabel(Sentiment? category, int? offset, int? length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The sentiment category. + public Sentiment? Category { get; set; } + /// Start position for the sentiment text. + public int? Offset { get; set; } + /// Length for the sentiment text. + public int? Length { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.Serialization.cs new file mode 100644 index 0000000000000..f5b8448bbf044 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntity)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntity(document.RootElement, options); + } + + internal static ExportedEntity DeserializeExportedEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntity(category, description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntity)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.cs new file mode 100644 index 0000000000000..0490de69bb79c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an entity in an exported project. + public partial class ExportedEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntity() + { + } + + /// Initializes a new instance of . + /// The entity category. + /// Short description for entity category. Required when enabling synthetic data generation. + /// Keeps track of any properties unknown to the library. + internal ExportedEntity(string category, string description, IDictionary serializedAdditionalRawData) + { + Category = category; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The entity category. + public string Category { get; set; } + /// Short description for entity category. Required when enabling synthetic data generation. + public string Description { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.Serialization.cs new file mode 100644 index 0000000000000..b320b2c157d3d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedEntityList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Sublists)) + { + writer.WritePropertyName("sublists"u8); + writer.WriteStartArray(); + foreach (var item in Sublists) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedEntityList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityList(document.RootElement, options); + } + + internal static ExportedEntityList DeserializeExportedEntityList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList sublists = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sublists"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntitySublist.DeserializeExportedEntitySublist(item, options)); + } + sublists = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityList(sublists ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntityList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntityList FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityList(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.cs new file mode 100644 index 0000000000000..bd045aa06efef --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a list component of an entity. + public partial class ExportedEntityList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntityList() + { + Sublists = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The sub-lists of the list component. + /// Keeps track of any properties unknown to the library. + internal ExportedEntityList(IList sublists, IDictionary serializedAdditionalRawData) + { + Sublists = sublists; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The sub-lists of the list component. + public IList Sublists { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs new file mode 100644 index 0000000000000..fc320ed32d5e0 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedEntityListSynonym : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsCollectionDefined(Values)) + { + writer.WritePropertyName("values"u8); + writer.WriteStartArray(); + foreach (var item in Values) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedEntityListSynonym IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityListSynonym(document.RootElement, options); + } + + internal static ExportedEntityListSynonym DeserializeExportedEntityListSynonym(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string language = default; + IList values = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + values = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityListSynonym(language, values ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityListSynonym IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntityListSynonym(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityListSynonym)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntityListSynonym FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityListSynonym(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.cs new file mode 100644 index 0000000000000..113b9389092e6 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a list of synonyms inside a list component. + public partial class ExportedEntityListSynonym + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntityListSynonym() + { + Values = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Represents the language of the synonyms. This is BCP-47 representation of a + /// language. For example, use "en" for English, "en-gb" for English (UK), "es" for + /// Spanish etc. + /// + /// The list of synonyms. + /// Keeps track of any properties unknown to the library. + internal ExportedEntityListSynonym(string language, IList values, IDictionary serializedAdditionalRawData) + { + Language = language; + Values = values; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Represents the language of the synonyms. This is BCP-47 representation of a + /// language. For example, use "en" for English, "en-gb" for English (UK), "es" for + /// Spanish etc. + /// + public string Language { get; set; } + /// The list of synonyms. + public IList Values { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.Serialization.cs new file mode 100644 index 0000000000000..5d047b121e924 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedEntitySublist : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ListKey)) + { + writer.WritePropertyName("listKey"u8); + writer.WriteStringValue(ListKey); + } + if (Optional.IsCollectionDefined(Synonyms)) + { + writer.WritePropertyName("synonyms"u8); + writer.WriteStartArray(); + foreach (var item in Synonyms) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedEntitySublist IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntitySublist(document.RootElement, options); + } + + internal static ExportedEntitySublist DeserializeExportedEntitySublist(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string listKey = default; + IList synonyms = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("listKey"u8)) + { + listKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("synonyms"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntityListSynonym.DeserializeExportedEntityListSynonym(item, options)); + } + synonyms = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntitySublist(listKey, synonyms ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntitySublist IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedEntitySublist(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntitySublist)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedEntitySublist FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntitySublist(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.cs new file mode 100644 index 0000000000000..7b2698d2f8abe --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a sub-list inside a list component. + public partial class ExportedEntitySublist + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ExportedEntitySublist() + { + Synonyms = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The key of the sub-list. + /// The phrases of that correspond to the sub-list. + /// Keeps track of any properties unknown to the library. + internal ExportedEntitySublist(string listKey, IList synonyms, IDictionary serializedAdditionalRawData) + { + ListKey = listKey; + Synonyms = synonyms; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The key of the sub-list. + public string ListKey { get; set; } + /// The phrases of that correspond to the sub-list. + public IList Synonyms { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.Serialization.cs new file mode 100644 index 0000000000000..ec7dd042b0937 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedModelManifest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelManifest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelFiles"u8); + writer.WriteStartArray(); + foreach (var item in ModelFiles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedModelManifest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelManifest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedModelManifest(document.RootElement, options); + } + + internal static ExportedModelManifest DeserializeExportedModelManifest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList modelFiles = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelFiles"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ModelFile.DeserializeModelFile(item, options)); + } + modelFiles = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedModelManifest(modelFiles, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedModelManifest)} does not support writing '{options.Format}' format."); + } + } + + ExportedModelManifest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedModelManifest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedModelManifest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedModelManifest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedModelManifest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.cs new file mode 100644 index 0000000000000..06586a003896c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the properties for the exported model manifest. + public partial class ExportedModelManifest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The model files belonging to this model. + /// is null. + internal ExportedModelManifest(IEnumerable modelFiles) + { + Argument.AssertNotNull(modelFiles, nameof(modelFiles)); + + ModelFiles = modelFiles.ToList(); + } + + /// Initializes a new instance of . + /// The model files belonging to this model. + /// Keeps track of any properties unknown to the library. + internal ExportedModelManifest(IReadOnlyList modelFiles, IDictionary serializedAdditionalRawData) + { + ModelFiles = modelFiles; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedModelManifest() + { + } + + /// The model files belonging to this model. + public IReadOnlyList ModelFiles { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelOptions.Serialization.cs new file mode 100644 index 0000000000000..a8942b70206a6 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelOptions.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedModelOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("trainedModelLabel"u8); + writer.WriteStringValue(TrainedModelLabel); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedModelOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedModelOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedModelOptions(document.RootElement, options); + } + + internal static ExportedModelOptions DeserializeExportedModelOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string trainedModelLabel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("trainedModelLabel"u8)) + { + trainedModelLabel = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedModelOptions(trainedModelLabel, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedModelOptions)} does not support writing '{options.Format}' format."); + } + } + + ExportedModelOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedModelOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedModelOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedModelOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedModelOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelOptions.cs new file mode 100644 index 0000000000000..bebe7dbc233e8 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelOptions.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the options for creating or replacing an exported model. + public partial class ExportedModelOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The trained model label. + /// is null. + public ExportedModelOptions(string trainedModelLabel) + { + Argument.AssertNotNull(trainedModelLabel, nameof(trainedModelLabel)); + + TrainedModelLabel = trainedModelLabel; + } + + /// Initializes a new instance of . + /// The trained model label. + /// Keeps track of any properties unknown to the library. + internal ExportedModelOptions(string trainedModelLabel, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedModelOptions() + { + } + + /// The trained model label. + public string TrainedModelLabel { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs new file mode 100644 index 0000000000000..bbe662803b491 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedPrebuiltEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedPrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedPrebuiltEntity(document.RootElement, options); + } + + internal static ExportedPrebuiltEntity DeserializeExportedPrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedPrebuiltEntity(category, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support writing '{options.Format}' format."); + } + } + + ExportedPrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedPrebuiltEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedPrebuiltEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedPrebuiltEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedPrebuiltEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.cs new file mode 100644 index 0000000000000..40beb0111e4dc --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an exported prebuilt entity component. + public partial class ExportedPrebuiltEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// is null. + public ExportedPrebuiltEntity(string category) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + } + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// Keeps track of any properties unknown to the library. + internal ExportedPrebuiltEntity(string category, IDictionary serializedAdditionalRawData) + { + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedPrebuiltEntity() + { + } + + /// The prebuilt entity category. + public string Category { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.Serialization.cs new file mode 100644 index 0000000000000..a56ecb70cde71 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedProject : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProject)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectFileVersion"u8); + writer.WriteStringValue(ProjectFileVersion); + writer.WritePropertyName("stringIndexType"u8); + writer.WriteStringValue(StringIndexType.ToString()); + writer.WritePropertyName("metadata"u8); + writer.WriteObjectValue(Metadata, options); + if (Optional.IsDefined(Assets)) + { + writer.WritePropertyName("assets"u8); + writer.WriteObjectValue(Assets, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedProject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProject)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedProject(document.RootElement, options); + } + + internal static ExportedProject DeserializeExportedProject(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectFileVersion = default; + StringIndexType stringIndexType = default; + CreateProjectOptions metadata = default; + ExportedProjectAssets assets = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectFileVersion"u8)) + { + projectFileVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("stringIndexType"u8)) + { + stringIndexType = new StringIndexType(property.Value.GetString()); + continue; + } + if (property.NameEquals("metadata"u8)) + { + metadata = CreateProjectOptions.DeserializeCreateProjectOptions(property.Value, options); + continue; + } + if (property.NameEquals("assets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assets = ExportedProjectAssets.DeserializeExportedProjectAssets(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedProject)} does not support writing '{options.Format}' format."); + } + } + + ExportedProject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedProject(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedProject)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedProject FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedProject(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.cs new file mode 100644 index 0000000000000..164928a2e2fdd --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an exported project. + public partial class ExportedProject + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The version of the exported file. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. + /// + /// Represents the project metadata. + /// or is null. + public ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectOptions metadata) + { + Argument.AssertNotNull(projectFileVersion, nameof(projectFileVersion)); + Argument.AssertNotNull(metadata, nameof(metadata)); + + ProjectFileVersion = projectFileVersion; + StringIndexType = stringIndexType; + Metadata = metadata; + } + + /// Initializes a new instance of . + /// The version of the exported file. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. + /// + /// Represents the project metadata. + /// + /// Represents the project assets. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// Keeps track of any properties unknown to the library. + internal ExportedProject(string projectFileVersion, StringIndexType stringIndexType, CreateProjectOptions metadata, ExportedProjectAssets assets, IDictionary serializedAdditionalRawData) + { + ProjectFileVersion = projectFileVersion; + StringIndexType = stringIndexType; + Metadata = metadata; + Assets = assets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedProject() + { + } + + /// The version of the exported file. + public string ProjectFileVersion { get; } + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. + /// + public StringIndexType StringIndexType { get; } + /// Represents the project metadata. + public CreateProjectOptions Metadata { get; } + /// + /// Represents the project assets. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + public ExportedProjectAssets Assets { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.Serialization.cs new file mode 100644 index 0000000000000..13c7f9f235711 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.Serialization.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + [PersistableModelProxy(typeof(UnknownExportedProjectAssets))] + public partial class ExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + + internal static ExportedProjectAssets DeserializeExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("projectKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "CustomAbstractiveSummarization": return ExportedCustomAbstractiveSummarizationProjectAssets.DeserializeExportedCustomAbstractiveSummarizationProjectAssets(element, options); + case "CustomEntityRecognition": return ExportedCustomEntityRecognitionProjectAssets.DeserializeExportedCustomEntityRecognitionProjectAssets(element, options); + case "CustomHealthcare": return ExportedCustomHealthcareProjectAssets.DeserializeExportedCustomHealthcareProjectAssets(element, options); + case "CustomMultiLabelClassification": return ExportedCustomMultiLabelClassificationProjectAssets.DeserializeExportedCustomMultiLabelClassificationProjectAssets(element, options); + case "CustomSingleLabelClassification": return ExportedCustomSingleLabelClassificationProjectAssets.DeserializeExportedCustomSingleLabelClassificationProjectAssets(element, options); + case "CustomTextSentiment": return ExportedCustomTextSentimentProjectAssets.DeserializeExportedCustomTextSentimentProjectAssets(element, options); + } + } + return UnknownExportedProjectAssets.DeserializeUnknownExportedProjectAssets(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedProjectAssets(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.cs new file mode 100644 index 0000000000000..f6707552d9b71 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the assets of an exported project. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + public abstract partial class ExportedProjectAssets + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected ExportedProjectAssets() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the project kind. + internal ProjectKind ProjectKind { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.Serialization.cs new file mode 100644 index 0000000000000..c97af0e62dad4 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ExportedTrainedModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("exportedModelName"u8); + writer.WriteStringValue(ExportedModelName); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastExportedModelDateTime"u8); + writer.WriteStringValue(LastExportedModelDateTime, "O"); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedTrainedModel(document.RootElement, options); + } + + internal static ExportedTrainedModel DeserializeExportedTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string exportedModelName = default; + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + DateTimeOffset lastExportedModelDateTime = default; + DateTimeOffset modelExpirationDate = default; + string modelTrainingConfigVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exportedModelName"u8)) + { + exportedModelName = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastExportedModelDateTime"u8)) + { + lastExportedModelDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedTrainedModel( + exportedModelName, + modelId, + lastTrainedDateTime, + lastExportedModelDateTime, + modelExpirationDate, + modelTrainingConfigVersion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support writing '{options.Format}' format."); + } + } + + ExportedTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedTrainedModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedTrainedModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ExportedTrainedModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedTrainedModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.cs new file mode 100644 index 0000000000000..a515dad66e53f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents an exported trained model. + public partial class ExportedTrainedModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The exported model name. + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// , or is null. + internal ExportedTrainedModel(string exportedModelName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion) + { + Argument.AssertNotNull(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + + ExportedModelName = exportedModelName; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastExportedModelDateTime = lastExportedModelDateTime; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + } + + /// Initializes a new instance of . + /// The exported model name. + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// Keeps track of any properties unknown to the library. + internal ExportedTrainedModel(string exportedModelName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, IDictionary serializedAdditionalRawData) + { + ExportedModelName = exportedModelName; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastExportedModelDateTime = lastExportedModelDateTime; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedTrainedModel() + { + } + + /// The exported model name. + public string ExportedModelName { get; } + /// The model ID. + public string ModelId { get; } + /// The last trained date time of the model. + public DateTimeOffset LastTrainedDateTime { get; } + /// The last exported date time of the model. + public DateTimeOffset LastExportedModelDateTime { get; } + /// The model expiration date. + public DateTimeOffset ModelExpirationDate { get; } + /// The model training config version. + public string ModelTrainingConfigVersion { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..aed93175c4177 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetAssignDeploymentResourcesStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetAssignDeploymentResourcesStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetAssignDeploymentResourcesStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetAssignDeploymentResourcesStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetAssignDeploymentResourcesStatusResponse(document.RootElement, options); + } + + internal static GetAssignDeploymentResourcesStatusResponse DeserializeGetAssignDeploymentResourcesStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetAssignDeploymentResourcesStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetAssignDeploymentResourcesStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetAssignDeploymentResourcesStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetAssignDeploymentResourcesStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetAssignDeploymentResourcesStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetAssignDeploymentResourcesStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetAssignDeploymentResourcesStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs new file mode 100644 index 0000000000000..9f909959d7db0 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetAssignDeploymentResourcesStatusResponse. + public partial class GetAssignDeploymentResourcesStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetAssignDeploymentResourcesStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetAssignDeploymentResourcesStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetAssignDeploymentResourcesStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..0a59e72798a41 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetCopyProjectStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetCopyProjectStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetCopyProjectStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetCopyProjectStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetCopyProjectStatusResponse(document.RootElement, options); + } + + internal static GetCopyProjectStatusResponse DeserializeGetCopyProjectStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetCopyProjectStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetCopyProjectStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetCopyProjectStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetCopyProjectStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetCopyProjectStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetCopyProjectStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetCopyProjectStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.cs new file mode 100644 index 0000000000000..32c9d2e6d5abf --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetCopyProjectStatusResponse. + public partial class GetCopyProjectStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetCopyProjectStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetCopyProjectStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetCopyProjectStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..ed146023de878 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetDeploymentDeleteFromResourcesStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetDeploymentDeleteFromResourcesStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetDeploymentDeleteFromResourcesStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetDeploymentDeleteFromResourcesStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetDeploymentDeleteFromResourcesStatusResponse(document.RootElement, options); + } + + internal static GetDeploymentDeleteFromResourcesStatusResponse DeserializeGetDeploymentDeleteFromResourcesStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetDeploymentDeleteFromResourcesStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetDeploymentDeleteFromResourcesStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetDeploymentDeleteFromResourcesStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetDeploymentDeleteFromResourcesStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetDeploymentDeleteFromResourcesStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetDeploymentDeleteFromResourcesStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetDeploymentDeleteFromResourcesStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs new file mode 100644 index 0000000000000..75c508ee48a8a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetDeploymentDeleteFromResourcesStatusResponse. + public partial class GetDeploymentDeleteFromResourcesStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetDeploymentDeleteFromResourcesStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetDeploymentDeleteFromResourcesStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetDeploymentDeleteFromResourcesStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.Serialization.cs new file mode 100644 index 0000000000000..63495fd15d9f0 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetDeploymentResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetDeploymentResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WritePropertyName("deploymentExpirationDate"u8); + writer.WriteStringValue(DeploymentExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + writer.WritePropertyName("assignedResources"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetDeploymentResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetDeploymentResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetDeploymentResponse(document.RootElement, options); + } + + internal static GetDeploymentResponse DeserializeGetDeploymentResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + DateTimeOffset lastDeployedDateTime = default; + DateTimeOffset deploymentExpirationDate = default; + string modelTrainingConfigVersion = default; + IReadOnlyList assignedResources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("deploymentExpirationDate"u8)) + { + deploymentExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("assignedResources"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeploymentResource.DeserializeDeploymentResource(item, options)); + } + assignedResources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetDeploymentResponse( + modelId, + lastTrainedDateTime, + lastDeployedDateTime, + deploymentExpirationDate, + modelTrainingConfigVersion, + assignedResources, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetDeploymentResponse)} does not support writing '{options.Format}' format."); + } + } + + GetDeploymentResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetDeploymentResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetDeploymentResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetDeploymentResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetDeploymentResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.cs new file mode 100644 index 0000000000000..ee7bd46220347 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetDeploymentResponse. + public partial class GetDeploymentResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// , or is null. + internal GetDeploymentResponse(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IEnumerable assignedResources) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + Argument.AssertNotNull(assignedResources, nameof(assignedResources)); + + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + AssignedResources = assignedResources.ToList(); + } + + /// Initializes a new instance of . + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// Keeps track of any properties unknown to the library. + internal GetDeploymentResponse(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IReadOnlyList assignedResources, IDictionary serializedAdditionalRawData) + { + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + AssignedResources = assignedResources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetDeploymentResponse() + { + } + + /// Represents deployment modelId. + public string ModelId { get; } + /// Represents deployment last trained time. + public DateTimeOffset LastTrainedDateTime { get; } + /// Represents deployment last deployed time. + public DateTimeOffset LastDeployedDateTime { get; } + /// Represents deployment expiration date in the runtime. + public DateTimeOffset DeploymentExpirationDate { get; } + /// Represents model training config version. + public string ModelTrainingConfigVersion { get; } + /// Represents the metadata of the assigned Azure resources. + public IReadOnlyList AssignedResources { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..6917f344a875b --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetDeploymentStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetDeploymentStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetDeploymentStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetDeploymentStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetDeploymentStatusResponse(document.RootElement, options); + } + + internal static GetDeploymentStatusResponse DeserializeGetDeploymentStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetDeploymentStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetDeploymentStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetDeploymentStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetDeploymentStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetDeploymentStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetDeploymentStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetDeploymentStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.cs new file mode 100644 index 0000000000000..15dd5909147d8 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetDeploymentStatusResponse. + public partial class GetDeploymentStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetDeploymentStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetDeploymentStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetDeploymentStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..fc505e74c7842 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetEvaluationStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetEvaluationStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetEvaluationStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetEvaluationStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetEvaluationStatusResponse(document.RootElement, options); + } + + internal static GetEvaluationStatusResponse DeserializeGetEvaluationStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + EvaluationJobResult result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("result"u8)) + { + result = EvaluationJobResult.DeserializeEvaluationJobResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetEvaluationStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + result, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetEvaluationStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetEvaluationStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetEvaluationStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetEvaluationStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetEvaluationStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetEvaluationStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.cs new file mode 100644 index 0000000000000..7531ac3128a6c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetEvaluationStatusResponse. + public partial class GetEvaluationStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + /// Represents evaluation task detailed result. + /// is null. + internal GetEvaluationStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, EvaluationJobResult result) + { + Argument.AssertNotNull(result, nameof(result)); + + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + Result = result; + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents evaluation task detailed result. + /// Keeps track of any properties unknown to the library. + internal GetEvaluationStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, EvaluationJobResult result, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetEvaluationStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// Represents evaluation task detailed result. + public EvaluationJobResult Result { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..a6684390502de --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.Serialization.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetExportStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetExportStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ResultUrl)) + { + writer.WritePropertyName("resultUrl"u8); + writer.WriteStringValue(ResultUrl); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetExportStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetExportStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetExportStatusResponse(document.RootElement, options); + } + + internal static GetExportStatusResponse DeserializeGetExportStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + string resultUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("resultUrl"u8)) + { + resultUrl = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetExportStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + resultUrl, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetExportStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetExportStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetExportStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetExportStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetExportStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetExportStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.cs new file mode 100644 index 0000000000000..5719a898b58f5 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetExportStatusResponse. + public partial class GetExportStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetExportStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// The URL to use in order to download the exported project. + /// Keeps track of any properties unknown to the library. + internal GetExportStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, string resultUrl, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + ResultUrl = resultUrl; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetExportStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// The URL to use in order to download the exported project. + public string ResultUrl { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..94e825dc23e62 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetExportedModelJobStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetExportedModelJobStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetExportedModelJobStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetExportedModelJobStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetExportedModelJobStatusResponse(document.RootElement, options); + } + + internal static GetExportedModelJobStatusResponse DeserializeGetExportedModelJobStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetExportedModelJobStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetExportedModelJobStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetExportedModelJobStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetExportedModelJobStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetExportedModelJobStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetExportedModelJobStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetExportedModelJobStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.cs new file mode 100644 index 0000000000000..0d20a90597baa --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetExportedModelJobStatusResponse. + public partial class GetExportedModelJobStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetExportedModelJobStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetExportedModelJobStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetExportedModelJobStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.Serialization.cs new file mode 100644 index 0000000000000..ec49deb50db72 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetExportedModelResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetExportedModelResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastExportedModelDateTime"u8); + writer.WriteStringValue(LastExportedModelDateTime, "O"); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetExportedModelResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetExportedModelResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetExportedModelResponse(document.RootElement, options); + } + + internal static GetExportedModelResponse DeserializeGetExportedModelResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + DateTimeOffset lastExportedModelDateTime = default; + DateTimeOffset modelExpirationDate = default; + string modelTrainingConfigVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastExportedModelDateTime"u8)) + { + lastExportedModelDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetExportedModelResponse( + modelId, + lastTrainedDateTime, + lastExportedModelDateTime, + modelExpirationDate, + modelTrainingConfigVersion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetExportedModelResponse)} does not support writing '{options.Format}' format."); + } + } + + GetExportedModelResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetExportedModelResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetExportedModelResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetExportedModelResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetExportedModelResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.cs new file mode 100644 index 0000000000000..a20988d77a803 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetExportedModelResponse. + public partial class GetExportedModelResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// or is null. + internal GetExportedModelResponse(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastExportedModelDateTime = lastExportedModelDateTime; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + } + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The last exported date time of the model. + /// The model expiration date. + /// The model training config version. + /// Keeps track of any properties unknown to the library. + internal GetExportedModelResponse(string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastExportedModelDateTime, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, IDictionary serializedAdditionalRawData) + { + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastExportedModelDateTime = lastExportedModelDateTime; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetExportedModelResponse() + { + } + + /// The model ID. + public string ModelId { get; } + /// The last trained date time of the model. + public DateTimeOffset LastTrainedDateTime { get; } + /// The last exported date time of the model. + public DateTimeOffset LastExportedModelDateTime { get; } + /// The model expiration date. + public DateTimeOffset ModelExpirationDate { get; } + /// The model training config version. + public string ModelTrainingConfigVersion { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..05acbe76c3606 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetImportStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetImportStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetImportStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetImportStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetImportStatusResponse(document.RootElement, options); + } + + internal static GetImportStatusResponse DeserializeGetImportStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetImportStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetImportStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetImportStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetImportStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetImportStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetImportStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetImportStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.cs new file mode 100644 index 0000000000000..7345e0939a18e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetImportStatusResponse. + public partial class GetImportStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetImportStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetImportStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetImportStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..bbb98a9705605 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetLoadSnapshotStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetLoadSnapshotStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetLoadSnapshotStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetLoadSnapshotStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetLoadSnapshotStatusResponse(document.RootElement, options); + } + + internal static GetLoadSnapshotStatusResponse DeserializeGetLoadSnapshotStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetLoadSnapshotStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetLoadSnapshotStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetLoadSnapshotStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetLoadSnapshotStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetLoadSnapshotStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetLoadSnapshotStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetLoadSnapshotStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.cs new file mode 100644 index 0000000000000..1f4fac9c69d7f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetLoadSnapshotStatusResponse. + public partial class GetLoadSnapshotStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetLoadSnapshotStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetLoadSnapshotStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetLoadSnapshotStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..2fccee83f0b58 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetProjectDeletionStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetProjectDeletionStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetProjectDeletionStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetProjectDeletionStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetProjectDeletionStatusResponse(document.RootElement, options); + } + + internal static GetProjectDeletionStatusResponse DeserializeGetProjectDeletionStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetProjectDeletionStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetProjectDeletionStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetProjectDeletionStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetProjectDeletionStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetProjectDeletionStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetProjectDeletionStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetProjectDeletionStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.cs new file mode 100644 index 0000000000000..d74525919edbd --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetProjectDeletionStatusResponse. + public partial class GetProjectDeletionStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetProjectDeletionStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetProjectDeletionStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetProjectDeletionStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.Serialization.cs new file mode 100644 index 0000000000000..6460122155382 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.Serialization.cs @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetProjectResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetProjectResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastModifiedDateTime"u8); + writer.WriteStringValue(LastModifiedDateTime, "O"); + if (Optional.IsDefined(LastTrainedDateTime)) + { + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime.Value, "O"); + } + if (Optional.IsDefined(LastDeployedDateTime)) + { + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime.Value, "O"); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings, options); + } + if (Optional.IsDefined(Multilingual)) + { + writer.WritePropertyName("multilingual"u8); + writer.WriteBooleanValue(Multilingual.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetProjectResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetProjectResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetProjectResponse(document.RootElement, options); + } + + internal static GetProjectResponse DeserializeGetProjectResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastModifiedDateTime = default; + DateTimeOffset? lastTrainedDateTime = default; + DateTimeOffset? lastDeployedDateTime = default; + ProjectKind projectKind = default; + string storageInputContainerName = default; + ProjectSettings settings = default; + bool? multilingual = default; + string description = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedDateTime"u8)) + { + lastModifiedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + continue; + } + if (property.NameEquals("multilingual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multilingual = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetProjectResponse( + createdDateTime, + lastModifiedDateTime, + lastTrainedDateTime, + lastDeployedDateTime, + projectKind, + storageInputContainerName, + settings, + multilingual, + description, + language, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetProjectResponse)} does not support writing '{options.Format}' format."); + } + } + + GetProjectResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetProjectResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetProjectResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetProjectResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetProjectResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.cs new file mode 100644 index 0000000000000..7c556b8541022 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetProjectResponse. + public partial class GetProjectResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// The project kind. + /// The storage container name. + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// or is null. + internal GetProjectResponse(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, ProjectKind projectKind, string storageInputContainerName, string language) + { + Argument.AssertNotNull(storageInputContainerName, nameof(storageInputContainerName)); + Argument.AssertNotNull(language, nameof(language)); + + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + Language = language; + } + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// Represents the project last training datetime. + /// Represents the project last deployment datetime. + /// The project kind. + /// The storage container name. + /// The project settings. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// Keeps track of any properties unknown to the library. + internal GetProjectResponse(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, DateTimeOffset? lastTrainedDateTime, DateTimeOffset? lastDeployedDateTime, ProjectKind projectKind, string storageInputContainerName, ProjectSettings settings, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + Settings = settings; + Multilingual = multilingual; + Description = description; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetProjectResponse() + { + } + + /// Represents the project creation datetime. + public DateTimeOffset CreatedDateTime { get; } + /// Represents the project last modification datetime. + public DateTimeOffset LastModifiedDateTime { get; } + /// Represents the project last training datetime. + public DateTimeOffset? LastTrainedDateTime { get; } + /// Represents the project last deployment datetime. + public DateTimeOffset? LastDeployedDateTime { get; } + /// The project kind. + public ProjectKind ProjectKind { get; } + /// The storage container name. + public string StorageInputContainerName { get; } + /// The project settings. + public ProjectSettings Settings { get; } + /// Whether the project would be used for multiple languages or not. + public bool? Multilingual { get; } + /// The project description. + public string Description { get; } + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + public string Language { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..f7d8444ba2fc1 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetSwapDeploymentsStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetSwapDeploymentsStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetSwapDeploymentsStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetSwapDeploymentsStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetSwapDeploymentsStatusResponse(document.RootElement, options); + } + + internal static GetSwapDeploymentsStatusResponse DeserializeGetSwapDeploymentsStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetSwapDeploymentsStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetSwapDeploymentsStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetSwapDeploymentsStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetSwapDeploymentsStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetSwapDeploymentsStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetSwapDeploymentsStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetSwapDeploymentsStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs new file mode 100644 index 0000000000000..de03d3d7f9382 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetSwapDeploymentsStatusResponse. + public partial class GetSwapDeploymentsStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetSwapDeploymentsStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetSwapDeploymentsStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetSwapDeploymentsStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.Serialization.cs new file mode 100644 index 0000000000000..2d94dbcd319e3 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetTrainedModelResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetTrainedModelResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastTrainingDurationInSeconds"u8); + writer.WriteNumberValue(LastTrainingDurationInSeconds); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + writer.WritePropertyName("hasSnapshot"u8); + writer.WriteBooleanValue(HasSnapshot); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetTrainedModelResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetTrainedModelResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetTrainedModelResponse(document.RootElement, options); + } + + internal static GetTrainedModelResponse DeserializeGetTrainedModelResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + int lastTrainingDurationInSeconds = default; + DateTimeOffset modelExpirationDate = default; + string modelTrainingConfigVersion = default; + bool hasSnapshot = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastTrainingDurationInSeconds"u8)) + { + lastTrainingDurationInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("hasSnapshot"u8)) + { + hasSnapshot = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetTrainedModelResponse( + modelId, + lastTrainedDateTime, + lastTrainingDurationInSeconds, + modelExpirationDate, + modelTrainingConfigVersion, + hasSnapshot, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetTrainedModelResponse)} does not support writing '{options.Format}' format."); + } + } + + GetTrainedModelResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetTrainedModelResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetTrainedModelResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetTrainedModelResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetTrainedModelResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.cs new file mode 100644 index 0000000000000..4d5248f40e5cf --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetTrainedModelResponse. + public partial class GetTrainedModelResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// or is null. + internal GetTrainedModelResponse(string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot) + { + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + HasSnapshot = hasSnapshot; + } + + /// Initializes a new instance of . + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// Keeps track of any properties unknown to the library. + internal GetTrainedModelResponse(string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot, IDictionary serializedAdditionalRawData) + { + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + HasSnapshot = hasSnapshot; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetTrainedModelResponse() + { + } + + /// The model ID. + public string ModelId { get; } + /// The last trained date time of the model. + public DateTimeOffset LastTrainedDateTime { get; } + /// The duration of the model's last training request in seconds. + public int LastTrainingDurationInSeconds { get; } + /// The model expiration date. + public DateTimeOffset ModelExpirationDate { get; } + /// The model training config version. + public string ModelTrainingConfigVersion { get; } + /// The flag to indicate if the trained model has a snapshot ready. + public bool HasSnapshot { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..d3f36fb2a72c1 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetTrainingStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetTrainingStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetTrainingStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetTrainingStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetTrainingStatusResponse(document.RootElement, options); + } + + internal static GetTrainingStatusResponse DeserializeGetTrainingStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + TrainingJobResult result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("result"u8)) + { + result = TrainingJobResult.DeserializeTrainingJobResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetTrainingStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + result, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetTrainingStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetTrainingStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetTrainingStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetTrainingStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetTrainingStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetTrainingStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.cs new file mode 100644 index 0000000000000..2cbc3573551a6 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetTrainingStatusResponse. + public partial class GetTrainingStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + /// Represents training tasks detailed result. + /// is null. + internal GetTrainingStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, TrainingJobResult result) + { + Argument.AssertNotNull(result, nameof(result)); + + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + Result = result; + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents training tasks detailed result. + /// Keeps track of any properties unknown to the library. + internal GetTrainingStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, TrainingJobResult result, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetTrainingStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// Represents training tasks detailed result. + public TrainingJobResult Result { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs new file mode 100644 index 0000000000000..d398f0c0ff1e3 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class GetUnassignDeploymentResourcesStatusResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetUnassignDeploymentResourcesStatusResponse)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetUnassignDeploymentResourcesStatusResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetUnassignDeploymentResourcesStatusResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetUnassignDeploymentResourcesStatusResponse(document.RootElement, options); + } + + internal static GetUnassignDeploymentResourcesStatusResponse DeserializeGetUnassignDeploymentResourcesStatusResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetUnassignDeploymentResourcesStatusResponse( + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetUnassignDeploymentResourcesStatusResponse)} does not support writing '{options.Format}' format."); + } + } + + GetUnassignDeploymentResourcesStatusResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetUnassignDeploymentResourcesStatusResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetUnassignDeploymentResourcesStatusResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GetUnassignDeploymentResourcesStatusResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGetUnassignDeploymentResourcesStatusResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs new file mode 100644 index 0000000000000..b627066d2478c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The GetUnassignDeploymentResourcesStatusResponse. + public partial class GetUnassignDeploymentResourcesStatusResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + internal GetUnassignDeploymentResourcesStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Keeps track of any properties unknown to the library. + internal GetUnassignDeploymentResourcesStatusResponse(DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GetUnassignDeploymentResourcesStatusResponse() + { + } + + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorCode.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorCode.cs new file mode 100644 index 0000000000000..6482736de06e8 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorCode.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Human-readable error code. + public readonly partial struct InnerErrorCode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InnerErrorCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidRequestValue = "InvalidRequest"; + private const string InvalidParameterValueValue = "InvalidParameterValue"; + private const string KnowledgeBaseNotFoundValue = "KnowledgeBaseNotFound"; + private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound"; + private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling"; + private const string ExtractionFailureValue = "ExtractionFailure"; + private const string InvalidRequestBodyFormatValue = "InvalidRequestBodyFormat"; + private const string EmptyRequestValue = "EmptyRequest"; + private const string MissingInputDocumentsValue = "MissingInputDocuments"; + private const string InvalidDocumentValue = "InvalidDocument"; + private const string ModelVersionIncorrectValue = "ModelVersionIncorrect"; + private const string InvalidDocumentBatchValue = "InvalidDocumentBatch"; + private const string UnsupportedLanguageCodeValue = "UnsupportedLanguageCode"; + private const string InvalidCountryHintValue = "InvalidCountryHint"; + + /// InvalidRequest. + public static InnerErrorCode InvalidRequest { get; } = new InnerErrorCode(InvalidRequestValue); + /// InvalidParameterValue. + public static InnerErrorCode InvalidParameterValue { get; } = new InnerErrorCode(InvalidParameterValueValue); + /// KnowledgeBaseNotFound. + public static InnerErrorCode KnowledgeBaseNotFound { get; } = new InnerErrorCode(KnowledgeBaseNotFoundValue); + /// AzureCognitiveSearchNotFound. + public static InnerErrorCode AzureCognitiveSearchNotFound { get; } = new InnerErrorCode(AzureCognitiveSearchNotFoundValue); + /// AzureCognitiveSearchThrottling. + public static InnerErrorCode AzureCognitiveSearchThrottling { get; } = new InnerErrorCode(AzureCognitiveSearchThrottlingValue); + /// ExtractionFailure. + public static InnerErrorCode ExtractionFailure { get; } = new InnerErrorCode(ExtractionFailureValue); + /// InvalidRequestBodyFormat. + public static InnerErrorCode InvalidRequestBodyFormat { get; } = new InnerErrorCode(InvalidRequestBodyFormatValue); + /// EmptyRequest. + public static InnerErrorCode EmptyRequest { get; } = new InnerErrorCode(EmptyRequestValue); + /// MissingInputDocuments. + public static InnerErrorCode MissingInputDocuments { get; } = new InnerErrorCode(MissingInputDocumentsValue); + /// InvalidDocument. + public static InnerErrorCode InvalidDocument { get; } = new InnerErrorCode(InvalidDocumentValue); + /// ModelVersionIncorrect. + public static InnerErrorCode ModelVersionIncorrect { get; } = new InnerErrorCode(ModelVersionIncorrectValue); + /// InvalidDocumentBatch. + public static InnerErrorCode InvalidDocumentBatch { get; } = new InnerErrorCode(InvalidDocumentBatchValue); + /// UnsupportedLanguageCode. + public static InnerErrorCode UnsupportedLanguageCode { get; } = new InnerErrorCode(UnsupportedLanguageCodeValue); + /// InvalidCountryHint. + public static InnerErrorCode InvalidCountryHint { get; } = new InnerErrorCode(InvalidCountryHintValue); + /// Determines if two values are the same. + public static bool operator ==(InnerErrorCode left, InnerErrorCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InnerErrorCode left, InnerErrorCode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator InnerErrorCode(string value) => new InnerErrorCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InnerErrorCode other && Equals(other); + /// + public bool Equals(InnerErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.Serialization.cs new file mode 100644 index 0000000000000..260685a94ecd7 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class InnerErrorModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.ToString()); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartObject(); + foreach (var item in Details) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(Innererror)) + { + writer.WritePropertyName("innererror"u8); + writer.WriteObjectValue(Innererror, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + InnerErrorModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInnerErrorModel(document.RootElement, options); + } + + internal static InnerErrorModel DeserializeInnerErrorModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InnerErrorCode code = default; + string message = default; + IReadOnlyDictionary details = default; + string target = default; + InnerErrorModel innererror = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = new InnerErrorCode(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + details = dictionary; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = DeserializeInnerErrorModel(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InnerErrorModel( + code, + message, + details ?? new ChangeTrackingDictionary(), + target, + innererror, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support writing '{options.Format}' format."); + } + } + + InnerErrorModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeInnerErrorModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InnerErrorModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static InnerErrorModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInnerErrorModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.cs new file mode 100644 index 0000000000000..7e49119ac32f0 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// An object containing more specific information about the error. As per + /// Microsoft One API guidelines - + /// https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. + /// + public partial class InnerErrorModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// Error message. + /// is null. + internal InnerErrorModel(InnerErrorCode code, string message) + { + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + Details = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// One of a server-defined set of error codes. + /// Error message. + /// Error details. + /// Error target. + /// + /// An object containing more specific information than the current object about + /// the error. + /// + /// Keeps track of any properties unknown to the library. + internal InnerErrorModel(InnerErrorCode code, string message, IReadOnlyDictionary details, string target, InnerErrorModel innererror, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + Details = details; + Target = target; + Innererror = innererror; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InnerErrorModel() + { + } + + /// One of a server-defined set of error codes. + public InnerErrorCode Code { get; } + /// Error message. + public string Message { get; } + /// Error details. + public IReadOnlyDictionary Details { get; } + /// Error target. + public string Target { get; } + /// + /// An object containing more specific information than the current object about + /// the error. + /// + public InnerErrorModel Innererror { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/JobStatus.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/JobStatus.cs new file mode 100644 index 0000000000000..80722e496fd1d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/JobStatus.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The JobStatus. + public readonly partial struct JobStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "notStarted"; + private const string RunningValue = "running"; + private const string SucceededValue = "succeeded"; + private const string FailedValue = "failed"; + private const string CancelledValue = "cancelled"; + private const string CancellingValue = "cancelling"; + private const string PartiallyCompletedValue = "partiallyCompleted"; + + /// notStarted. + public static JobStatus NotStarted { get; } = new JobStatus(NotStartedValue); + /// running. + public static JobStatus Running { get; } = new JobStatus(RunningValue); + /// succeeded. + public static JobStatus Succeeded { get; } = new JobStatus(SucceededValue); + /// failed. + public static JobStatus Failed { get; } = new JobStatus(FailedValue); + /// cancelled. + public static JobStatus Cancelled { get; } = new JobStatus(CancelledValue); + /// cancelling. + public static JobStatus Cancelling { get; } = new JobStatus(CancellingValue); + /// partiallyCompleted. + public static JobStatus PartiallyCompleted { get; } = new JobStatus(PartiallyCompletedValue); + /// Determines if two values are the same. + public static bool operator ==(JobStatus left, JobStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobStatus left, JobStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator JobStatus(string value) => new JobStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobStatus other && Equals(other); + /// + public bool Equals(JobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.Serialization.cs new file mode 100644 index 0000000000000..1d502fa84d6b5 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ModelFile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ModelFile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("contentUri"u8); + writer.WriteStringValue(ContentUri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ModelFile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ModelFile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeModelFile(document.RootElement, options); + } + + internal static ModelFile DeserializeModelFile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + Uri contentUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("contentUri"u8)) + { + contentUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ModelFile(name, contentUri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ModelFile)} does not support writing '{options.Format}' format."); + } + } + + ModelFile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeModelFile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ModelFile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ModelFile FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeModelFile(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.cs new file mode 100644 index 0000000000000..9c27833ecf419 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the properties for the model file. + public partial class ModelFile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the file. + /// The URI to retrieve the content of the file. + /// or is null. + internal ModelFile(string name, Uri contentUri) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(contentUri, nameof(contentUri)); + + Name = name; + ContentUri = contentUri; + } + + /// Initializes a new instance of . + /// The name of the file. + /// The URI to retrieve the content of the file. + /// Keeps track of any properties unknown to the library. + internal ModelFile(string name, Uri contentUri, IDictionary serializedAdditionalRawData) + { + Name = name; + ContentUri = contentUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ModelFile() + { + } + + /// The name of the file. + public string Name { get; } + /// The URI to retrieve the content of the file. + public Uri ContentUri { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..9865214a728bd --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class MultiLabelClassEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MultiLabelClassEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MultiLabelClassEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MultiLabelClassEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMultiLabelClassEvaluationSummary(document.RootElement, options); + } + + internal static MultiLabelClassEvaluationSummary DeserializeMultiLabelClassEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MultiLabelClassEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MultiLabelClassEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + MultiLabelClassEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMultiLabelClassEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MultiLabelClassEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MultiLabelClassEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeMultiLabelClassEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.cs new file mode 100644 index 0000000000000..fc959e9dcc9f8 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the evaluation summary of a class in a multi-label classification + /// project. + /// + public partial class MultiLabelClassEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal MultiLabelClassEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal MultiLabelClassEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MultiLabelClassEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..57d2ecd6b8187 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class MultiLabelClassificationEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MultiLabelClassificationEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("classes"u8); + writer.WriteStartObject(); + foreach (var item in Classes) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MultiLabelClassificationEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MultiLabelClassificationEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMultiLabelClassificationEvaluationSummary(document.RootElement, options); + } + + internal static MultiLabelClassificationEvaluationSummary DeserializeMultiLabelClassificationEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary classes = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("classes"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, MultiLabelClassEvaluationSummary.DeserializeMultiLabelClassEvaluationSummary(property0.Value, options)); + } + classes = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MultiLabelClassificationEvaluationSummary( + classes, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MultiLabelClassificationEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + MultiLabelClassificationEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMultiLabelClassificationEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MultiLabelClassificationEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MultiLabelClassificationEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeMultiLabelClassificationEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs new file mode 100644 index 0000000000000..71ab0013c72ae --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the evaluation summary for a multi-label classification project. + public partial class MultiLabelClassificationEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// is null. + internal MultiLabelClassificationEvaluationSummary(IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(classes, nameof(classes)); + + Classes = classes; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Keeps track of any properties unknown to the library. + internal MultiLabelClassificationEvaluationSummary(IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + Classes = classes; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MultiLabelClassificationEvaluationSummary() + { + } + + /// Represents the classes evaluation. + public IReadOnlyDictionary Classes { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroPrecision { get; } + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroPrecision { get; } + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.Serialization.cs new file mode 100644 index 0000000000000..1ab91e0c7303a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class PrebuiltEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + writer.WritePropertyName("examples"u8); + writer.WriteStringValue(Examples); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PrebuiltEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrebuiltEntity(document.RootElement, options); + } + + internal static PrebuiltEntity DeserializePrebuiltEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + string description = default; + string examples = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("examples"u8)) + { + examples = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrebuiltEntity(category, description, examples, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support writing '{options.Format}' format."); + } + } + + PrebuiltEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePrebuiltEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrebuiltEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PrebuiltEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePrebuiltEntity(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.cs new file mode 100644 index 0000000000000..c01964936ff8e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a supported prebuilt entity. + public partial class PrebuiltEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// , or is null. + internal PrebuiltEntity(string category, string description, string examples) + { + Argument.AssertNotNull(category, nameof(category)); + Argument.AssertNotNull(description, nameof(description)); + Argument.AssertNotNull(examples, nameof(examples)); + + Category = category; + Description = description; + Examples = examples; + } + + /// Initializes a new instance of . + /// The prebuilt entity category. + /// The description. + /// English examples for the entity. + /// Keeps track of any properties unknown to the library. + internal PrebuiltEntity(string category, string description, string examples, IDictionary serializedAdditionalRawData) + { + Category = category; + Description = description; + Examples = examples; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrebuiltEntity() + { + } + + /// The prebuilt entity category. + public string Category { get; } + /// The description. + public string Description { get; } + /// English examples for the entity. + public string Examples { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.Serialization.cs new file mode 100644 index 0000000000000..ef104b6941cd5 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ProjectDeployment : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("deploymentName"u8); + writer.WriteStringValue(DeploymentName); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime, "O"); + writer.WritePropertyName("deploymentExpirationDate"u8); + writer.WriteStringValue(DeploymentExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + writer.WritePropertyName("assignedResources"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ProjectDeployment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectDeployment(document.RootElement, options); + } + + internal static ProjectDeployment DeserializeProjectDeployment(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string deploymentName = default; + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + DateTimeOffset lastDeployedDateTime = default; + DateTimeOffset deploymentExpirationDate = default; + string modelTrainingConfigVersion = default; + IReadOnlyList assignedResources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("deploymentExpirationDate"u8)) + { + deploymentExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("assignedResources"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeploymentResource.DeserializeDeploymentResource(item, options)); + } + assignedResources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectDeployment( + deploymentName, + modelId, + lastTrainedDateTime, + lastDeployedDateTime, + deploymentExpirationDate, + modelTrainingConfigVersion, + assignedResources, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support writing '{options.Format}' format."); + } + } + + ProjectDeployment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectDeployment(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectDeployment)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectDeployment FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectDeployment(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.cs new file mode 100644 index 0000000000000..ed0e55c12bb28 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a project deployment. + public partial class ProjectDeployment + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents deployment name. + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// , , or is null. + internal ProjectDeployment(string deploymentName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IEnumerable assignedResources) + { + Argument.AssertNotNull(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + Argument.AssertNotNull(assignedResources, nameof(assignedResources)); + + DeploymentName = deploymentName; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + AssignedResources = assignedResources.ToList(); + } + + /// Initializes a new instance of . + /// Represents deployment name. + /// Represents deployment modelId. + /// Represents deployment last trained time. + /// Represents deployment last deployed time. + /// Represents deployment expiration date in the runtime. + /// Represents model training config version. + /// Represents the metadata of the assigned Azure resources. + /// Keeps track of any properties unknown to the library. + internal ProjectDeployment(string deploymentName, string modelId, DateTimeOffset lastTrainedDateTime, DateTimeOffset lastDeployedDateTime, DateTimeOffset deploymentExpirationDate, string modelTrainingConfigVersion, IReadOnlyList assignedResources, IDictionary serializedAdditionalRawData) + { + DeploymentName = deploymentName; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + DeploymentExpirationDate = deploymentExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + AssignedResources = assignedResources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectDeployment() + { + } + + /// Represents deployment name. + public string DeploymentName { get; } + /// Represents deployment modelId. + public string ModelId { get; } + /// Represents deployment last trained time. + public DateTimeOffset LastTrainedDateTime { get; } + /// Represents deployment last deployed time. + public DateTimeOffset LastDeployedDateTime { get; } + /// Represents deployment expiration date in the runtime. + public DateTimeOffset DeploymentExpirationDate { get; } + /// Represents model training config version. + public string ModelTrainingConfigVersion { get; } + /// Represents the metadata of the assigned Azure resources. + public IReadOnlyList AssignedResources { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectKind.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectKind.cs new file mode 100644 index 0000000000000..29a61f50e1b4b --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectKind.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The ProjectKind. + public readonly partial struct ProjectKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProjectKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CustomSingleLabelClassificationValue = "CustomSingleLabelClassification"; + private const string CustomMultiLabelClassificationValue = "CustomMultiLabelClassification"; + private const string CustomEntityRecognitionValue = "CustomEntityRecognition"; + private const string CustomAbstractiveSummarizationValue = "CustomAbstractiveSummarization"; + private const string CustomHealthcareValue = "CustomHealthcare"; + private const string CustomTextSentimentValue = "CustomTextSentiment"; + + /// + /// For building a classification model to classify text using your own data. Each + /// file will have only one label. For example, file 1 is classified as A and file + /// 2 is classified as B. + /// + public static ProjectKind CustomSingleLabelClassification { get; } = new ProjectKind(CustomSingleLabelClassificationValue); + /// + /// For building a classification model to classify text using your own data. Each + /// file can have one or many labels. For example, file 1 is classified as A, B, + /// and C and file 2 is classified as B and C. + /// + public static ProjectKind CustomMultiLabelClassification { get; } = new ProjectKind(CustomMultiLabelClassificationValue); + /// + /// For building an extraction model to identify your domain categories using your + /// own data. + /// + public static ProjectKind CustomEntityRecognition { get; } = new ProjectKind(CustomEntityRecognitionValue); + /// + /// For building an abstractive summarization models which are able to summarize + /// long documents. + /// + public static ProjectKind CustomAbstractiveSummarization { get; } = new ProjectKind(CustomAbstractiveSummarizationValue); + /// + /// For building an text analytics for health model to identify your health domain + /// data. + /// + public static ProjectKind CustomHealthcare { get; } = new ProjectKind(CustomHealthcareValue); + /// + /// For building a sentiment models which are able to extract sentiment for long + /// documents. + /// + public static ProjectKind CustomTextSentiment { get; } = new ProjectKind(CustomTextSentimentValue); + /// Determines if two values are the same. + public static bool operator ==(ProjectKind left, ProjectKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProjectKind left, ProjectKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProjectKind(string value) => new ProjectKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProjectKind other && Equals(other); + /// + public bool Equals(ProjectKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.Serialization.cs new file mode 100644 index 0000000000000..582ade18fc18a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.Serialization.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ProjectMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastModifiedDateTime"u8); + writer.WriteStringValue(LastModifiedDateTime, "O"); + if (Optional.IsDefined(LastTrainedDateTime)) + { + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime.Value, "O"); + } + if (Optional.IsDefined(LastDeployedDateTime)) + { + writer.WritePropertyName("lastDeployedDateTime"u8); + writer.WriteStringValue(LastDeployedDateTime.Value, "O"); + } + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings, options); + } + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + if (Optional.IsDefined(Multilingual)) + { + writer.WritePropertyName("multilingual"u8); + writer.WriteBooleanValue(Multilingual.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ProjectMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectMetadata(document.RootElement, options); + } + + internal static ProjectMetadata DeserializeProjectMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset createdDateTime = default; + DateTimeOffset lastModifiedDateTime = default; + DateTimeOffset? lastTrainedDateTime = default; + DateTimeOffset? lastDeployedDateTime = default; + ProjectKind projectKind = default; + string storageInputContainerName = default; + ProjectSettings settings = default; + string projectName = default; + bool? multilingual = default; + string description = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedDateTime"u8)) + { + lastModifiedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastDeployedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastDeployedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + continue; + } + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("multilingual"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multilingual = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectMetadata( + createdDateTime, + lastModifiedDateTime, + lastTrainedDateTime, + lastDeployedDateTime, + projectKind, + storageInputContainerName, + settings, + projectName, + multilingual, + description, + language, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support writing '{options.Format}' format."); + } + } + + ProjectMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.cs new file mode 100644 index 0000000000000..6feb141ddb88d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the metadata of a project. + public partial class ProjectMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// The project kind. + /// The storage container name. + /// The new project name. + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// , or is null. + internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, ProjectKind projectKind, string storageInputContainerName, string projectName, string language) + { + Argument.AssertNotNull(storageInputContainerName, nameof(storageInputContainerName)); + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(language, nameof(language)); + + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + ProjectName = projectName; + Language = language; + } + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project last modification datetime. + /// Represents the project last training datetime. + /// Represents the project last deployment datetime. + /// The project kind. + /// The storage container name. + /// The project settings. + /// The new project name. + /// Whether the project would be used for multiple languages or not. + /// The project description. + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// Keeps track of any properties unknown to the library. + internal ProjectMetadata(DateTimeOffset createdDateTime, DateTimeOffset lastModifiedDateTime, DateTimeOffset? lastTrainedDateTime, DateTimeOffset? lastDeployedDateTime, ProjectKind projectKind, string storageInputContainerName, ProjectSettings settings, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + ProjectKind = projectKind; + StorageInputContainerName = storageInputContainerName; + Settings = settings; + ProjectName = projectName; + Multilingual = multilingual; + Description = description; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectMetadata() + { + } + + /// Represents the project creation datetime. + public DateTimeOffset CreatedDateTime { get; } + /// Represents the project last modification datetime. + public DateTimeOffset LastModifiedDateTime { get; } + /// Represents the project last training datetime. + public DateTimeOffset? LastTrainedDateTime { get; } + /// Represents the project last deployment datetime. + public DateTimeOffset? LastDeployedDateTime { get; } + /// The project kind. + public ProjectKind ProjectKind { get; } + /// The storage container name. + public string StorageInputContainerName { get; } + /// The project settings. + public ProjectSettings Settings { get; } + /// The new project name. + public string ProjectName { get; } + /// Whether the project would be used for multiple languages or not. + public bool? Multilingual { get; } + /// The project description. + public string Description { get; } + /// + /// The project language. This is BCP-47 representation of a language. For example, + /// use "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + public string Language { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.Serialization.cs new file mode 100644 index 0000000000000..da0e7c43020b8 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ProjectSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ConfidenceThreshold)) + { + writer.WritePropertyName("confidenceThreshold"u8); + writer.WriteNumberValue(ConfidenceThreshold.Value); + } + if (Optional.IsDefined(AmlProjectPath)) + { + writer.WritePropertyName("amlProjectPath"u8); + writer.WriteStringValue(AmlProjectPath); + } + if (Optional.IsDefined(IsLabelingLocked)) + { + writer.WritePropertyName("isLabelingLocked"u8); + writer.WriteBooleanValue(IsLabelingLocked.Value); + } + if (Optional.IsDefined(RunGptPredictions)) + { + writer.WritePropertyName("runGptPredictions"u8); + writer.WriteBooleanValue(RunGptPredictions.Value); + } + if (Optional.IsDefined(GptPredictiveLookahead)) + { + writer.WritePropertyName("gptPredictiveLookahead"u8); + writer.WriteNumberValue(GptPredictiveLookahead.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ProjectSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectSettings(document.RootElement, options); + } + + internal static ProjectSettings DeserializeProjectSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? confidenceThreshold = default; + string amlProjectPath = default; + bool? isLabelingLocked = default; + bool? runGptPredictions = default; + int? gptPredictiveLookahead = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confidenceThreshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceThreshold = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("amlProjectPath"u8)) + { + amlProjectPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLabelingLocked"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLabelingLocked = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("runGptPredictions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + runGptPredictions = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("gptPredictiveLookahead"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gptPredictiveLookahead = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectSettings( + confidenceThreshold, + amlProjectPath, + isLabelingLocked, + runGptPredictions, + gptPredictiveLookahead, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectSettings)} does not support writing '{options.Format}' format."); + } + } + + ProjectSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectSettings FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectSettings(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.cs new file mode 100644 index 0000000000000..17913e68c8421 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the settings used to define the project behavior. + public partial class ProjectSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ProjectSettings() + { + } + + /// Initializes a new instance of . + /// + /// The threshold of the class with the highest confidence, at which the prediction + /// will automatically be changed to "None". The value of the threshold should be + /// between 0 and 1 inclusive. + /// + /// The path to the AML connected project. + /// Indicates whether the labeling experience can be modified or not. + /// Indicates whether to run GPT predictions or not. + /// The predictive lookahead for GPT predictions that is specified by the user. + /// Keeps track of any properties unknown to the library. + internal ProjectSettings(float? confidenceThreshold, string amlProjectPath, bool? isLabelingLocked, bool? runGptPredictions, int? gptPredictiveLookahead, IDictionary serializedAdditionalRawData) + { + ConfidenceThreshold = confidenceThreshold; + AmlProjectPath = amlProjectPath; + IsLabelingLocked = isLabelingLocked; + RunGptPredictions = runGptPredictions; + GptPredictiveLookahead = gptPredictiveLookahead; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The threshold of the class with the highest confidence, at which the prediction + /// will automatically be changed to "None". The value of the threshold should be + /// between 0 and 1 inclusive. + /// + public float? ConfidenceThreshold { get; set; } + /// The path to the AML connected project. + public string AmlProjectPath { get; set; } + /// Indicates whether the labeling experience can be modified or not. + public bool? IsLabelingLocked { get; set; } + /// Indicates whether to run GPT predictions or not. + public bool? RunGptPredictions { get; set; } + /// The predictive lookahead for GPT predictions that is specified by the user. + public int? GptPredictiveLookahead { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.Serialization.cs new file mode 100644 index 0000000000000..20298a02b0b1a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ProjectTrainedModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + writer.WritePropertyName("lastTrainedDateTime"u8); + writer.WriteStringValue(LastTrainedDateTime, "O"); + writer.WritePropertyName("lastTrainingDurationInSeconds"u8); + writer.WriteNumberValue(LastTrainingDurationInSeconds); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + writer.WritePropertyName("modelTrainingConfigVersion"u8); + writer.WriteStringValue(ModelTrainingConfigVersion); + writer.WritePropertyName("hasSnapshot"u8); + writer.WriteBooleanValue(HasSnapshot); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ProjectTrainedModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectTrainedModel(document.RootElement, options); + } + + internal static ProjectTrainedModel DeserializeProjectTrainedModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string label = default; + string modelId = default; + DateTimeOffset lastTrainedDateTime = default; + int lastTrainingDurationInSeconds = default; + DateTimeOffset modelExpirationDate = default; + string modelTrainingConfigVersion = default; + bool hasSnapshot = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastTrainedDateTime"u8)) + { + lastTrainedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastTrainingDurationInSeconds"u8)) + { + lastTrainingDurationInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("modelTrainingConfigVersion"u8)) + { + modelTrainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("hasSnapshot"u8)) + { + hasSnapshot = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectTrainedModel( + label, + modelId, + lastTrainedDateTime, + lastTrainingDurationInSeconds, + modelExpirationDate, + modelTrainingConfigVersion, + hasSnapshot, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support writing '{options.Format}' format."); + } + } + + ProjectTrainedModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeProjectTrainedModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectTrainedModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProjectTrainedModel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeProjectTrainedModel(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.cs new file mode 100644 index 0000000000000..07dbe464cb2ea --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a trained model. + public partial class ProjectTrainedModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The trained model label. + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// , or is null. + internal ProjectTrainedModel(string label, string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot) + { + Argument.AssertNotNull(label, nameof(label)); + Argument.AssertNotNull(modelId, nameof(modelId)); + Argument.AssertNotNull(modelTrainingConfigVersion, nameof(modelTrainingConfigVersion)); + + Label = label; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + HasSnapshot = hasSnapshot; + } + + /// Initializes a new instance of . + /// The trained model label. + /// The model ID. + /// The last trained date time of the model. + /// The duration of the model's last training request in seconds. + /// The model expiration date. + /// The model training config version. + /// The flag to indicate if the trained model has a snapshot ready. + /// Keeps track of any properties unknown to the library. + internal ProjectTrainedModel(string label, string modelId, DateTimeOffset lastTrainedDateTime, int lastTrainingDurationInSeconds, DateTimeOffset modelExpirationDate, string modelTrainingConfigVersion, bool hasSnapshot, IDictionary serializedAdditionalRawData) + { + Label = label; + ModelId = modelId; + LastTrainedDateTime = lastTrainedDateTime; + LastTrainingDurationInSeconds = lastTrainingDurationInSeconds; + ModelExpirationDate = modelExpirationDate; + ModelTrainingConfigVersion = modelTrainingConfigVersion; + HasSnapshot = hasSnapshot; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectTrainedModel() + { + } + + /// The trained model label. + public string Label { get; } + /// The model ID. + public string ModelId { get; } + /// The last trained date time of the model. + public DateTimeOffset LastTrainedDateTime { get; } + /// The duration of the model's last training request in seconds. + public int LastTrainingDurationInSeconds { get; } + /// The model expiration date. + public DateTimeOffset ModelExpirationDate { get; } + /// The model training config version. + public string ModelTrainingConfigVersion { get; } + /// The flag to indicate if the trained model has a snapshot ready. + public bool HasSnapshot { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.Serialization.cs new file mode 100644 index 0000000000000..afd3c4c109ea9 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class ResourceMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("azureResourceId"u8); + writer.WriteStringValue(AzureResourceId); + writer.WritePropertyName("customDomain"u8); + writer.WriteStringValue(CustomDomain); + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ResourceMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceMetadata(document.RootElement, options); + } + + internal static ResourceMetadata DeserializeResourceMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azureResourceId = default; + string customDomain = default; + string region = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureResourceId"u8)) + { + azureResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("customDomain"u8)) + { + customDomain = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceMetadata(azureResourceId, customDomain, region, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support writing '{options.Format}' format."); + } + } + + ResourceMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResourceMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ResourceMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeResourceMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.cs new file mode 100644 index 0000000000000..c5118e4cda338 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents metadata for the Azure resource.. + public partial class ResourceMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the Azure resource ID. + /// Represents the Azure resource custom domain. + /// Represents the Azure resource region. + /// , or is null. + public ResourceMetadata(string azureResourceId, string customDomain, string region) + { + Argument.AssertNotNull(azureResourceId, nameof(azureResourceId)); + Argument.AssertNotNull(customDomain, nameof(customDomain)); + Argument.AssertNotNull(region, nameof(region)); + + AzureResourceId = azureResourceId; + CustomDomain = customDomain; + Region = region; + } + + /// Initializes a new instance of . + /// Represents the Azure resource ID. + /// Represents the Azure resource custom domain. + /// Represents the Azure resource region. + /// Keeps track of any properties unknown to the library. + internal ResourceMetadata(string azureResourceId, string customDomain, string region, IDictionary serializedAdditionalRawData) + { + AzureResourceId = azureResourceId; + CustomDomain = customDomain; + Region = region; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ResourceMetadata() + { + } + + /// Represents the Azure resource ID. + public string AzureResourceId { get; } + /// Represents the Azure resource custom domain. + public string CustomDomain { get; } + /// Represents the Azure resource region. + public string Region { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Sentiment.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Sentiment.cs new file mode 100644 index 0000000000000..9d748010011c1 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Sentiment.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The Sentiment. + public readonly partial struct Sentiment : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Sentiment(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PositiveValue = "positive"; + private const string NegativeValue = "negative"; + private const string NeutralValue = "neutral"; + + /// positive. + public static Sentiment Positive { get; } = new Sentiment(PositiveValue); + /// negative. + public static Sentiment Negative { get; } = new Sentiment(NegativeValue); + /// neutral. + public static Sentiment Neutral { get; } = new Sentiment(NeutralValue); + /// Determines if two values are the same. + public static bool operator ==(Sentiment left, Sentiment right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Sentiment left, Sentiment right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Sentiment(string value) => new Sentiment(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Sentiment other && Equals(other); + /// + public bool Equals(Sentiment other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..4e0908b6dbcac --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class SentimentEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SentimentEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SentimentEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SentimentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSentimentEvaluationSummary(document.RootElement, options); + } + + internal static SentimentEvaluationSummary DeserializeSentimentEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SentimentEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SentimentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + SentimentEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSentimentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SentimentEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SentimentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSentimentEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.cs new file mode 100644 index 0000000000000..fe5a37e9d036a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the evaluation summary for a sentiment in a custom sentiment project. + public partial class SentimentEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal SentimentEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal SentimentEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SentimentEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..f9ed43efc17c1 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class SingleLabelClassEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleLabelClassEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("f1"u8); + writer.WriteNumberValue(F1); + writer.WritePropertyName("precision"u8); + writer.WriteNumberValue(Precision); + writer.WritePropertyName("recall"u8); + writer.WriteNumberValue(Recall); + writer.WritePropertyName("truePositiveCount"u8); + writer.WriteNumberValue(TruePositiveCount); + writer.WritePropertyName("trueNegativeCount"u8); + writer.WriteNumberValue(TrueNegativeCount); + writer.WritePropertyName("falsePositiveCount"u8); + writer.WriteNumberValue(FalsePositiveCount); + writer.WritePropertyName("falseNegativeCount"u8); + writer.WriteNumberValue(FalseNegativeCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SingleLabelClassEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleLabelClassEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleLabelClassEvaluationSummary(document.RootElement, options); + } + + internal static SingleLabelClassEvaluationSummary DeserializeSingleLabelClassEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double f1 = default; + double precision = default; + double recall = default; + int truePositiveCount = default; + int trueNegativeCount = default; + int falsePositiveCount = default; + int falseNegativeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("f1"u8)) + { + f1 = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("precision"u8)) + { + precision = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("recall"u8)) + { + recall = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("truePositiveCount"u8)) + { + truePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("trueNegativeCount"u8)) + { + trueNegativeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falsePositiveCount"u8)) + { + falsePositiveCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("falseNegativeCount"u8)) + { + falseNegativeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleLabelClassEvaluationSummary( + f1, + precision, + recall, + truePositiveCount, + trueNegativeCount, + falsePositiveCount, + falseNegativeCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SingleLabelClassEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + SingleLabelClassEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSingleLabelClassEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleLabelClassEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SingleLabelClassEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSingleLabelClassEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.cs new file mode 100644 index 0000000000000..f565e8255ab6a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the evaluation summary for a class in a single-label classification + /// project. + /// + public partial class SingleLabelClassEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + internal SingleLabelClassEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + } + + /// Initializes a new instance of . + /// Represents the model precision. + /// Represents the model recall. + /// Represents the model F1 score. + /// Represents the count of true positive. + /// Represents the count of true negative. + /// Represents the count of false positive. + /// Represents the count of false negative. + /// Keeps track of any properties unknown to the library. + internal SingleLabelClassEvaluationSummary(double f1, double precision, double recall, int truePositiveCount, int trueNegativeCount, int falsePositiveCount, int falseNegativeCount, IDictionary serializedAdditionalRawData) + { + F1 = f1; + Precision = precision; + Recall = recall; + TruePositiveCount = truePositiveCount; + TrueNegativeCount = trueNegativeCount; + FalsePositiveCount = falsePositiveCount; + FalseNegativeCount = falseNegativeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SingleLabelClassEvaluationSummary() + { + } + + /// Represents the model precision. + public double F1 { get; } + /// Represents the model recall. + public double Precision { get; } + /// Represents the model F1 score. + public double Recall { get; } + /// Represents the count of true positive. + public int TruePositiveCount { get; } + /// Represents the count of true negative. + public int TrueNegativeCount { get; } + /// Represents the count of false positive. + public int FalsePositiveCount { get; } + /// Represents the count of false negative. + public int FalseNegativeCount { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..d80b023e95276 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class SingleLabelClassificationEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleLabelClassificationEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("confusionMatrix"u8); + writer.WriteObjectValue(ConfusionMatrix, options); + writer.WritePropertyName("classes"u8); + writer.WriteStartObject(); + foreach (var item in Classes) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SingleLabelClassificationEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleLabelClassificationEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleLabelClassificationEvaluationSummary(document.RootElement, options); + } + + internal static SingleLabelClassificationEvaluationSummary DeserializeSingleLabelClassificationEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary classes = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confusionMatrix"u8)) + { + confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + continue; + } + if (property.NameEquals("classes"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, SingleLabelClassEvaluationSummary.DeserializeSingleLabelClassEvaluationSummary(property0.Value, options)); + } + classes = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleLabelClassificationEvaluationSummary( + confusionMatrix, + classes, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SingleLabelClassificationEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + SingleLabelClassificationEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSingleLabelClassificationEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleLabelClassificationEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SingleLabelClassificationEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSingleLabelClassificationEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs new file mode 100644 index 0000000000000..4a51ce364df63 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// + /// Represents the evaluation summary for a custom single-label classification + /// project. + /// + public partial class SingleLabelClassificationEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two classes (the two classes can be the + /// same). The matrix is between the class that was labelled and the class that was + /// predicted. + /// + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// or is null. + internal SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); + Argument.AssertNotNull(classes, nameof(classes)); + + ConfusionMatrix = confusionMatrix; + Classes = classes; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two classes (the two classes can be the + /// same). The matrix is between the class that was labelled and the class that was + /// predicted. + /// + /// Represents the classes evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Keeps track of any properties unknown to the library. + internal SingleLabelClassificationEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary classes, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + ConfusionMatrix = confusionMatrix; + Classes = classes; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SingleLabelClassificationEvaluationSummary() + { + } + + /// + /// Represents the confusion matrix between two classes (the two classes can be the + /// same). The matrix is between the class that was labelled and the class that was + /// predicted. + /// + public ConfusionMatrix ConfusionMatrix { get; } + /// Represents the classes evaluation. + public IReadOnlyDictionary Classes { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroPrecision { get; } + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroPrecision { get; } + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..5617fb34b3be3 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class SpanSentimentEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpanSentimentEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("confusionMatrix"u8); + writer.WriteObjectValue(ConfusionMatrix, options); + writer.WritePropertyName("sentiments"u8); + writer.WriteStartObject(); + foreach (var item in Sentiments) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SpanSentimentEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpanSentimentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpanSentimentEvaluationSummary(document.RootElement, options); + } + + internal static SpanSentimentEvaluationSummary DeserializeSpanSentimentEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary sentiments = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confusionMatrix"u8)) + { + confusionMatrix = ConfusionMatrix.DeserializeConfusionMatrix(property.Value, options); + continue; + } + if (property.NameEquals("sentiments"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, SentimentEvaluationSummary.DeserializeSentimentEvaluationSummary(property0.Value, options)); + } + sentiments = dictionary; + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpanSentimentEvaluationSummary( + confusionMatrix, + sentiments, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpanSentimentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + SpanSentimentEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpanSentimentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpanSentimentEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SpanSentimentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSpanSentimentEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.cs new file mode 100644 index 0000000000000..b935983aed0af --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the evaluation summary for a custom sentiment project. + public partial class SpanSentimentEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two sentiments (the two sentiments can + /// be the same). The matrix is between the sentiment that was labelled and the + /// sentiment that was predicted. + /// + /// Represents the sentiment evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// or is null. + internal SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary sentiments, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); + Argument.AssertNotNull(sentiments, nameof(sentiments)); + + ConfusionMatrix = confusionMatrix; + Sentiments = sentiments; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two sentiments (the two sentiments can + /// be the same). The matrix is between the sentiment that was labelled and the + /// sentiment that was predicted. + /// + /// Represents the sentiment evaluation. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Keeps track of any properties unknown to the library. + internal SpanSentimentEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary sentiments, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + ConfusionMatrix = confusionMatrix; + Sentiments = sentiments; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SpanSentimentEvaluationSummary() + { + } + + /// + /// Represents the confusion matrix between two sentiments (the two sentiments can + /// be the same). The matrix is between the sentiment that was labelled and the + /// sentiment that was predicted. + /// + public ConfusionMatrix ConfusionMatrix { get; } + /// Represents the sentiment evaluation. + public IReadOnlyDictionary Sentiments { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroPrecision { get; } + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroPrecision { get; } + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/StringIndexType.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/StringIndexType.cs new file mode 100644 index 0000000000000..ff1c47b93e165 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/StringIndexType.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// The StringIndexType. + public readonly partial struct StringIndexType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StringIndexType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Utf16CodeUnitValue = "Utf16CodeUnit"; + + /// + /// The 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. + /// + public static StringIndexType Utf16CodeUnit { get; } = new StringIndexType(Utf16CodeUnitValue); + /// Determines if two values are the same. + public static bool operator ==(StringIndexType left, StringIndexType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StringIndexType left, StringIndexType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StringIndexType(string value) => new StringIndexType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StringIndexType other && Equals(other); + /// + public bool Equals(StringIndexType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.Serialization.cs new file mode 100644 index 0000000000000..cf9f8d71c449e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class SubTrainingJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete); + if (Optional.IsDefined(StartDateTime)) + { + writer.WritePropertyName("startDateTime"u8); + writer.WriteStringValue(StartDateTime.Value, "O"); + } + if (Optional.IsDefined(EndDateTime)) + { + writer.WritePropertyName("endDateTime"u8); + writer.WriteStringValue(EndDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SubTrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubTrainingJobState(document.RootElement, options); + } + + internal static SubTrainingJobState DeserializeSubTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int percentComplete = default; + DateTimeOffset? startDateTime = default; + DateTimeOffset? endDateTime = default; + JobStatus status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("percentComplete"u8)) + { + percentComplete = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("startDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubTrainingJobState(percentComplete, startDateTime, endDateTime, status, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support writing '{options.Format}' format."); + } + } + + SubTrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSubTrainingJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SubTrainingJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SubTrainingJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSubTrainingJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.cs new file mode 100644 index 0000000000000..9d002dd775028 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the detailed state of a training sub-operation. + public partial class SubTrainingJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents progress percentage. + /// Represents the status of the sub-operation. + internal SubTrainingJobState(int percentComplete, JobStatus status) + { + PercentComplete = percentComplete; + Status = status; + } + + /// Initializes a new instance of . + /// Represents progress percentage. + /// Represents the start date time. + /// Represents the end date time. + /// Represents the status of the sub-operation. + /// Keeps track of any properties unknown to the library. + internal SubTrainingJobState(int percentComplete, DateTimeOffset? startDateTime, DateTimeOffset? endDateTime, JobStatus status, IDictionary serializedAdditionalRawData) + { + PercentComplete = percentComplete; + StartDateTime = startDateTime; + EndDateTime = endDateTime; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SubTrainingJobState() + { + } + + /// Represents progress percentage. + public int PercentComplete { get; } + /// Represents the start date time. + public DateTimeOffset? StartDateTime { get; } + /// Represents the end date time. + public DateTimeOffset? EndDateTime { get; } + /// Represents the status of the sub-operation. + public JobStatus Status { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.Serialization.cs new file mode 100644 index 0000000000000..1fa39ccfb11b1 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class SupportedLanguage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("languageName"u8); + writer.WriteStringValue(LanguageName); + writer.WritePropertyName("languageCode"u8); + writer.WriteStringValue(LanguageCode); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SupportedLanguage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSupportedLanguage(document.RootElement, options); + } + + internal static SupportedLanguage DeserializeSupportedLanguage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string languageName = default; + string languageCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("languageName"u8)) + { + languageName = property.Value.GetString(); + continue; + } + if (property.NameEquals("languageCode"u8)) + { + languageCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SupportedLanguage(languageName, languageCode, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support writing '{options.Format}' format."); + } + } + + SupportedLanguage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSupportedLanguage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SupportedLanguage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SupportedLanguage FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSupportedLanguage(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.cs new file mode 100644 index 0000000000000..68efccbfd2cc9 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a supported language. + public partial class SupportedLanguage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The language name. + /// + /// The language code. This is BCP-47 representation of a language. For example, + /// "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// or is null. + internal SupportedLanguage(string languageName, string languageCode) + { + Argument.AssertNotNull(languageName, nameof(languageName)); + Argument.AssertNotNull(languageCode, nameof(languageCode)); + + LanguageName = languageName; + LanguageCode = languageCode; + } + + /// Initializes a new instance of . + /// The language name. + /// + /// The language code. This is BCP-47 representation of a language. For example, + /// "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// Keeps track of any properties unknown to the library. + internal SupportedLanguage(string languageName, string languageCode, IDictionary serializedAdditionalRawData) + { + LanguageName = languageName; + LanguageCode = languageCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SupportedLanguage() + { + } + + /// The language name. + public string LanguageName { get; } + /// + /// The language code. This is BCP-47 representation of a language. For example, + /// "en" for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + public string LanguageCode { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsOptions.Serialization.cs new file mode 100644 index 0000000000000..d463f8258e61b --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsOptions.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class SwapDeploymentsOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("firstDeploymentName"u8); + writer.WriteStringValue(FirstDeploymentName); + writer.WritePropertyName("secondDeploymentName"u8); + writer.WriteStringValue(SecondDeploymentName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SwapDeploymentsOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwapDeploymentsOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwapDeploymentsOptions(document.RootElement, options); + } + + internal static SwapDeploymentsOptions DeserializeSwapDeploymentsOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string firstDeploymentName = default; + string secondDeploymentName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("firstDeploymentName"u8)) + { + firstDeploymentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("secondDeploymentName"u8)) + { + secondDeploymentName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SwapDeploymentsOptions(firstDeploymentName, secondDeploymentName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SwapDeploymentsOptions)} does not support writing '{options.Format}' format."); + } + } + + SwapDeploymentsOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSwapDeploymentsOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwapDeploymentsOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SwapDeploymentsOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSwapDeploymentsOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsOptions.cs new file mode 100644 index 0000000000000..e696f2fd049f9 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsOptions.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the options for swapping two deployments together. + public partial class SwapDeploymentsOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the first deployment name. + /// Represents the second deployment name. + /// or is null. + public SwapDeploymentsOptions(string firstDeploymentName, string secondDeploymentName) + { + Argument.AssertNotNull(firstDeploymentName, nameof(firstDeploymentName)); + Argument.AssertNotNull(secondDeploymentName, nameof(secondDeploymentName)); + + FirstDeploymentName = firstDeploymentName; + SecondDeploymentName = secondDeploymentName; + } + + /// Initializes a new instance of . + /// Represents the first deployment name. + /// Represents the second deployment name. + /// Keeps track of any properties unknown to the library. + internal SwapDeploymentsOptions(string firstDeploymentName, string secondDeploymentName, IDictionary serializedAdditionalRawData) + { + FirstDeploymentName = firstDeploymentName; + SecondDeploymentName = secondDeploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SwapDeploymentsOptions() + { + } + + /// Represents the first deployment name. + public string FirstDeploymentName { get; } + /// Represents the second deployment name. + public string SecondDeploymentName { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..30dd31c554870 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class TextSentimentEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextSentimentEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("spanSentimentsEvaluation"u8); + writer.WriteObjectValue(SpanSentimentsEvaluation, options); + writer.WritePropertyName("microF1"u8); + writer.WriteNumberValue(MicroF1); + writer.WritePropertyName("microPrecision"u8); + writer.WriteNumberValue(MicroPrecision); + writer.WritePropertyName("microRecall"u8); + writer.WriteNumberValue(MicroRecall); + writer.WritePropertyName("macroF1"u8); + writer.WriteNumberValue(MacroF1); + writer.WritePropertyName("macroPrecision"u8); + writer.WriteNumberValue(MacroPrecision); + writer.WritePropertyName("macroRecall"u8); + writer.WriteNumberValue(MacroRecall); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TextSentimentEvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TextSentimentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextSentimentEvaluationSummary(document.RootElement, options); + } + + internal static TextSentimentEvaluationSummary DeserializeTextSentimentEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SpanSentimentEvaluationSummary spanSentimentsEvaluation = default; + float microF1 = default; + float microPrecision = default; + float microRecall = default; + float macroF1 = default; + float macroPrecision = default; + float macroRecall = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("spanSentimentsEvaluation"u8)) + { + spanSentimentsEvaluation = SpanSentimentEvaluationSummary.DeserializeSpanSentimentEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("microF1"u8)) + { + microF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microPrecision"u8)) + { + microPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("microRecall"u8)) + { + microRecall = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroF1"u8)) + { + macroF1 = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroPrecision"u8)) + { + macroPrecision = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("macroRecall"u8)) + { + macroRecall = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TextSentimentEvaluationSummary( + spanSentimentsEvaluation, + microF1, + microPrecision, + microRecall, + macroF1, + macroPrecision, + macroRecall, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TextSentimentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + TextSentimentEvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTextSentimentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextSentimentEvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TextSentimentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextSentimentEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.cs new file mode 100644 index 0000000000000..1cef53f8a33c2 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the evaluation summary for a custom text sentiment project. + public partial class TextSentimentEvaluationSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents evaluation of span level sentiments. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// is null. + internal TextSentimentEvaluationSummary(SpanSentimentEvaluationSummary spanSentimentsEvaluation, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(spanSentimentsEvaluation, nameof(spanSentimentsEvaluation)); + + SpanSentimentsEvaluation = spanSentimentsEvaluation; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// Represents evaluation of span level sentiments. + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + /// Keeps track of any properties unknown to the library. + internal TextSentimentEvaluationSummary(SpanSentimentEvaluationSummary spanSentimentsEvaluation, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + SpanSentimentsEvaluation = spanSentimentsEvaluation; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TextSentimentEvaluationSummary() + { + } + + /// Represents evaluation of span level sentiments. + public SpanSentimentEvaluationSummary SpanSentimentsEvaluation { get; } + /// Represents the micro F1. Expected value is a float between 0 and 1 inclusive. + public float MicroF1 { get; } + /// + /// Represents the micro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroPrecision { get; } + /// + /// Represents the micro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MicroRecall { get; } + /// Represents the macro F1. Expected value is a float between 0 and 1 inclusive. + public float MacroF1 { get; } + /// + /// Represents the macro precision. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroPrecision { get; } + /// + /// Represents the macro recall. Expected value is a float between 0 and 1 + /// inclusive. + /// + public float MacroRecall { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.Serialization.cs new file mode 100644 index 0000000000000..640d20626ef4f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class TrainingConfigVersion : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersionProperty); + writer.WritePropertyName("modelExpirationDate"u8); + writer.WriteStringValue(ModelExpirationDate, "D"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TrainingConfigVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingConfigVersion(document.RootElement, options); + } + + internal static TrainingConfigVersion DeserializeTrainingConfigVersion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string trainingConfigVersion = default; + DateTimeOffset modelExpirationDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelExpirationDate"u8)) + { + modelExpirationDate = property.Value.GetDateTimeOffset("D"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingConfigVersion(trainingConfigVersion, modelExpirationDate, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support writing '{options.Format}' format."); + } + } + + TrainingConfigVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingConfigVersion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingConfigVersion)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingConfigVersion FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingConfigVersion(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.cs new file mode 100644 index 0000000000000..9b15c05d30ece --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a training config version. + public partial class TrainingConfigVersion + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// is null. + internal TrainingConfigVersion(string trainingConfigVersionProperty, DateTimeOffset modelExpirationDate) + { + Argument.AssertNotNull(trainingConfigVersionProperty, nameof(trainingConfigVersionProperty)); + + TrainingConfigVersionProperty = trainingConfigVersionProperty; + ModelExpirationDate = modelExpirationDate; + } + + /// Initializes a new instance of . + /// Represents the version of the config. + /// Represents the training config version expiration date. + /// Keeps track of any properties unknown to the library. + internal TrainingConfigVersion(string trainingConfigVersionProperty, DateTimeOffset modelExpirationDate, IDictionary serializedAdditionalRawData) + { + TrainingConfigVersionProperty = trainingConfigVersionProperty; + ModelExpirationDate = modelExpirationDate; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingConfigVersion() + { + } + + /// Represents the version of the config. + public string TrainingConfigVersionProperty { get; } + /// Represents the training config version expiration date. + public DateTimeOffset ModelExpirationDate { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobOptions.Serialization.cs new file mode 100644 index 0000000000000..9d027c4df644d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobOptions.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class TrainingJobOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + if (Optional.IsDefined(EvaluationOptions)) + { + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + } + if (Optional.IsDefined(DataGenerationSettings)) + { + writer.WritePropertyName("dataGenerationSettings"u8); + writer.WriteObjectValue(DataGenerationSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TrainingJobOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobOptions(document.RootElement, options); + } + + internal static TrainingJobOptions DeserializeTrainingJobOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelLabel = default; + string trainingConfigVersion = default; + EvaluationOptions evaluationOptions = default; + DataGenerationSettings dataGenerationSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelLabel"u8)) + { + modelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evaluationOptions = EvaluationOptions.DeserializeEvaluationOptions(property.Value, options); + continue; + } + if (property.NameEquals("dataGenerationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataGenerationSettings = DataGenerationSettings.DeserializeDataGenerationSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobOptions(modelLabel, trainingConfigVersion, evaluationOptions, dataGenerationSettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingJobOptions)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingJobOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingJobOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobOptions.cs new file mode 100644 index 0000000000000..d5cd6eaa38d02 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobOptions.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the options for starting a new training job. + public partial class TrainingJobOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. + /// or is null. + public TrainingJobOptions(string modelLabel, string trainingConfigVersion) + { + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); + + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// Represents training config version. + /// + /// Represents the evaluation options. By default, the evaluation kind is + /// percentage, with training split percentage as 80, and testing split percentage + /// as 20. + /// + /// Represents the settings for using data generation as part of training a custom model. + /// Keeps track of any properties unknown to the library. + internal TrainingJobOptions(string modelLabel, string trainingConfigVersion, EvaluationOptions evaluationOptions, DataGenerationSettings dataGenerationSettings, IDictionary serializedAdditionalRawData) + { + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + EvaluationOptions = evaluationOptions; + DataGenerationSettings = dataGenerationSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobOptions() + { + } + + /// Represents the output model label. + public string ModelLabel { get; } + /// Represents training config version. + public string TrainingConfigVersion { get; } + /// + /// Represents the evaluation options. By default, the evaluation kind is + /// percentage, with training split percentage as 80, and testing split percentage + /// as 20. + /// + public EvaluationOptions EvaluationOptions { get; set; } + /// Represents the settings for using data generation as part of training a custom model. + public DataGenerationSettings DataGenerationSettings { get; set; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.Serialization.cs new file mode 100644 index 0000000000000..edee651f57bf9 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class TrainingJobResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + writer.WritePropertyName("trainingStatus"u8); + writer.WriteObjectValue(TrainingStatus, options); + if (Optional.IsDefined(EvaluationStatus)) + { + writer.WritePropertyName("evaluationStatus"u8); + writer.WriteObjectValue(EvaluationStatus, options); + } + if (Optional.IsDefined(EstimatedEndDateTime)) + { + writer.WritePropertyName("estimatedEndDateTime"u8); + writer.WriteStringValue(EstimatedEndDateTime.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TrainingJobResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobResult(document.RootElement, options); + } + + internal static TrainingJobResult DeserializeTrainingJobResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelLabel = default; + string trainingConfigVersion = default; + SubTrainingJobState trainingStatus = default; + SubTrainingJobState evaluationStatus = default; + DateTimeOffset? estimatedEndDateTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelLabel"u8)) + { + modelLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingConfigVersion"u8)) + { + trainingConfigVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("trainingStatus"u8)) + { + trainingStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + continue; + } + if (property.NameEquals("evaluationStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evaluationStatus = SubTrainingJobState.DeserializeSubTrainingJobState(property.Value, options); + continue; + } + if (property.NameEquals("estimatedEndDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + estimatedEndDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobResult( + modelLabel, + trainingConfigVersion, + trainingStatus, + evaluationStatus, + estimatedEndDateTime, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingJobResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingJobResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.cs new file mode 100644 index 0000000000000..8f1960cdc59f3 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the output of a training job. + public partial class TrainingJobResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents model train status. + /// , or is null. + internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubTrainingJobState trainingStatus) + { + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + Argument.AssertNotNull(trainingConfigVersion, nameof(trainingConfigVersion)); + Argument.AssertNotNull(trainingStatus, nameof(trainingStatus)); + + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + TrainingStatus = trainingStatus; + } + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents model train status. + /// Represents model evaluation status. + /// Represents the estimate end date time for training and evaluation. + /// Keeps track of any properties unknown to the library. + internal TrainingJobResult(string modelLabel, string trainingConfigVersion, SubTrainingJobState trainingStatus, SubTrainingJobState evaluationStatus, DateTimeOffset? estimatedEndDateTime, IDictionary serializedAdditionalRawData) + { + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + TrainingStatus = trainingStatus; + EvaluationStatus = evaluationStatus; + EstimatedEndDateTime = estimatedEndDateTime; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobResult() + { + } + + /// Represents trained model label. + public string ModelLabel { get; } + /// Represents training config version. + public string TrainingConfigVersion { get; } + /// Represents model train status. + public SubTrainingJobState TrainingStatus { get; } + /// Represents model evaluation status. + public SubTrainingJobState EvaluationStatus { get; } + /// Represents the estimate end date time for training and evaluation. + public DateTimeOffset? EstimatedEndDateTime { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.Serialization.cs new file mode 100644 index 0000000000000..046a455adf79e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class TrainingJobState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("jobId"u8); + writer.WriteStringValue(JobId); + writer.WritePropertyName("createdDateTime"u8); + writer.WriteStringValue(CreatedDateTime, "O"); + writer.WritePropertyName("lastUpdatedDateTime"u8); + writer.WriteStringValue(LastUpdatedDateTime, "O"); + if (Optional.IsDefined(ExpirationDateTime)) + { + writer.WritePropertyName("expirationDateTime"u8); + writer.WriteStringValue(ExpirationDateTime.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsCollectionDefined(Warnings)) + { + writer.WritePropertyName("warnings"u8); + writer.WriteStartArray(); + foreach (var item in Warnings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TrainingJobState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobState(document.RootElement, options); + } + + internal static TrainingJobState DeserializeTrainingJobState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobId = default; + DateTimeOffset createdDateTime = default; + DateTimeOffset lastUpdatedDateTime = default; + DateTimeOffset? expirationDateTime = default; + JobStatus status = default; + IReadOnlyList warnings = default; + IReadOnlyList errors = default; + TrainingJobResult result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobId"u8)) + { + jobId = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdDateTime"u8)) + { + createdDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastUpdatedDateTime"u8)) + { + lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("expirationDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new JobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("warnings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Warning.DeserializeWarning(item, options)); + } + warnings = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Error.DeserializeError(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("result"u8)) + { + result = TrainingJobResult.DeserializeTrainingJobResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobState( + jobId, + createdDateTime, + lastUpdatedDateTime, + expirationDateTime, + status, + warnings ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + result, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TrainingJobState)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTrainingJobState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TrainingJobState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobState(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.cs new file mode 100644 index 0000000000000..8137a3de2ca43 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the state of a training job. + public partial class TrainingJobState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The job status. + /// Represents training tasks detailed result. + /// or is null. + internal TrainingJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, JobStatus status, TrainingJobResult result) + { + Argument.AssertNotNull(jobId, nameof(jobId)); + Argument.AssertNotNull(result, nameof(result)); + + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + Status = status; + Warnings = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + Result = result; + } + + /// Initializes a new instance of . + /// The job ID. + /// The creation date time of the job. + /// The last date time the job was updated. + /// The expiration date time of the job. + /// The job status. + /// The warnings that were encountered while executing the job. + /// The errors encountered while executing the job. + /// Represents training tasks detailed result. + /// Keeps track of any properties unknown to the library. + internal TrainingJobState(string jobId, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, DateTimeOffset? expirationDateTime, JobStatus status, IReadOnlyList warnings, IReadOnlyList errors, TrainingJobResult result, IDictionary serializedAdditionalRawData) + { + JobId = jobId; + CreatedDateTime = createdDateTime; + LastUpdatedDateTime = lastUpdatedDateTime; + ExpirationDateTime = expirationDateTime; + Status = status; + Warnings = warnings; + Errors = errors; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobState() + { + } + + /// The job ID. + public string JobId { get; } + /// The creation date time of the job. + public DateTimeOffset CreatedDateTime { get; } + /// The last date time the job was updated. + public DateTimeOffset LastUpdatedDateTime { get; } + /// The expiration date time of the job. + public DateTimeOffset? ExpirationDateTime { get; } + /// The job status. + public JobStatus Status { get; } + /// The warnings that were encountered while executing the job. + public IReadOnlyList Warnings { get; } + /// The errors encountered while executing the job. + public IReadOnlyList Errors { get; } + /// Represents training tasks detailed result. + public TrainingJobResult Result { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesOptions.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesOptions.Serialization.cs new file mode 100644 index 0000000000000..d446939d4a86e --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesOptions.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class UnassignDeploymentResourcesOptions : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesOptions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("assignedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in AssignedResourceIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + UnassignDeploymentResourcesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUnassignDeploymentResourcesOptions(document.RootElement, options); + } + + internal static UnassignDeploymentResourcesOptions DeserializeUnassignDeploymentResourcesOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList assignedResourceIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignedResourceIds"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignedResourceIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnassignDeploymentResourcesOptions(assignedResourceIds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesOptions)} does not support writing '{options.Format}' format."); + } + } + + UnassignDeploymentResourcesOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUnassignDeploymentResourcesOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UnassignDeploymentResourcesOptions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnassignDeploymentResourcesOptions(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesOptions.cs new file mode 100644 index 0000000000000..24b0e61892239 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesOptions.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents the options to unassign Azure resources from a project. + public partial class UnassignDeploymentResourcesOptions + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Represents the assigned resource IDs to be unassigned. + /// is null. + public UnassignDeploymentResourcesOptions(IEnumerable assignedResourceIds) + { + Argument.AssertNotNull(assignedResourceIds, nameof(assignedResourceIds)); + + AssignedResourceIds = assignedResourceIds.ToList(); + } + + /// Initializes a new instance of . + /// Represents the assigned resource IDs to be unassigned. + /// Keeps track of any properties unknown to the library. + internal UnassignDeploymentResourcesOptions(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UnassignDeploymentResourcesOptions() + { + } + + /// Represents the assigned resource IDs to be unassigned. + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs new file mode 100644 index 0000000000000..a8dbc74a74eac --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + internal partial class UnknownDocumentEvaluationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DocumentEvaluationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentEvaluationResult(document.RootElement, options); + } + + internal static UnknownDocumentEvaluationResult DeserializeUnknownDocumentEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = "Unknown"; + string location = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDocumentEvaluationResult(projectKind, location, language, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + DocumentEvaluationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDocumentEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentEvaluationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownDocumentEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownDocumentEvaluationResult(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.cs new file mode 100644 index 0000000000000..07c58e773910a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Unknown version of DocumentEvaluationResult. + internal partial class UnknownDocumentEvaluationResult : DocumentEvaluationResult + { + /// Initializes a new instance of . + /// Represents the project kind. + /// Represents the document path. + /// + /// Represents the document language. This is BCP-47 representation of a language. + /// For example, use "en" for English, "en-gb" for English (UK), "es" for Spanish + /// etc. + /// + /// Keeps track of any properties unknown to the library. + internal UnknownDocumentEvaluationResult(ProjectKind projectKind, string location, string language, IDictionary serializedAdditionalRawData) : base(projectKind, location, language, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownDocumentEvaluationResult() + { + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs new file mode 100644 index 0000000000000..d5a9f96d81349 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + internal partial class UnknownEvaluationSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + writer.WritePropertyName("evaluationOptions"u8); + writer.WriteObjectValue(EvaluationOptions, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EvaluationSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationSummary(document.RootElement, options); + } + + internal static UnknownEvaluationSummary DeserializeUnknownEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = "Unknown"; + EvaluationOptions evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + evaluationOptions = EvaluationOptions.DeserializeEvaluationOptions(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownEvaluationSummary(projectKind, evaluationOptions, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EvaluationSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownEvaluationSummary(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.cs new file mode 100644 index 0000000000000..f69ea9690c63c --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Unknown version of EvaluationSummary. + internal partial class UnknownEvaluationSummary : EvaluationSummary + { + /// Initializes a new instance of . + /// Represents the project type that the evaluation ran on. + /// Represents the options used running the evaluation. + /// Keeps track of any properties unknown to the library. + internal UnknownEvaluationSummary(ProjectKind projectKind, EvaluationOptions evaluationOptions, IDictionary serializedAdditionalRawData) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownEvaluationSummary() + { + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs new file mode 100644 index 0000000000000..30e028e8e0968 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + internal partial class UnknownExportedProjectAssets : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ExportedProjectAssets IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + + internal static UnknownExportedProjectAssets DeserializeUnknownExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectKind"u8)) + { + projectKind = new ProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownExportedProjectAssets(projectKind, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ExportedProjectAssets IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedProjectAssets)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownExportedProjectAssets(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.cs new file mode 100644 index 0000000000000..4ae8fea0f5685 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Unknown version of ExportedProjectAssets. + internal partial class UnknownExportedProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal UnknownExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) : base(projectKind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownExportedProjectAssets() + { + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Warning.Serialization.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Warning.Serialization.cs new file mode 100644 index 0000000000000..46e02fff5d45a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Warning.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + public partial class Warning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Warning)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + Warning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Warning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWarning(document.RootElement, options); + } + + internal static Warning DeserializeWarning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Warning(code, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Warning)} does not support writing '{options.Format}' format."); + } + } + + Warning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWarning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Warning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Warning FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWarning(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Warning.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Warning.cs new file mode 100644 index 0000000000000..01f88b9a9785f --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/Warning.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Language.Authoring.Analyzetext.Models +{ + /// Represents a warning that was encountered while executing the request. + public partial class Warning + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The warning code. + /// The warning message. + /// or is null. + internal Warning(string code, string message) + { + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + } + + /// Initializes a new instance of . + /// The warning code. + /// The warning message. + /// Keeps track of any properties unknown to the library. + internal Warning(string code, string message, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Warning() + { + } + + /// The warning code. + public string Code { get; } + /// The warning message. + public string Message { get; } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextAnalysisAuthoring.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextAnalysisAuthoring.cs new file mode 100644 index 0000000000000..af0a26f8d7300 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextAnalysisAuthoring.cs @@ -0,0 +1,6850 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.AI.Language.Authoring.Analyzetext.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Authoring.Analyzetext +{ + // Data plane generated sub-client. + /// The TextAnalysisAuthoring sub-client. + public partial class TextAnalysisAuthoring + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of TextAnalysisAuthoring for mocking. + protected TextAnalysisAuthoring() + { + } + + /// Initializes a new instance of TextAnalysisAuthoring. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The key credential to copy. + /// The token credential to copy. + /// + /// Supported Cognitive Services endpoint (e.g., + /// https://<resource-name>.api.cognitiveservices.azure.com). + /// + /// The API version to use for this operation. + internal TextAnalysisAuthoring(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _keyCredential = keyCredential; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectAsync(projectName, context).ConfigureAwait(false); + return Response.FromValue(GetProjectResponse.FromResponse(response), response); + } + + /// Gets the details of a project. + /// The new project name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetProject(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProject(projectName, context); + return Response.FromValue(GetProjectResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetProjectAsync(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetProject(string projectName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] The most basic operation that applies to a resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateProjectAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] The most basic operation that applies to a resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateProject(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Generates a copy project operation authorization to the current target Azure + /// resource. + /// + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// + /// Whether to allow an existing project to be overwritten using the resulting copy + /// authorization. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CopyProjectAuthorizationAsync(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CopyProjectAuthorizationAsync(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context).ConfigureAwait(false); + return Response.FromValue(CopyProjectOptions.FromResponse(response), response); + } + + /// + /// Generates a copy project operation authorization to the current target Azure + /// resource. + /// + /// The new project name. + /// Represents the project kind. + /// The name of the storage container. + /// + /// Whether to allow an existing project to be overwritten using the resulting copy + /// authorization. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CopyProjectAuthorization(string projectName, ProjectKind projectKind, string storageInputContainerName = null, bool? allowOverwrite = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + CopyProjectAuthorizationRequest copyProjectAuthorizationRequest = new CopyProjectAuthorizationRequest(projectKind, storageInputContainerName, allowOverwrite, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CopyProjectAuthorization(projectName, copyProjectAuthorizationRequest.ToRequestContent(), context); + return Response.FromValue(CopyProjectOptions.FromResponse(response), response); + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure + /// resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CopyProjectAuthorizationAsync(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProjectAuthorization"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Generates a copy project operation authorization to the current target Azure + /// resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CopyProjectAuthorization(string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProjectAuthorization"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectAuthorizationRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetCopyProjectStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetCopyProjectStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetCopyProjectStatusResponse.FromResponse(response), response); + } + + /// Gets the status of an existing copy project job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetCopyProjectStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetCopyProjectStatus(projectName, jobId, context); + return Response.FromValue(GetCopyProjectStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetCopyProjectStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing copy project job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetCopyProjectStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetCopyProjectStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetCopyProjectStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDeploymentAsync(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentAsync(projectName, deploymentName, context).ConfigureAwait(false); + return Response.FromValue(GetDeploymentResponse.FromResponse(response), response); + } + + /// Gets the details of a deployment. + /// The new project name. + /// Represents deployment name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDeployment(string projectName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeployment(projectName, deploymentName, context); + return Response.FromValue(GetDeploymentResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDeploymentAsync(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDeployment(string projectName, string deploymentName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentRequest(projectName, deploymentName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentDeleteFromResourcesStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetDeploymentDeleteFromResourcesStatusResponse.FromResponse(response), response); + } + + /// Gets the status of an existing delete deployment from specific resources job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentDeleteFromResourcesStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(GetDeploymentDeleteFromResourcesStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDeploymentDeleteFromResourcesStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing delete deployment from specific resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDeploymentDeleteFromResourcesStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentDeleteFromResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentDeleteFromResourcesStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDeploymentStatusAsync(projectName, deploymentName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetDeploymentStatusResponse.FromResponse(response), response); + } + + /// Gets the status of an existing deployment job. + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDeploymentStatus(projectName, deploymentName, jobId, context); + return Response.FromValue(GetDeploymentStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDeploymentStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// Represents deployment name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDeploymentStatus(string projectName, string deploymentName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetDeploymentStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeploymentStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetSwapDeploymentsStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSwapDeploymentsStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetSwapDeploymentsStatusResponse.FromResponse(response), response); + } + + /// Gets the status of an existing swap deployment job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSwapDeploymentsStatus(projectName, jobId, context); + return Response.FromValue(GetSwapDeploymentsStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSwapDeploymentsStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing swap deployment job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSwapDeploymentsStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetSwapDeploymentsStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSwapDeploymentsStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the status of an export job. Once job completes, returns the project + /// metadata, and assets. + /// + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetExportStatusResponse.FromResponse(response), response); + } + + /// + /// Gets the status of an export job. Once job completes, returns the project + /// metadata, and assets. + /// + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportStatus(projectName, jobId, context); + return Response.FromValue(GetExportStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project + /// metadata, and assets. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetExportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an export job. Once job completes, returns the project + /// metadata, and assets. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetExportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportedModelAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelAsync(projectName, exportedModelName, context).ConfigureAwait(false); + return Response.FromValue(GetExportedModelResponse.FromResponse(response), response); + } + + /// Gets the details of an exported model. + /// The new project name. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportedModel(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModel(projectName, exportedModelName, context); + return Response.FromValue(GetExportedModelResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetExportedModelAsync(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetExportedModel(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelRequest(projectName, exportedModelName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelJobStatusAsync(projectName, exportedModelName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetExportedModelJobStatusResponse.FromResponse(response), response); + } + + /// Gets the status for an existing job to create or update an exported model. + /// The new project name. + /// The exported model name. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModelJobStatus(projectName, exportedModelName, jobId, context); + return Response.FromValue(GetExportedModelJobStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetExportedModelJobStatusAsync(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an existing job to create or update an exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The exported model name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetExportedModelJobStatus(string projectName, string exportedModelName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details and URL needed to download the exported model. + /// The name of the project to use. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetExportedModelManifestAsync(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetExportedModelManifestAsync(projectName, exportedModelName, context).ConfigureAwait(false); + return Response.FromValue(ExportedModelManifest.FromResponse(response), response); + } + + /// Gets the details and URL needed to download the exported model. + /// The name of the project to use. + /// The exported model name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetExportedModelManifest(string projectName, string exportedModelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetExportedModelManifest(projectName, exportedModelName, context); + return Response.FromValue(ExportedModelManifest.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details and URL needed to download the exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetExportedModelManifestAsync(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelManifest"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelManifestRequest(projectName, exportedModelName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details and URL needed to download the exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetExportedModelManifest(string projectName, string exportedModelName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetExportedModelManifest"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelManifestRequest(projectName, exportedModelName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetImportStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetImportStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetImportStatusResponse.FromResponse(response), response); + } + + /// Gets the status for an import. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetImportStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetImportStatus(projectName, jobId, context); + return Response.FromValue(GetImportStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetImportStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an import. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetImportStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetTrainedModelAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainedModelAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(GetTrainedModelResponse.FromResponse(response), response); + } + + /// Gets the details of a trained model. + /// The new project name. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainedModel(projectName, trainedModelLabel, context); + return Response.FromValue(GetTrainedModelResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the details of a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the details of a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTrainedModel(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainedModelRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteTrainedModelAsync(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteTrainedModel(string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteTrainedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteTrainedModelRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetEvaluationStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetEvaluationStatusResponse.FromResponse(response), response); + } + + /// Gets the status for an evaluation job. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetEvaluationStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(GetEvaluationStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetEvaluationStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for an evaluation job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetEvaluationStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetEvaluationStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetEvaluationStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the evaluation summary of a trained model. The summary includes high level + /// performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetModelEvaluationSummaryAsync(projectName, trainedModelLabel, context).ConfigureAwait(false); + return Response.FromValue(EvaluationSummary.FromResponse(response), response); + } + + /// + /// Gets the evaluation summary of a trained model. The summary includes high level + /// performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// The name of the project to use. + /// The trained model label. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetModelEvaluationSummary(projectName, trainedModelLabel, context); + return Response.FromValue(EvaluationSummary.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level + /// performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetModelEvaluationSummaryAsync(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the evaluation summary of a trained model. The summary includes high level + /// performance measurements of the model e.g., F1, Precision, Recall, etc. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetModelEvaluationSummary(string projectName, string trainedModelLabel, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetModelEvaluationSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetModelEvaluationSummaryRequest(projectName, trainedModelLabel, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetLoadSnapshotStatusAsync(projectName, trainedModelLabel, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetLoadSnapshotStatusResponse.FromResponse(response), response); + } + + /// Gets the status for loading a snapshot. + /// The new project name. + /// The trained model label. + /// The job ID. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetLoadSnapshotStatus(projectName, trainedModelLabel, jobId, context); + return Response.FromValue(GetLoadSnapshotStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetLoadSnapshotStatusAsync(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for loading a snapshot. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetLoadSnapshotStatus(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetLoadSnapshotStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetLoadSnapshotStatusRequest(projectName, trainedModelLabel, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAssignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetAssignDeploymentResourcesStatusResponse.FromResponse(response), response); + } + + /// Gets the status of an existing assign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAssignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(GetAssignDeploymentResourcesStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetAssignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing assign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetAssignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetAssignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an existing unassign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetUnassignDeploymentResourcesStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetUnassignDeploymentResourcesStatusResponse.FromResponse(response), response); + } + + /// Gets the status of an existing unassign deployment resources job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetUnassignDeploymentResourcesStatus(projectName, jobId, context); + return Response.FromValue(GetUnassignDeploymentResourcesStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetUnassignDeploymentResourcesStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status of an existing unassign deployment resources job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetUnassignDeploymentResourcesStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetUnassignDeploymentResourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUnassignDeploymentResourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetTrainingStatusAsync(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainingStatusAsync(projectName, jobId, context).ConfigureAwait(false); + return Response.FromValue(GetTrainingStatusResponse.FromResponse(response), response); + } + + /// Gets the status for a training job. + /// The new project name. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetTrainingStatus(string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainingStatus(projectName, jobId, context); + return Response.FromValue(GetTrainingStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTrainingStatusAsync(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTrainingStatus(string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetTrainingStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetProjectDeletionStatusAsync(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetProjectDeletionStatusAsync(jobId, context).ConfigureAwait(false); + return Response.FromValue(GetProjectDeletionStatusResponse.FromResponse(response), response); + } + + /// Gets the status for a project deletion job. + /// The job ID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetProjectDeletionStatus(string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetProjectDeletionStatus(jobId, context); + return Response.FromValue(GetProjectDeletionStatusResponse.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetProjectDeletionStatusAsync(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets the status for a project deletion job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetProjectDeletionStatus(string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetProjectsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", context); + } + + /// Lists the existing projects. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetProjects(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectMetadata.DeserializeProjectMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetProjectsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the existing projects. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetProjects(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetProjectsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetProjectsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetProjects", "value", "nextLink", context); + } + + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// Lists the deployments belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetDeployments(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectDeployment.DeserializeProjectDeployment(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetDeployments(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeployments", "value", "nextLink", context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// Lists the exported models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetExportedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ExportedTrainedModel.DeserializeExportedTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetExportedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the exported models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetExportedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetExportedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetExportedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetExportedModels", "value", "nextLink", context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// Lists the trained models belonging to a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetTrainedModels(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ProjectTrainedModel.DeserializeProjectTrainedModel(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTrainedModelsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the trained models belonging to a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTrainedModels(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainedModelsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainedModelsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainedModels", "value", "nextLink", context); + } + + /// + /// Gets the detailed results of the evaluation for a trained model. This includes + /// the raw inference results for the data included in the evaluation process. + /// + /// The new project name. + /// The trained model label. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DocumentEvaluationResult.DeserializeDocumentEvaluationResult(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// + /// Gets the detailed results of the evaluation for a trained model. This includes + /// the raw inference results for the data included in the evaluation process. + /// + /// The new project name. + /// The trained model label. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, StringIndexType stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DocumentEvaluationResult.DeserializeDocumentEvaluationResult(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes + /// the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit" + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetModelEvaluationResultsAsync(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Gets the detailed results of the evaluation for a trained model. This includes + /// the raw inference results for the data included in the evaluation process. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The trained model label. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit" + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetModelEvaluationResults(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetModelEvaluationResultsRequest(projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetModelEvaluationResultsNextPageRequest(nextLink, projectName, trainedModelLabel, stringIndexType, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetModelEvaluationResults", "value", "nextLink", context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// Lists the deployments resources assigned to the project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetDeploymentResources(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedDeploymentResource.DeserializeAssignedDeploymentResource(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetDeploymentResourcesAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments resources assigned to the project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetDeploymentResources(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDeploymentResourcesRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDeploymentResourcesNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetDeploymentResources", "value", "nextLink", context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// Lists the non-expired training jobs created for a project. + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetTrainingJobs(string projectName, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingJobState.DeserializeTrainingJobState(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTrainingJobsAsync(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the non-expired training jobs created for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The new project name. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTrainingJobs(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingJobsRequest(projectName, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingJobsNextPageRequest(nextLink, projectName, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingJobs", "value", "nextLink", context); + } + + /// + /// Lists the deployments to which an Azure resource is assigned. This doesn't + /// return deployments belonging to projects owned by this resource. It only + /// returns deployments belonging to projects owned by other resources. + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", context); + } + + /// + /// Lists the deployments to which an Azure resource is assigned. This doesn't + /// return deployments belonging to projects owned by this resource. It only + /// returns deployments belonging to projects owned by other resources. + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetAssignedResourceDeployments(int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't + /// return deployments belonging to projects owned by this resource. It only + /// returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetAssignedResourceDeploymentsAsync(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the deployments to which an Azure resource is assigned. This doesn't + /// return deployments belonging to projects owned by this resource. It only + /// returns deployments belonging to projects owned by other resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetAssignedResourceDeployments(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssignedResourceDeploymentsRequest(maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssignedResourceDeploymentsNextPageRequest(nextLink, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetAssignedResourceDeployments", "value", "nextLink", context); + } + + /// Lists the supported languages. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetSupportedLanguagesAsync(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind?.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => SupportedLanguage.DeserializeSupportedLanguage(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", context); + } + + /// Lists the supported languages. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetSupportedLanguages(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind?.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => SupportedLanguage.DeserializeSupportedLanguage(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported languages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetSupportedLanguagesAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported languages. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetSupportedLanguages(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedLanguagesRequest(projectKind, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedLanguagesNextPageRequest(nextLink, projectKind, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedLanguages", "value", "nextLink", context); + } + + /// + /// Lists the supported prebuilt entities that can be used while creating composed + /// entities. + /// + /// The cancellation token to use. + /// + public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => PrebuiltEntity.DeserializePrebuiltEntity(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// + /// Lists the supported prebuilt entities that can be used while creating composed + /// entities. + /// + /// The cancellation token to use. + /// + public virtual Pageable GetSupportedPrebuiltEntities(CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => PrebuiltEntity.DeserializePrebuiltEntity(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed + /// entities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetSupportedPrebuiltEntitiesAsync(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the supported prebuilt entities that can be used while creating composed + /// entities. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetSupportedPrebuiltEntities(RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSupportedPrebuiltEntitiesRequest(context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSupportedPrebuiltEntitiesNextPageRequest(nextLink, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetSupportedPrebuiltEntities", "value", "nextLink", context); + } + + /// Lists the support training config version for a given project type. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetTrainingConfigVersionsAsync(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind?.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TrainingConfigVersion.DeserializeTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", context); + } + + /// Lists the support training config version for a given project type. + /// The project kind, default value is CustomSingleLabelClassification. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetTrainingConfigVersions(ProjectKind? projectKind = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind?.ToString(), maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind?.ToString(), maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TrainingConfigVersion.DeserializeTrainingConfigVersion(e), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTrainingConfigVersionsAsync(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Lists the support training config version for a given project type. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The project kind, default value is CustomSingleLabelClassification. Allowed values: "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition" | "CustomAbstractiveSummarization" | "CustomHealthcare" | "CustomTextSentiment". + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTrainingConfigVersions(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTrainingConfigVersionsRequest(projectKind, maxCount, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTrainingConfigVersionsNextPageRequest(nextLink, projectKind, maxCount, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TextAnalysisAuthoring.GetTrainingConfigVersions", "value", "nextLink", context); + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task DeleteProjectAsync(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation DeleteProject(WaitUntil waitUntil, string projectName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Copies an existing project to another Azure resource. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, CopyProjectOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CopyProjectAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Copies an existing project to another Azure resource. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The copy project info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, CopyProjectOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CopyProject(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Copies an existing project to another Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task CopyProjectAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Copies an existing project to another Azure resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation CopyProject(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CopyProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a job to export a project's data. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. + /// + /// Kind of asset to export. + /// + /// Trained model label to export. If the trainedModelLabel is null, the default + /// behavior is to export the current working copy. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return await ExportAsync(waitUntil, projectName, stringIndexType.ToString(), assetKind, trainedModelLabel, context).ConfigureAwait(false); + } + + /// Triggers a job to export a project's data. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. + /// + /// Kind of asset to export. + /// + /// Trained model label to export. If the trainedModelLabel is null, the default + /// behavior is to export the current working copy. + /// + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation Export(WaitUntil waitUntil, string projectName, StringIndexType stringIndexType, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return Export(waitUntil, projectName, stringIndexType.ToString(), assetKind, trainedModelLabel, context); + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit" + /// + /// Kind of asset to export. + /// + /// Trained model label to export. If the trainedModelLabel is null, the default + /// behavior is to export the current working copy. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task ExportAsync(WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, assetKind, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to export a project's data. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// + /// Specifies the method used to interpret string offsets. For additional + /// information see https://aka.ms/text-analytics-offsets. Allowed values: "Utf16CodeUnit" + /// + /// Kind of asset to export. + /// + /// Trained model label to export. If the trainedModelLabel is null, the default + /// behavior is to export the current working copy. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation Export(WaitUntil waitUntil, string projectName, string stringIndexType, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, assetKind, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Export", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Triggers a job to import a project. If a project with the same name already + /// exists, the data of that project is replaced. + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The project data to import. + /// + /// The format of the project to import. The currently supported formats are json + /// and aml formats. If not provided, the default is set to json. + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, ExportedProject body, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await ImportAsync(waitUntil, projectName, content, format, context).ConfigureAwait(false); + } + + /// + /// Triggers a job to import a project. If a project with the same name already + /// exists, the data of that project is replaced. + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The project data to import. + /// + /// The format of the project to import. The currently supported formats are json + /// and aml formats. If not provided, the default is set to json. + /// + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation Import(WaitUntil waitUntil, string projectName, ExportedProject body, string format = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return Import(waitUntil, projectName, content, format, context); + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already + /// exists, the data of that project is replaced. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// + /// The format of the project to import. The currently supported formats are json + /// and aml formats. If not provided, the default is set to json. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task ImportAsync(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, format, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a job to import a project. If a project with the same name already + /// exists, the data of that project is replaced. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// + /// The format of the project to import. The currently supported formats are json + /// and aml formats. If not provided, the default is set to json. + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation Import(WaitUntil waitUntil, string projectName, RequestContent content, string format = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, format, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Import", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a training job for a project. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, TrainingJobOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await TrainAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.Train"); + } + + /// Triggers a training job for a project. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The training input parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation Train(WaitUntil waitUntil, string projectName, TrainingJobOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = Train(waitUntil, projectName, content, context); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.Train"); + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task> TrainAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a training job for a project. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation Train(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.Train", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new deployment or replaces an existing one. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeployProjectAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Creates a new deployment or replaces an existing one. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The new deployment info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, CreateDeploymentOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeployProject(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task DeployProjectAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new deployment or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation DeployProject(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeployProject", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task DeleteDeploymentAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes a project deployment. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation DeleteDeployment(WaitUntil waitUntil, string projectName, string deploymentName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeployment", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a project deployment from the specified assigned resources. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await DeleteDeploymentFromResourcesAsync(waitUntil, projectName, deploymentName, content, context).ConfigureAwait(false); + } + + /// Deletes a project deployment from the specified assigned resources. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The options for deleting the deployment. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, DeleteDeploymentOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return DeleteDeploymentFromResources(waitUntil, projectName, deploymentName, content, context); + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task DeleteDeploymentFromResourcesAsync(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Deletes a project deployment from the specified assigned resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation DeleteDeploymentFromResources(WaitUntil waitUntil, string projectName, string deploymentName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteDeploymentFromResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Swaps two existing deployments with each other. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, SwapDeploymentsOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await SwapDeploymentsAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// Swaps two existing deployments with each other. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The job object to swap two deployments. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, SwapDeploymentsOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return SwapDeployments(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task SwapDeploymentsAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Swaps two existing deployments with each other. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation SwapDeployments(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.SwapDeployments", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a new exported model or replaces an existing one. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await CreateOrUpdateExportedModelAsync(waitUntil, projectName, exportedModelName, content, context).ConfigureAwait(false); + } + + /// Creates a new exported model or replaces an existing one. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The exported model name. + /// The exported model info. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, ExportedModelOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return CreateOrUpdateExportedModel(waitUntil, projectName, exportedModelName, content, context); + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The exported model name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task CreateOrUpdateExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new exported model or replaces an existing one. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The exported model name. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation CreateOrUpdateExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CreateOrUpdateExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task DeleteExportedModelAsync(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Deletes an existing exported model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The exported model name. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation DeleteExportedModel(WaitUntil waitUntil, string projectName, string exportedModelName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(exportedModelName, nameof(exportedModelName)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.DeleteExportedModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers evaluation operation on a trained model. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await EvaluateModelAsync(waitUntil, projectName, trainedModelLabel, content, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel"); + } + + /// Triggers evaluation operation on a trained model. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The trained model label. + /// The training input parameters. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, EvaluationOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = EvaluateModel(waitUntil, projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.Convert(response, FetchEvaluationJobResultFromEvaluationJobState, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel"); + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The trained model label. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task> EvaluateModelAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers evaluation operation on a trained model. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The trained model label. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation EvaluateModel(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.EvaluateModel", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Long-running operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task LoadSnapshotAsync(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Long-running operation. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The trained model label. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation LoadSnapshot(WaitUntil waitUntil, string projectName, string trainedModelLabel, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(trainedModelLabel, nameof(trainedModelLabel)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.LoadSnapshot", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Assign new Azure resources to a project to allow deploying new deployments to + /// them. This API is available only via AAD authentication and not supported via + /// subscription key authentication. For more details about AAD authentication, + /// check here: + /// https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await AssignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// + /// Assign new Azure resources to a project to allow deploying new deployments to + /// them. This API is available only via AAD authentication and not supported via + /// subscription key authentication. For more details about AAD authentication, + /// check here: + /// https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The new project resources info. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, AssignDeploymentResourcesOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return AssignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to + /// them. This API is available only via AAD authentication and not supported via + /// subscription key authentication. For more details about AAD authentication, + /// check here: + /// https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task AssignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Assign new Azure resources to a project to allow deploying new deployments to + /// them. This API is available only via AAD authentication and not supported via + /// subscription key authentication. For more details about AAD authentication, + /// check here: + /// https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-azure-active-directory + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation AssignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.AssignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unassign resources from a project. This disallows deploying new deployments to + /// these resources, and deletes existing deployments assigned to them. + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return await UnassignDeploymentResourcesAsync(waitUntil, projectName, content, context).ConfigureAwait(false); + } + + /// + /// Unassign resources from a project. This disallows deploying new deployments to + /// these resources, and deletes existing deployments assigned to them. + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The info for the deployment resources to be deleted. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, UnassignDeploymentResourcesOptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(body, nameof(body)); + + using RequestContent content = body.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + return UnassignDeploymentResources(waitUntil, projectName, content, context); + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to + /// these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task UnassignDeploymentResourcesAsync(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Unassign resources from a project. This disallows deploying new deployments to + /// these resources, and deletes existing deployments assigned to them. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation UnassignDeploymentResources(WaitUntil waitUntil, string projectName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.UnassignDeploymentResources", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Triggers a cancellation for a running training job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await CancelTrainingJobAsync(waitUntil, projectName, jobId, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob"); + } + + /// Triggers a cancellation for a running training job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The job ID. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = CancelTrainingJob(waitUntil, projectName, jobId, context); + return ProtocolOperationHelpers.Convert(response, FetchTrainingJobResultFromTrainingJobState, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob"); + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task> CancelTrainingJobAsync(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Triggers a cancellation for a running training job. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The job ID. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation CancelTrainingJob(WaitUntil waitUntil, string projectName, string jobId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using var scope = ClientDiagnostics.CreateScope("TextAnalysisAuthoring.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "TextAnalysisAuthoring.CancelTrainingJob", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetProjectsRequest(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateProjectRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/merge-patch+json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteProjectRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCopyProjectAuthorizationRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:authorize-copy", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateCopyProjectRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:copy", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateExportRequest(string projectName, string stringIndexType, string assetKind, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:export", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (assetKind != null) + { + uri.AppendQuery("assetKind", assetKind, true); + } + if (trainedModelLabel != null) + { + uri.AppendQuery("trainedModelLabel", trainedModelLabel, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateImportRequest(string projectName, RequestContent content, string format, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:import", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (format != null) + { + request.Headers.Add("format", format); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateTrainRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:train", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetCopyProjectStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/copy/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentRequest(string projectName, string deploymentName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeployProjectRequest(string projectName, string deploymentName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteDeploymentRequest(string projectName, string deploymentName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteDeploymentFromResourcesRequest(string projectName, string deploymentName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/:delete-from-resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetDeploymentDeleteFromResourcesStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/delete-from-resources/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateSwapDeploymentsRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/:swap", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetSwapDeploymentsStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/swap/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/export/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateExportedModelRequest(string projectName, string exportedModelName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteExportedModelRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelJobStatusRequest(string projectName, string exportedModelName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelManifestRequest(string projectName, string exportedModelName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/exported-models/", false); + uri.AppendPath(exportedModelName, true); + uri.AppendPath("/manifest", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/import/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteTrainedModelRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateEvaluateModelRequest(string projectName, string trainedModelLabel, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:evaluate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateLoadSnapshotRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/:load-snapshot", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetEvaluationStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluate/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsRequest(string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/result", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationSummaryRequest(string projectName, string trainedModelLabel, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/evaluation/summary-result", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetLoadSnapshotStatusRequest(string projectName, string trainedModelLabel, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/models/", false); + uri.AppendPath(trainedModelLabel, true); + uri.AppendPath("/load-snapshot/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAssignDeploymentResourcesRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:assign", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateUnassignDeploymentResourcesRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/:unassign", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAssignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/assign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetUnassignDeploymentResourcesStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/resources/unassign/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsRequest(string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCancelTrainingJobRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/train/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath("/:cancel", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectDeletionStatusRequest(string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/deletion-jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssignedResourceDeploymentsRequest(int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/deployments/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedLanguagesRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/languages", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (projectKind != null) + { + uri.AppendQuery("projectKind", projectKind, true); + } + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedPrebuiltEntitiesRequest(RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/prebuilt-entities", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingConfigVersionsRequest(string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/authoring/analyze-text/projects/global/training-config-versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (projectKind != null) + { + uri.AppendQuery("projectKind", projectKind, true); + } + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetExportedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainedModelsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetModelEvaluationResultsNextPageRequest(string nextLink, string projectName, string trainedModelLabel, string stringIndexType, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDeploymentResourcesNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingJobsNextPageRequest(string nextLink, string projectName, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssignedResourceDeploymentsNextPageRequest(string nextLink, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedLanguagesNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSupportedPrebuiltEntitiesNextPageRequest(string nextLink, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTrainingConfigVersionsNextPageRequest(string nextLink, string projectKind, int? maxCount, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + + private TrainingJobResult FetchTrainingJobResultFromTrainingJobState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return TrainingJobResult.DeserializeTrainingJobResult(resultJsonElement); + } + + private EvaluationJobResult FetchEvaluationJobResultFromEvaluationJobState(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return EvaluationJobResult.DeserializeEvaluationJobResult(resultJsonElement); + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextClient.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextClient.cs new file mode 100644 index 0000000000000..e4eb2a73e6562 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextClient.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Authoring.Analyzetext +{ + // Data plane generated client. + /// + /// The language service API is a suite of natural language processing (NLP) skills + /// built with best-in-class Microsoft machine learning algorithms. The API can be + /// used to analyze unstructured text for tasks such as sentiment analysis, key + /// phrase extraction, language detection and question answering. Further + /// documentation can be found in <a + /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview">https://docs.microsoft.com/en-us/azure/cognitive-services/language-service/overview</a>. + /// + public partial class TextClient + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of TextClient for mocking. + protected TextClient() + { + } + + /// Initializes a new instance of TextClient. + /// + /// Supported Cognitive Services endpoint (e.g., + /// https://<resource-name>.api.cognitiveservices.azure.com). + /// + /// A credential used to authenticate to an Azure Service. + /// or is null. + public TextClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new TextClientOptions()) + { + } + + /// Initializes a new instance of TextClient. + /// + /// Supported Cognitive Services endpoint (e.g., + /// https://<resource-name>.api.cognitiveservices.azure.com). + /// + /// A credential used to authenticate to an Azure Service. + /// or is null. + public TextClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new TextClientOptions()) + { + } + + /// Initializes a new instance of TextClient. + /// + /// Supported Cognitive Services endpoint (e.g., + /// https://<resource-name>.api.cognitiveservices.azure.com). + /// + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public TextClient(Uri endpoint, AzureKeyCredential credential, TextClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new TextClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of TextClient. + /// + /// Supported Cognitive Services endpoint (e.g., + /// https://<resource-name>.api.cognitiveservices.azure.com). + /// + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public TextClient(Uri endpoint, TokenCredential credential, TextClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new TextClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of TextAnalysisAuthoring. + /// The API version to use for this operation. + /// is null. + public virtual TextAnalysisAuthoring GetTextAnalysisAuthoringClient(string apiVersion = "2024-11-15-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new TextAnalysisAuthoring(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextClientOptions.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextClientOptions.cs new file mode 100644 index 0000000000000..cf4385812835d --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextClientOptions.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.AI.Language.Authoring.Analyzetext +{ + /// Client options for TextClient. + public partial class TextClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_11_15_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2023-04-01". + V2023_04_01 = 1, + /// Service version "2023-04-15-preview". + V2023_04_15_Preview = 2, + /// Service version "2024-11-15-preview". + V2024_11_15_Preview = 3, + } + + internal string Version { get; } + + /// Initializes new instance of TextClientOptions. + public TextClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_04_01 => "2023-04-01", + ServiceVersion.V2023_04_15_Preview => "2023-04-15-preview", + ServiceVersion.V2024_11_15_Preview => "2024-11-15-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Properties/AssemblyInfo.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..07c8b23c4afef --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.AI.Language.Authoring.Analyzetext.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tests/Azure.AI.Language.Authoring.Analyzetext.Tests.csproj b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tests/Azure.AI.Language.Authoring.Analyzetext.Tests.csproj new file mode 100644 index 0000000000000..f5fa6f6d6fffa --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tests/Azure.AI.Language.Authoring.Analyzetext.Tests.csproj @@ -0,0 +1,20 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs new file mode 100644 index 0000000000000..7db4eebd3a74a --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs @@ -0,0 +1,6284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.AI.Language.Authoring.Analyzetext.Models; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.AI.Language.Authoring.Analyzetext.Samples +{ + public partial class Samples_TextAnalysisAuthoring + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_CreateProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }); + Response response = client.CreateProject("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_CreateProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }); + Response response = await client.CreateProjectAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_CreateProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }); + Response response = client.CreateProject("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_CreateProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }); + Response response = await client.CreateProjectAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + }); + Response response = client.CopyProjectAuthorization("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + }); + Response response = await client.CopyProjectAuthorizationAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + allowOverwrite = true, + }); + Response response = client.CopyProjectAuthorization("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + allowOverwrite = true, + }); + Response response = await client.CopyProjectAuthorizationAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("targetProjectName").ToString()); + Console.WriteLine(result.GetProperty("accessToken").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("targetResourceId").ToString()); + Console.WriteLine(result.GetProperty("targetResourceRegion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.CopyProjectAuthorization("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.CustomSingleLabelClassification, storageInputContainerName: "", allowOverwrite: true); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("resultUrl").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("resultUrl").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelManifest("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelManifestAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelManifest("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelManifestAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelManifest("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelManifestAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("modelFiles")[0].GetProperty("contentUri").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelManifest("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetExportedModelManifest_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelManifestAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.DeleteTrainedModel("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.DeleteTrainedModelAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.DeleteTrainedModel("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.DeleteTrainedModelAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringUnassignDeploymentResourcesJobState_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeletionJobState_GetProjectDeletionStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetProjects(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectMetadata item in client.GetProjects()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectMetadata item in client.GetProjectsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("amlProjectPath").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("isLabelingLocked").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("runGptPredictions").ToString()); + Console.WriteLine(result.GetProperty("settings").GetProperty("gptPredictiveLookahead").ToString()); + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("multilingual").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeployments("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectDeployment item in client.GetDeployments("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("resourceId").ToString()); + Console.WriteLine(result.GetProperty("assignedResources")[0].GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetExportedModels("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetExportedModelsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ExportedTrainedModel item in client.GetExportedModels("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetExportedModels("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetExportedModelsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("exportedModelName").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastExportedModelDateTime").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ExportedTrainedModel item in client.GetExportedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainedModels("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainedModelsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectTrainedModel item in client.GetTrainedModels("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainedModels("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainedModelsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("label").ToString()); + Console.WriteLine(result.GetProperty("modelId").ToString()); + Console.WriteLine(result.GetProperty("lastTrainedDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastTrainingDurationInSeconds").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("modelTrainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("hasSnapshot").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectTrainedModel item in client.GetTrainedModels("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectKind").ToString()); + Console.WriteLine(result.GetProperty("location").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (DocumentEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringDocumentEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (DocumentEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeploymentResources("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetDeploymentResources("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentResourcesAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("azureResourceId").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedDeploymentResource item in client.GetDeploymentResources("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingJobs("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingJobsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingJobState item in client.GetTrainingJobs("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingJobs("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingJobsAsync("", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("warnings")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("result").GetProperty("estimatedEndDateTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingJobState item in client.GetTrainingJobs("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingJobState item in client.GetTrainingJobsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetAssignedResourceDeployments(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetAssignedResourceDeployments(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeployments(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringAssignedProjectDeploymentsMetadata_GetAssignedResourceDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedProjectDeploymentsMetadata item in client.GetAssignedResourceDeploymentsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetSupportedLanguages(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetSupportedLanguagesAsync(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (SupportedLanguage item in client.GetSupportedLanguages()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetSupportedLanguages("CustomSingleLabelClassification", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetSupportedLanguagesAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("languageCode").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (SupportedLanguage item in client.GetSupportedLanguages(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringSupportedLanguage_GetSupportedLanguages_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (SupportedLanguage item in client.GetSupportedLanguagesAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetSupportedPrebuiltEntities(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetSupportedPrebuiltEntitiesAsync(null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("examples").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntities()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringPrebuiltEntity_GetSupportedPrebuiltEntities_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (PrebuiltEntity item in client.GetSupportedPrebuiltEntitiesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingConfigVersions(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetTrainingConfigVersions("CustomSingleLabelClassification", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetTrainingConfigVersionsAsync("CustomSingleLabelClassification", 1234, 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("modelExpirationDate").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingConfigVersion item in client.GetTrainingConfigVersions(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoringTrainingConfigVersion_GetTrainingConfigVersions_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingConfigVersion item in client.GetTrainingConfigVersionsAsync(projectKind: ProjectKind.CustomSingleLabelClassification, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteProject(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteProject(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = client.CopyProject(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectOptions body = new CopyProjectOptions( + ProjectKind.CustomSingleLabelClassification, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = client.CopyProject(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectOptions body = new CopyProjectOptions( + ProjectKind.CustomSingleLabelClassification, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = client.CopyProject(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "CustomSingleLabelClassification", + targetProjectName = "", + accessToken = "", + expiresAt = "2022-05-10T18:57:31.2311892Z", + targetResourceId = "", + targetResourceRegion = "", + }); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CopyProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectOptions body = new CopyProjectOptions( + ProjectKind.CustomSingleLabelClassification, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = client.CopyProject(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CopyProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectOptions body = new CopyProjectOptions( + ProjectKind.CustomSingleLabelClassification, + "", + "", + DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"), + "", + ""); + Operation operation = await client.CopyProjectAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Export_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Export_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Export_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Export_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Export_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Export_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Export_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Export_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Import_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }, + }); + Operation operation = client.Import(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Import_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + projectName = "", + language = "", + }, + }); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Import_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectOptions(ProjectKind.CustomSingleLabelClassification, "", "", "")); + Operation operation = client.Import(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Import_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectOptions(ProjectKind.CustomSingleLabelClassification, "", "", "")); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Import_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + documents = new object[] + { +new +{ +summaryLocation = "", +location = "", +language = "", +dataset = "", +} + }, + projectKind = "CustomAbstractiveSummarization", + }, + }); + Operation operation = client.Import(WaitUntil.Completed, "", content, format: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Import_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "CustomSingleLabelClassification", + storageInputContainerName = "", + settings = new + { + confidenceThreshold = 123.45F, + amlProjectPath = "", + isLabelingLocked = true, + runGptPredictions = true, + gptPredictiveLookahead = 1234, + }, + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + documents = new object[] + { +new +{ +summaryLocation = "", +location = "", +language = "", +dataset = "", +} + }, + projectKind = "CustomAbstractiveSummarization", + }, + }); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, format: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Import_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectOptions(ProjectKind.CustomSingleLabelClassification, "", "", "") + { + Settings = new ProjectSettings + { + ConfidenceThreshold = 123.45F, + AmlProjectPath = "", + IsLabelingLocked = true, + RunGptPredictions = true, + GptPredictiveLookahead = 1234, + }, + Multilingual = true, + Description = "", + }) + { + Assets = new ExportedCustomAbstractiveSummarizationProjectAssets + { + Documents = {new ExportedCustomAbstractiveSummarizationDocument("") +{ +Location = "", +Language = "", +Dataset = "", +}}, + }, + }; + Operation operation = client.Import(WaitUntil.Completed, "", body, format: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Import_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectOptions(ProjectKind.CustomSingleLabelClassification, "", "", "") + { + Settings = new ProjectSettings + { + ConfidenceThreshold = 123.45F, + AmlProjectPath = "", + IsLabelingLocked = true, + RunGptPredictions = true, + GptPredictiveLookahead = 1234, + }, + Multilingual = true, + Description = "", + }) + { + Assets = new ExportedCustomAbstractiveSummarizationProjectAssets + { + Documents = {new ExportedCustomAbstractiveSummarizationDocument("") +{ +Location = "", +Language = "", +Dataset = "", +}}, + }, + }; + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, format: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Train_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + }); + Operation operation = client.Train(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Train_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + }); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Train_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobOptions body = new TrainingJobOptions("", ""); + Operation operation = client.Train(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Train_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobOptions body = new TrainingJobOptions("", ""); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Train_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + dataGenerationSettings = new + { + enableDataGeneration = true, + dataGenerationConnectionInfo = new + { + kind = "azureOpenAI", + resourceId = "", + deploymentName = "", + }, + }, + }); + Operation operation = client.Train(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Train_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + dataGenerationSettings = new + { + enableDataGeneration = true, + dataGenerationConnectionInfo = new + { + kind = "azureOpenAI", + resourceId = "", + deploymentName = "", + }, + }, + }); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_Train_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobOptions body = new TrainingJobOptions("", "") + { + EvaluationOptions = new EvaluationOptions + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), + }; + Operation operation = client.Train(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_Train_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobOptions body = new TrainingJobOptions("", "") + { + EvaluationOptions = new EvaluationOptions + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + DataGenerationSettings = new DataGenerationSettings(true, new DataGenerationConnectionInfo("", "")), + }; + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeployProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeployProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeployProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentOptions body = new CreateDeploymentOptions(""); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeployProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentOptions body = new CreateDeploymentOptions(""); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeployProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeployProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeployProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentOptions body = new CreateDeploymentOptions("") + { + AssignedResourceIds = { "" }, + }; + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeployProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentOptions body = new CreateDeploymentOptions("") + { + AssignedResourceIds = { "" }, + }; + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeployment_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeployment_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeployment_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeployment_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentOptions body = new DeleteDeploymentOptions(); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentOptions body = new DeleteDeploymentOptions(); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentOptions body = new DeleteDeploymentOptions + { + AssignedResourceIds = { "" }, + }; + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentOptions body = new DeleteDeploymentOptions + { + AssignedResourceIds = { "" }, + }; + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsOptions body = new SwapDeploymentsOptions("", ""); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_SwapDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsOptions body = new SwapDeploymentsOptions("", ""); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_SwapDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_SwapDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + firstDeploymentName = "", + secondDeploymentName = "", + }); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_SwapDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsOptions body = new SwapDeploymentsOptions("", ""); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_SwapDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsOptions body = new SwapDeploymentsOptions("", ""); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelOptions body = new ExportedModelOptions(""); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelOptions body = new ExportedModelOptions(""); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + trainedModelLabel = "", + }); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelOptions body = new ExportedModelOptions(""); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelOptions body = new ExportedModelOptions(""); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_DeleteExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_DeleteExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationOptions body = new EvaluationOptions(); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_EvaluateModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationOptions body = new EvaluationOptions(); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_EvaluateModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_EvaluateModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("trainingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("evaluationOptions").GetProperty("testingSplitPercentage").ToString()); + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("percentComplete").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_EvaluateModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationOptions body = new EvaluationOptions + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }; + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_EvaluateModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationOptions body = new EvaluationOptions + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }; + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_LoadSnapshot_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_LoadSnapshot_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_LoadSnapshot_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_LoadSnapshot_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesOptions body = new AssignDeploymentResourcesOptions(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesOptions body = new AssignDeploymentResourcesOptions(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + resourcesMetadata = new object[] + { +new +{ +azureResourceId = "", +customDomain = "", +region = "", +} + }, + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesOptions body = new AssignDeploymentResourcesOptions(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_AssignDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesOptions body = new AssignDeploymentResourcesOptions(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesOptions body = new UnassignDeploymentResourcesOptions(new string[] { "" }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesOptions body = new UnassignDeploymentResourcesOptions(new string[] { "" }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + assignedResourceIds = new object[] + { +"" + }, + }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesOptions body = new UnassignDeploymentResourcesOptions(new string[] { "" }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesOptions body = new UnassignDeploymentResourcesOptions(new string[] { "" }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", "", null); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("modelLabel").ToString()); + Console.WriteLine(result.GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("trainingStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("percentComplete").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("startDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("endDateTime").ToString()); + Console.WriteLine(result.GetProperty("evaluationStatus").GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("estimatedEndDateTime").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.CancelTrainingJob(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TextAnalysisAuthoring_CancelTrainingJob_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisAuthoring client = new TextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + } +} diff --git a/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tsp-location.yaml b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tsp-location.yaml new file mode 100644 index 0000000000000..2441357b747cf --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/Azure.AI.Language.Authoring.Analyzetext/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/Language.AnalyzeText-authoring +commit: 11ee10edbbbea725125259fe527bf865e62f2e4a +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/cognitivelanguage/authoring/analyzetext/ci.yml b/sdk/cognitivelanguage/authoring/analyzetext/ci.yml new file mode 100644 index 0000000000000..92c3f9bb8b3e0 --- /dev/null +++ b/sdk/cognitivelanguage/authoring/analyzetext/ci.yml @@ -0,0 +1,35 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/analyzetext + - sdk/analyzetext/ci.yml + - sdk/analyzetext/Azure.AI.Language.Authoring.Analyzetext + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analyzetext + - sdk/analyzetext/ci.yml + - sdk/analyzetext/Azure.AI.Language.Authoring.Analyzetext + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: analyzetext + ArtifactName: packages + Artifacts: + - name: Azure.AI.Language.Authoring.Analyzetext + safeName: AzureAILanguageAuthoringAnalyzetext