From a6b228350ed84930ebef002a0ec5179d3359cb23 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 5 Nov 2024 04:05:38 +0000 Subject: [PATCH] CodeGen from PR 3558 in test-repo-billy/azure-rest-api-specs Merge ce424db77e47cedea9e19d1435050f020b7e64d8 into 7b5d4fa50d1365f0e981b995c60da3ac591c6bba --- ...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 ++++ .../src/Generated/AnalyzetextClient.cs | 115 + .../src/Generated/AnalyzetextClientOptions.cs | 43 + .../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 + ...DeploymentResourcesConfig.Serialization.cs | 145 + .../Models/AssignDeploymentResourcesConfig.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 + .../Models/CopyProjectConfig.Serialization.cs | 182 + .../src/Generated/Models/CopyProjectConfig.cs | 111 + .../CreateDeploymentConfig.Serialization.cs | 160 + .../Models/CreateDeploymentConfig.cs | 88 + .../CreateProjectConfig.Serialization.cs | 208 + .../Generated/Models/CreateProjectConfig.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 + .../DeleteDeploymentConfig.Serialization.cs | 152 + .../Models/DeleteDeploymentConfig.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 + .../src/Generated/Models/ErrorCode.cs | 99 + .../Models/EvaluationConfig.Serialization.cs | 172 + .../src/Generated/Models/EvaluationConfig.cs | 91 + .../EvaluationJobResult.Serialization.cs | 159 + .../Generated/Models/EvaluationJobResult.cs | 95 + .../src/Generated/Models/EvaluationKind.cs | 54 + .../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 + .../ExportedModelConfig.Serialization.cs | 135 + .../Generated/Models/ExportedModelConfig.cs | 75 + .../ExportedModelManifest.Serialization.cs | 145 + .../Generated/Models/ExportedModelManifest.cs | 76 + .../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 + ...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 + .../SwapDeploymentsConfig.Serialization.cs | 143 + .../Generated/Models/SwapDeploymentsConfig.cs | 82 + ...extAnalysisAuthoringError.Serialization.cs | 200 + .../Models/TextAnalysisAuthoringError.cs | 100 + .../Models/TextAnalysisAuthoringSentiment.cs | 54 + ...tAnalysisAuthoringWarning.Serialization.cs | 143 + .../Models/TextAnalysisAuthoringWarning.cs | 82 + ...entimentEvaluationSummary.Serialization.cs | 191 + .../Models/TextSentimentEvaluationSummary.cs | 147 + .../TrainingConfigVersion.Serialization.cs | 143 + .../Generated/Models/TrainingConfigVersion.cs | 81 + .../Models/TrainingJobConfig.Serialization.cs | 173 + .../src/Generated/Models/TrainingJobConfig.cs | 98 + .../Models/TrainingJobResult.Serialization.cs | 187 + .../src/Generated/Models/TrainingJobResult.cs | 97 + .../Models/TrainingJobState.Serialization.cs | 241 + .../src/Generated/Models/TrainingJobState.cs | 114 + ...DeploymentResourcesConfig.Serialization.cs | 145 + .../UnassignDeploymentResourcesConfig.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 + .../src/Generated/TextAnalysisAuthoring.cs | 6850 +++++++++++++++++ .../src/Properties/AssemblyInfo.cs | 11 + ...anguage.Authoring.Analyzetext.Tests.csproj | 20 + .../Samples/Samples_TextAnalysisAuthoring.cs | 6284 +++++++++++++++ .../tsp-location.yaml | 4 + ...re.AI.Language.Authoring.Conversations.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 107 + ...AI.Language.Authoring.Conversations.csproj | 20 + ...ingConversationsClientBuilderExtensions.cs | 52 + ...guageAuthoringConversationsModelFactory.cs | 1111 +++ .../ConversationalAnalysisAuthoring.cs | 6775 ++++++++++++++++ .../src/Generated/ConversationsClient.cs | 115 + .../Generated/ConversationsClientOptions.cs | 43 + .../Docs/ConversationalAnalysisAuthoring.xml | 5847 ++++++++++++++ .../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 + ...DeploymentResourcesConfig.Serialization.cs | 145 + .../Models/AssignDeploymentResourcesConfig.cs | 76 + ...ssignedDeploymentResource.Serialization.cs | 143 + .../Models/AssignedDeploymentResource.cs | 82 + ...ProjectDeploymentMetadata.Serialization.cs | 151 + .../AssignedProjectDeploymentMetadata.cs | 87 + ...rojectDeploymentsMetadata.Serialization.cs | 153 + .../AssignedProjectDeploymentsMetadata.cs | 83 + ...sourceDeploymentsMetadata.Serialization.cs | 156 + .../AssignedResourceDeploymentsMetadata.cs | 80 + ...thoringConversationsError.Serialization.cs | 200 + .../Models/AuthoringConversationsError.cs | 100 + ...oringConversationsWarning.Serialization.cs | 143 + .../Models/AuthoringConversationsWarning.cs | 82 + .../Generated/Models/CompositionSetting.cs | 70 + .../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 + ...onversationExportedEntity.Serialization.cs | 237 + .../Models/ConversationExportedEntity.cs | 97 + ...onversationExportedIntent.Serialization.cs | 135 + .../Models/ConversationExportedIntent.cs | 75 + ...tionExportedProjectAssets.Serialization.cs | 210 + .../ConversationExportedProjectAssets.cs | 45 + ...ersationExportedUtterance.Serialization.cs | 196 + .../Models/ConversationExportedUtterance.cs | 103 + ...ojectAuthorizationRequest.Serialization.cs | 161 + .../Models/CopyProjectAuthorizationRequest.cs | 80 + .../Models/CopyProjectConfig.Serialization.cs | 182 + .../src/Generated/Models/CopyProjectConfig.cs | 111 + .../CreateDeploymentConfig.Serialization.cs | 160 + .../Models/CreateDeploymentConfig.cs | 88 + .../CreateProjectConfig.Serialization.cs | 211 + .../Generated/Models/CreateProjectConfig.cs | 104 + .../DeleteDeploymentConfig.Serialization.cs | 152 + .../Models/DeleteDeploymentConfig.cs | 78 + .../DeploymentResource.Serialization.cs | 143 + .../Generated/Models/DeploymentResource.cs | 82 + ...EntitiesEvaluationSummary.Serialization.cs | 211 + .../Models/EntitiesEvaluationSummary.cs | 166 + .../EntityEvaluationSummary.Serialization.cs | 191 + .../Models/EntityEvaluationSummary.cs | 108 + .../src/Generated/Models/ErrorCode.cs | 99 + .../Models/EvaluationConfig.Serialization.cs | 172 + .../src/Generated/Models/EvaluationConfig.cs | 91 + .../EvaluationJobResult.Serialization.cs | 159 + .../Generated/Models/EvaluationJobResult.cs | 95 + .../src/Generated/Models/EvaluationKind.cs | 54 + .../Models/EvaluationSummary.Serialization.cs | 158 + .../src/Generated/Models/EvaluationSummary.cs | 86 + ...ConversationOrchestration.Serialization.cs | 143 + .../ExportedConversationOrchestration.cs | 82 + ...sationOrchestrationConfig.Serialization.cs | 143 + ...ExportedConversationOrchestrationConfig.cs | 44 + .../ExportedEntityList.Serialization.cs | 152 + .../Generated/Models/ExportedEntityList.cs | 66 + ...ExportedEntityListSynonym.Serialization.cs | 163 + .../Models/ExportedEntityListSynonym.cs | 78 + .../ExportedEntityRegex.Serialization.cs | 152 + .../Generated/Models/ExportedEntityRegex.cs | 74 + ...rtedEntityRegexExpression.Serialization.cs | 160 + .../Models/ExportedEntityRegexExpression.cs | 85 + .../ExportedEntitySublist.Serialization.cs | 163 + .../Generated/Models/ExportedEntitySublist.cs | 70 + ...ExportedLuisOrchestration.Serialization.cs | 157 + .../Models/ExportedLuisOrchestration.cs | 80 + ...edLuisOrchestrationConfig.Serialization.cs | 143 + .../Models/ExportedLuisOrchestrationConfig.cs | 44 + .../ExportedModelConfig.Serialization.cs | 135 + .../Generated/Models/ExportedModelConfig.cs | 75 + ...portedOrchestrationConfig.Serialization.cs | 128 + .../Models/ExportedOrchestrationConfig.cs | 69 + .../ExportedPrebuiltEntity.Serialization.cs | 135 + .../Models/ExportedPrebuiltEntity.cs | 75 + .../Models/ExportedProject.Serialization.cs | 166 + .../src/Generated/Models/ExportedProject.cs | 109 + .../ExportedProjectAssets.Serialization.cs | 127 + .../Generated/Models/ExportedProjectAssets.cs | 69 + .../Generated/Models/ExportedProjectFormat.cs | 51 + ...ionAnsweringOrchestration.Serialization.cs | 135 + .../ExportedQuestionAnsweringOrchestration.cs | 75 + ...weringOrchestrationConfig.Serialization.cs | 143 + ...tedQuestionAnsweringOrchestrationConfig.cs | 44 + .../ExportedTrainedModel.Serialization.cs | 182 + .../Generated/Models/ExportedTrainedModel.cs | 107 + ...ortedUtteranceEntityLabel.Serialization.cs | 151 + .../Models/ExportedUtteranceEntityLabel.cs | 87 + ...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 + ...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 + .../IntentEvaluationSummary.Serialization.cs | 191 + .../Models/IntentEvaluationSummary.cs | 108 + .../IntentsEvaluationSummary.Serialization.cs | 211 + .../Models/IntentsEvaluationSummary.cs | 166 + .../src/Generated/Models/JobStatus.cs | 66 + ...chestrationExportedIntent.Serialization.cs | 150 + .../Models/OrchestrationExportedIntent.cs | 87 + ...tionExportedProjectAssets.Serialization.cs | 185 + .../OrchestrationExportedProjectAssets.cs | 40 + ...strationExportedUtterance.Serialization.cs | 165 + .../Models/OrchestrationExportedUtterance.cs | 98 + .../Models/OrchestrationTargetProjectKind.cs | 54 + .../Models/PrebuiltEntities.Serialization.cs | 156 + .../src/Generated/Models/PrebuiltEntities.cs | 80 + .../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 | 54 + .../Models/ProjectMetadata.Serialization.cs | 261 + .../src/Generated/Models/ProjectMetadata.cs | 124 + .../Models/ProjectSettings.Serialization.cs | 135 + .../src/Generated/Models/ProjectSettings.cs | 72 + .../ProjectTrainedModel.Serialization.cs | 191 + .../Generated/Models/ProjectTrainedModel.cs | 113 + .../Models/ResourceMetadata.Serialization.cs | 151 + .../src/Generated/Models/ResourceMetadata.cs | 89 + .../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 + .../SupportedLanguages.Serialization.cs | 156 + .../Generated/Models/SupportedLanguages.cs | 80 + .../SwapDeploymentsConfig.Serialization.cs | 143 + .../Generated/Models/SwapDeploymentsConfig.cs | 82 + .../TrainingConfigVersion.Serialization.cs | 143 + .../Generated/Models/TrainingConfigVersion.cs | 81 + .../TrainingConfigVersions.Serialization.cs | 156 + .../Models/TrainingConfigVersions.cs | 80 + .../Models/TrainingJobConfig.Serialization.cs | 169 + .../src/Generated/Models/TrainingJobConfig.cs | 103 + .../Models/TrainingJobResult.Serialization.cs | 203 + .../src/Generated/Models/TrainingJobResult.cs | 101 + .../Models/TrainingJobState.Serialization.cs | 241 + .../src/Generated/Models/TrainingJobState.cs | 114 + .../src/Generated/Models/TrainingMode.cs | 54 + ...DeploymentResourcesConfig.Serialization.cs | 145 + .../UnassignDeploymentResourcesConfig.cs | 76 + ...portedOrchestrationConfig.Serialization.cs | 135 + .../UnknownExportedOrchestrationConfig.cs | 28 + ...nownExportedProjectAssets.Serialization.cs | 135 + .../Models/UnknownExportedProjectAssets.cs | 28 + ...eEntitiesEvaluationResult.Serialization.cs | 163 + .../UtteranceEntitiesEvaluationResult.cs | 86 + ...nceEntityEvaluationResult.Serialization.cs | 151 + .../Models/UtteranceEntityEvaluationResult.cs | 87 + ...UtteranceEvaluationResult.Serialization.cs | 159 + .../Models/UtteranceEvaluationResult.cs | 108 + ...ceIntentsEvaluationResult.Serialization.cs | 143 + .../UtteranceIntentsEvaluationResult.cs | 85 + .../src/Properties/AssemblyInfo.cs | 11 + ...guage.Authoring.Conversations.Tests.csproj | 20 + ...Samples_ConversationalAnalysisAuthoring.cs | 6402 +++++++++++++++ .../tsp-location.yaml | 4 + 461 files changed, 96453 insertions(+) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/Azure.AI.Language.Authoring.Analyzetext.sln create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/CHANGELOG.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/Directory.Build.props create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/README.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Azure.AI.Language.Authoring.Analyzetext.csproj create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextClientBuilderExtensions.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextModelFactory.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AnalyzetextClient.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AnalyzetextClientOptions.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Docs/TextAnalysisAuthoring.xml create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Argument.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Optional.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CompositionSetting.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfoKind.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ErrorCode.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationKind.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorCode.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/JobStatus.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectKind.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/StringIndexType.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringError.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringError.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringSentiment.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringWarning.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringWarning.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextAnalysisAuthoring.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Properties/AssemblyInfo.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/tests/Azure.AI.Language.Authoring.Analyzetext.Tests.csproj create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/tsp-location.yaml create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/Azure.AI.Language.Authoring.Conversations.sln create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/CHANGELOG.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/Directory.Build.props create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/README.md create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Azure.AI.Language.Authoring.Conversations.csproj create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/AILanguageAuthoringConversationsClientBuilderExtensions.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/AILanguageAuthoringConversationsModelFactory.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationalAnalysisAuthoring.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationsClient.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationsClientOptions.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Docs/ConversationalAnalysisAuthoring.xml create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/Argument.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/Optional.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignDeploymentResourcesConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignDeploymentResourcesConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedDeploymentResource.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedDeploymentResource.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentMetadata.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsError.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsError.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsWarning.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsWarning.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CompositionSetting.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrix.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrix.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixCell.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixCell.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixRow.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixRow.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedEntity.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedIntent.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedIntent.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedUtterance.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedUtterance.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectAuthorizationRequest.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateDeploymentConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateDeploymentConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateProjectConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateProjectConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeleteDeploymentConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeleteDeploymentConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeploymentResource.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeploymentResource.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntitiesEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntityEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntityEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ErrorCode.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationJobResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationJobResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationKind.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestration.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestration.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestrationConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestrationConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityList.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityList.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityListSynonym.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegex.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegex.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegexExpression.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegexExpression.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntitySublist.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntitySublist.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestration.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestration.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestrationConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestrationConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedModelConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedModelConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedOrchestrationConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedOrchestrationConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedPrebuiltEntity.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProject.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProject.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectFormat.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestration.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestrationConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestrationConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedTrainedModel.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedTrainedModel.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedUtteranceEntityLabel.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedUtteranceEntityLabel.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetCopyProjectStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetEvaluationStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelJobStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetImportStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetImportStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetLoadSnapshotStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetProjectDeletionStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainedModelResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainedModelResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainingStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/InnerErrorCode.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/InnerErrorModel.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/InnerErrorModel.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentsEvaluationSummary.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/JobStatus.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedIntent.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedIntent.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedUtterance.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedUtterance.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationTargetProjectKind.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntities.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntities.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntity.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntity.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectDeployment.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectDeployment.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectKind.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectMetadata.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectSettings.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectSettings.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectTrainedModel.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectTrainedModel.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ResourceMetadata.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ResourceMetadata.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/StringIndexType.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SubTrainingJobState.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SubTrainingJobState.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguage.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguage.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguages.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguages.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SwapDeploymentsConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SwapDeploymentsConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersion.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersion.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersions.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersions.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobState.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobState.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingMode.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnassignDeploymentResourcesConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnassignDeploymentResourcesConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedOrchestrationConfig.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedOrchestrationConfig.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedProjectAssets.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntitiesEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntitiesEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntityEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntityEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceIntentsEvaluationResult.Serialization.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceIntentsEvaluationResult.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Properties/AssemblyInfo.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tests/Azure.AI.Language.Authoring.Conversations.Tests.csproj create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tests/Generated/Samples/Samples_ConversationalAnalysisAuthoring.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tsp-location.yaml diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/Azure.AI.Language.Authoring.Analyzetext.sln b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/Azure.AI.Language.Authoring.Analyzetext.sln new file mode 100644 index 000000000000..fe0dc0df00a8 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/CHANGELOG.md new file mode 100644 index 000000000000..13dd08af78ab --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/Directory.Build.props b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/README.md new file mode 100644 index 000000000000..8aef879dc514 --- /dev/null +++ b/sdk/cognitivelanguage/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/cognitivelanguage/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/cognitivelanguage/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/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/README.png) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Azure.AI.Language.Authoring.Analyzetext.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Azure.AI.Language.Authoring.Analyzetext.csproj new file mode 100644 index 000000000000..6429bf706d3f --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextClientBuilderExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextClientBuilderExtensions.cs new file mode 100644 index 000000000000..cc200bbb2191 --- /dev/null +++ b/sdk/cognitivelanguage/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 AddAnalyzetextClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new AnalyzetextClient(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 AddAnalyzetextClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new AnalyzetextClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddAnalyzetextClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AILanguageAuthoringAnalyzetextModelFactory.cs new file mode 100644 index 000000000000..1606c7108524 --- /dev/null +++ b/sdk/cognitivelanguage/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 TextAnalysisAuthoringError TextAnalysisAuthoringError(ErrorCode code = default, string message = null, string target = null, IEnumerable details = null, InnerErrorModel innererror = null) + { + details ??= new List(); + + return new TextAnalysisAuthoringError( + 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 CreateProjectConfig CreateProjectConfig(ProjectKind projectKind = default, string storageInputContainerName = null, ProjectSettings settings = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new CreateProjectConfig( + 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, CreateProjectConfig 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 TrainingJobConfig TrainingJobConfig(string modelLabel = null, string trainingConfigVersion = null, EvaluationConfig evaluationOptions = null, DataGenerationSettings dataGenerationSettings = null) + { + return new TrainingJobConfig(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 TextAnalysisAuthoringWarning TextAnalysisAuthoringWarning(string code = null, string message = null) + { + return new TextAnalysisAuthoringWarning(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 CreateDeploymentConfig CreateDeploymentConfig(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) + { + assignedResourceIds ??= new List(); + + return new CreateDeploymentConfig(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(EvaluationConfig 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(TextAnalysisAuthoringSentiment 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, EvaluationConfig 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(EvaluationConfig 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(EvaluationConfig 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(EvaluationConfig 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(EvaluationConfig 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(EvaluationConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AnalyzetextClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AnalyzetextClient.cs new file mode 100644 index 000000000000..2c4451695389 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AnalyzetextClient.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 AnalyzetextClient + { + 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 AnalyzetextClient for mocking. + protected AnalyzetextClient() + { + } + + /// Initializes a new instance of AnalyzetextClient. + /// + /// 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 AnalyzetextClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AnalyzetextClientOptions()) + { + } + + /// Initializes a new instance of AnalyzetextClient. + /// + /// 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 AnalyzetextClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AnalyzetextClientOptions()) + { + } + + /// Initializes a new instance of AnalyzetextClient. + /// + /// 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 AnalyzetextClient(Uri endpoint, AzureKeyCredential credential, AnalyzetextClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AnalyzetextClientOptions(); + + 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 AnalyzetextClient. + /// + /// 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 AnalyzetextClient(Uri endpoint, TokenCredential credential, AnalyzetextClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new AnalyzetextClientOptions(); + + 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AnalyzetextClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AnalyzetextClientOptions.cs new file mode 100644 index 000000000000..5e1ecd6ed253 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/AnalyzetextClientOptions.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 AnalyzetextClient. + public partial class AnalyzetextClientOptions : 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 AnalyzetextClientOptions. + public AnalyzetextClientOptions(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Docs/TextAnalysisAuthoring.xml b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Docs/TextAnalysisAuthoring.xml new file mode 100644 index 000000000000..92c531be89a0 --- /dev/null +++ b/sdk/cognitivelanguage/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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectConfig body = new CopyProjectConfig( +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectConfig body = new CopyProjectConfig( +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectConfig body = new CopyProjectConfig( +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectConfig body = new CopyProjectConfig( +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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobConfig body = new TrainingJobConfig("", ""); +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobConfig body = new TrainingJobConfig("", "") +{ + EvaluationOptions = new EvaluationConfig + { + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobConfig body = new TrainingJobConfig("", ""); +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobConfig body = new TrainingJobConfig("", "") +{ + EvaluationOptions = new EvaluationConfig + { + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentConfig body = new CreateDeploymentConfig(""); +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentConfig body = new CreateDeploymentConfig("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentConfig body = new CreateDeploymentConfig(""); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeployProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentConfig body = new CreateDeploymentConfig("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentConfig body = new DeleteDeploymentConfig(); +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentConfig body = new DeleteDeploymentConfig +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentConfig body = new DeleteDeploymentConfig(); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeleteDeploymentFromResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentConfig body = new DeleteDeploymentConfig +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> +This sample shows how to call SwapDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelConfig body = new ExportedModelConfig(""); +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelConfig body = new ExportedModelConfig(""); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelConfig body = new ExportedModelConfig(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call CreateOrUpdateExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelConfig body = new ExportedModelConfig(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationConfig body = new EvaluationConfig(); +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationConfig body = new EvaluationConfig +{ + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationConfig body = new EvaluationConfig(); +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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationConfig body = new EvaluationConfig +{ + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisAuthoring client = new AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Argument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..1b6d1bf0463c --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..f2231f9286d3 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingList.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..331e1e903a65 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..31915600fb0a --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Optional.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..0b953e7a2697 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..6c4d8df9e9f6 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesConfig.Serialization.cs new file mode 100644 index 000000000000..210cb0b4db38 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesConfig.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 AssignDeploymentResourcesConfig : 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(AssignDeploymentResourcesConfig)} 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(); + } + + AssignDeploymentResourcesConfig 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(AssignDeploymentResourcesConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignDeploymentResourcesConfig(document.RootElement, options); + } + + internal static AssignDeploymentResourcesConfig DeserializeAssignDeploymentResourcesConfig(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 AssignDeploymentResourcesConfig(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(AssignDeploymentResourcesConfig)} does not support writing '{options.Format}' format."); + } + } + + AssignDeploymentResourcesConfig 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 DeserializeAssignDeploymentResourcesConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesConfig)} 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 AssignDeploymentResourcesConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignDeploymentResourcesConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesConfig.cs new file mode 100644 index 000000000000..14f58fb1907c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignDeploymentResourcesConfig.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 AssignDeploymentResourcesConfig + { + /// + /// 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 AssignDeploymentResourcesConfig(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 AssignDeploymentResourcesConfig(IList resourcesMetadata, IDictionary serializedAdditionalRawData) + { + ResourcesMetadata = resourcesMetadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignDeploymentResourcesConfig() + { + } + + /// Represents the metadata for the resources to be assigned. + public IList ResourcesMetadata { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.Serialization.cs new file mode 100644 index 000000000000..2dbe4073ff88 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedDeploymentResource.cs new file mode 100644 index 000000000000..14f083568579 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs new file mode 100644 index 000000000000..d8a36997689a --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentMetadata.cs new file mode 100644 index 000000000000..5b6115884e7a --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs new file mode 100644 index 000000000000..c8d9a4d4f5d9 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs new file mode 100644 index 000000000000..8fa1d8ee62a8 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CompositionSetting.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CompositionSetting.cs new file mode 100644 index 000000000000..7df658484817 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.Serialization.cs new file mode 100644 index 000000000000..174939d1c9d1 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrix.cs new file mode 100644 index 000000000000..75ad5df97cde --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.Serialization.cs new file mode 100644 index 000000000000..41499849b88c --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixCell.cs new file mode 100644 index 000000000000..bc821bdae2ec --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.Serialization.cs new file mode 100644 index 000000000000..c244ec5d102a --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ConfusionMatrixRow.cs new file mode 100644 index 000000000000..9dfd8c9f28c6 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs new file mode 100644 index 000000000000..2d44b40fce8b --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectAuthorizationRequest.cs new file mode 100644 index 000000000000..5ada1fde5c1e --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectConfig.Serialization.cs new file mode 100644 index 000000000000..75063381b31c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectConfig.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 CopyProjectConfig : 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(CopyProjectConfig)} 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(); + } + + CopyProjectConfig 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(CopyProjectConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectConfig(document.RootElement, options); + } + + internal static CopyProjectConfig DeserializeCopyProjectConfig(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 CopyProjectConfig( + 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(CopyProjectConfig)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectConfig 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 DeserializeCopyProjectConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectConfig)} 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 CopyProjectConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectConfig.cs new file mode 100644 index 000000000000..9602acd452df --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CopyProjectConfig.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 CopyProjectConfig + { + /// + /// 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 CopyProjectConfig(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 CopyProjectConfig(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 CopyProjectConfig() + { + } + + /// 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentConfig.Serialization.cs new file mode 100644 index 000000000000..ed3a157be0cf --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentConfig.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 CreateDeploymentConfig : 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(CreateDeploymentConfig)} 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(); + } + + CreateDeploymentConfig 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(CreateDeploymentConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateDeploymentConfig(document.RootElement, options); + } + + internal static CreateDeploymentConfig DeserializeCreateDeploymentConfig(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 CreateDeploymentConfig(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(CreateDeploymentConfig)} does not support writing '{options.Format}' format."); + } + } + + CreateDeploymentConfig 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 DeserializeCreateDeploymentConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateDeploymentConfig)} 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 CreateDeploymentConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateDeploymentConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentConfig.cs new file mode 100644 index 000000000000..c1c9d44c9385 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateDeploymentConfig.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 CreateDeploymentConfig + { + /// + /// 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 CreateDeploymentConfig(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 CreateDeploymentConfig(string trainedModelLabel, IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateDeploymentConfig() + { + } + + /// 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectConfig.Serialization.cs new file mode 100644 index 000000000000..1ed5a27cb6e0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectConfig.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 CreateProjectConfig : 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(CreateProjectConfig)} 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(); + } + + CreateProjectConfig 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(CreateProjectConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateProjectConfig(document.RootElement, options); + } + + internal static CreateProjectConfig DeserializeCreateProjectConfig(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 CreateProjectConfig( + 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(CreateProjectConfig)} does not support writing '{options.Format}' format."); + } + } + + CreateProjectConfig 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 DeserializeCreateProjectConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateProjectConfig)} 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 CreateProjectConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateProjectConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectConfig.cs new file mode 100644 index 000000000000..20536be9e83a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CreateProjectConfig.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 CreateProjectConfig + { + /// + /// 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 CreateProjectConfig(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 CreateProjectConfig(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 CreateProjectConfig() + { + } + + /// 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..eaddc80af075 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionDocumentEvaluationResult.cs new file mode 100644 index 000000000000..02af28e899ce --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..fb830a32c508 --- /dev/null +++ b/sdk/cognitivelanguage/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; + EvaluationConfig 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 = EvaluationConfig.DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomEntityRecognitionEvaluationSummary.cs new file mode 100644 index 000000000000..8a5d97ca4808 --- /dev/null +++ b/sdk/cognitivelanguage/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(EvaluationConfig 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, EvaluationConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..cb486bcef0f4 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareDocumentEvaluationResult.cs new file mode 100644 index 000000000000..a2ae3608ddf8 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..5ecd07e70fee --- /dev/null +++ b/sdk/cognitivelanguage/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; + EvaluationConfig 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 = EvaluationConfig.DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomHealthcareEvaluationSummary.cs new file mode 100644 index 000000000000..1732879e4aa8 --- /dev/null +++ b/sdk/cognitivelanguage/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(EvaluationConfig 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, EvaluationConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..be148297c991 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationDocumentEvaluationResult.cs new file mode 100644 index 000000000000..e4daa23a5436 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..30f754bbbc2d --- /dev/null +++ b/sdk/cognitivelanguage/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; + EvaluationConfig 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 = EvaluationConfig.DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomMultiLabelClassificationEvaluationSummary.cs new file mode 100644 index 000000000000..0dfab1dc346e --- /dev/null +++ b/sdk/cognitivelanguage/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(EvaluationConfig 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, EvaluationConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..65ec5a6b458a --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationDocumentEvaluationResult.cs new file mode 100644 index 000000000000..680d1451a655 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..c01ca036b40c --- /dev/null +++ b/sdk/cognitivelanguage/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; + EvaluationConfig 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 = EvaluationConfig.DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomSingleLabelClassificationEvaluationSummary.cs new file mode 100644 index 000000000000..02633e0285b0 --- /dev/null +++ b/sdk/cognitivelanguage/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(EvaluationConfig 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, EvaluationConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..d570200bf0b1 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentDocumentEvaluationResult.cs new file mode 100644 index 000000000000..228d09e70d1d --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..006a7ba09504 --- /dev/null +++ b/sdk/cognitivelanguage/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; + EvaluationConfig 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 = EvaluationConfig.DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/CustomTextSentimentEvaluationSummary.cs new file mode 100644 index 000000000000..5f9a784f133e --- /dev/null +++ b/sdk/cognitivelanguage/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(EvaluationConfig 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, EvaluationConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.Serialization.cs new file mode 100644 index 000000000000..833f35785bd5 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfo.cs new file mode 100644 index 000000000000..61da77f366e6 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfoKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationConnectionInfoKind.cs new file mode 100644 index 000000000000..69edc95d6527 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.Serialization.cs new file mode 100644 index 000000000000..fec0c4ffeba8 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DataGenerationSettings.cs new file mode 100644 index 000000000000..e1b215f18b1b --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentConfig.Serialization.cs new file mode 100644 index 000000000000..d7cec44904c0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentConfig.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 DeleteDeploymentConfig : 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(DeleteDeploymentConfig)} 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(); + } + + DeleteDeploymentConfig 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(DeleteDeploymentConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeleteDeploymentConfig(document.RootElement, options); + } + + internal static DeleteDeploymentConfig DeserializeDeleteDeploymentConfig(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 DeleteDeploymentConfig(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(DeleteDeploymentConfig)} does not support writing '{options.Format}' format."); + } + } + + DeleteDeploymentConfig 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 DeserializeDeleteDeploymentConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeleteDeploymentConfig)} 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 DeleteDeploymentConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeleteDeploymentConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentConfig.cs new file mode 100644 index 000000000000..45a68a3ac945 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeleteDeploymentConfig.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 DeleteDeploymentConfig + { + /// + /// 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 DeleteDeploymentConfig() + { + 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 DeleteDeploymentConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.Serialization.cs new file mode 100644 index 000000000000..f02f6fe0bf80 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DeploymentResource.cs new file mode 100644 index 000000000000..ddaa23ddc752 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..dd0269d48533 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityLabelEvaluationResult.cs new file mode 100644 index 000000000000..71040b3cfab8 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..9b53e3833203 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRecognitionEvaluationResult.cs new file mode 100644 index 000000000000..2085d538a469 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..ec968f286133 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEntityRegionEvaluationResult.cs new file mode 100644 index 000000000000..4f30ead5add5 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..a48990a5bfb0 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentEvaluationResult.cs new file mode 100644 index 000000000000..ad2ecbe54d19 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..9dcead7fd610 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentHealthcareEvaluationResult.cs new file mode 100644 index 000000000000..ce6e7bbef7fe --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..bce7232f08a7 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentMultiLabelClassificationEvaluationResult.cs new file mode 100644 index 000000000000..0119f0a4751d --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..a727ecf4708d --- /dev/null +++ b/sdk/cognitivelanguage/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; + } + TextAnalysisAuthoringSentiment 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 TextAnalysisAuthoringSentiment(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSentimentLabelEvaluationResult.cs new file mode 100644 index 000000000000..1a6cace10ea1 --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringSentiment 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(TextAnalysisAuthoringSentiment 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 TextAnalysisAuthoringSentiment 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..199376c331d5 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentSingleLabelClassificationEvaluationResult.cs new file mode 100644 index 000000000000..c7b90168e4e1 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..8e2a2ea00a0b --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/DocumentTextSentimentEvaluationResult.cs new file mode 100644 index 000000000000..32ca37acbb3f --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..82492be9a2b4 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityEvaluationSummary.cs new file mode 100644 index 000000000000..1ded1789e180 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..960c3f1cfdf8 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EntityRecognitionEvaluationSummary.cs new file mode 100644 index 000000000000..27a856dff90d --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ErrorCode.cs new file mode 100644 index 000000000000..6b3343327ef2 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationConfig.Serialization.cs new file mode 100644 index 000000000000..6ef0acd0734d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationConfig.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 EvaluationConfig : 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(EvaluationConfig)} 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(); + } + + EvaluationConfig 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(EvaluationConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationConfig(document.RootElement, options); + } + + internal static EvaluationConfig DeserializeEvaluationConfig(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 EvaluationConfig(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(EvaluationConfig)} does not support writing '{options.Format}' format."); + } + } + + EvaluationConfig 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 DeserializeEvaluationConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationConfig)} 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 EvaluationConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationConfig.cs new file mode 100644 index 000000000000..835b6b4a94c0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationConfig.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 EvaluationConfig + { + /// + /// 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 EvaluationConfig() + { + } + + /// 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 EvaluationConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.Serialization.cs new file mode 100644 index 000000000000..1c216994cea1 --- /dev/null +++ b/sdk/cognitivelanguage/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; + } + EvaluationConfig 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 = EvaluationConfig.DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationJobResult.cs new file mode 100644 index 000000000000..b7cdfeb01e6d --- /dev/null +++ b/sdk/cognitivelanguage/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(EvaluationConfig 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(EvaluationConfig 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 EvaluationConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationKind.cs new file mode 100644 index 000000000000..65e6b74584ff --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..669067cb8aee --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/EvaluationSummary.cs new file mode 100644 index 000000000000..90a126c70695 --- /dev/null +++ b/sdk/cognitivelanguage/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(EvaluationConfig 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, EvaluationConfig 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 EvaluationConfig EvaluationOptions { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.Serialization.cs new file mode 100644 index 000000000000..6d9a80410a8c --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedClass.cs new file mode 100644 index 000000000000..b5ac5dcd7c98 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.Serialization.cs new file mode 100644 index 000000000000..f793bb1bf4ed --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCompositeEntity.cs new file mode 100644 index 000000000000..9548fb9f666a --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.Serialization.cs new file mode 100644 index 000000000000..82f5a6112ab0 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationDocument.cs new file mode 100644 index 000000000000..2f7bd5c19aeb --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.Serialization.cs new file mode 100644 index 000000000000..0dd8e2b0f7a7 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomAbstractiveSummarizationProjectAssets.cs new file mode 100644 index 000000000000..94db4391875b --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.Serialization.cs new file mode 100644 index 000000000000..97738e17333f --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionDocument.cs new file mode 100644 index 000000000000..0b07d3827f89 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.Serialization.cs new file mode 100644 index 000000000000..c9708fa50da4 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomEntityRecognitionProjectAssets.cs new file mode 100644 index 000000000000..e374015144a6 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.Serialization.cs new file mode 100644 index 000000000000..1518a417483a --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareDocument.cs new file mode 100644 index 000000000000..0f6f029aca88 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.Serialization.cs new file mode 100644 index 000000000000..faae9f08b885 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomHealthcareProjectAssets.cs new file mode 100644 index 000000000000..558a372cf49d --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.Serialization.cs new file mode 100644 index 000000000000..c98f3a905701 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationDocument.cs new file mode 100644 index 000000000000..91697ccd36d3 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.Serialization.cs new file mode 100644 index 000000000000..aeeabf1b1d4f --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomMultiLabelClassificationProjectAssets.cs new file mode 100644 index 000000000000..4bf1541e5841 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.Serialization.cs new file mode 100644 index 000000000000..6f872150618d --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationDocument.cs new file mode 100644 index 000000000000..2839a18a2bc3 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.Serialization.cs new file mode 100644 index 000000000000..16e19bfc5dbf --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomSingleLabelClassificationProjectAssets.cs new file mode 100644 index 000000000000..292673a3fdd8 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.Serialization.cs new file mode 100644 index 000000000000..33e3cc4f4be3 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentDocument.cs new file mode 100644 index 000000000000..62638b13ae87 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.Serialization.cs new file mode 100644 index 000000000000..35f59b6c22b9 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedCustomTextSentimentProjectAssets.cs new file mode 100644 index 000000000000..312ce18a63a8 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.Serialization.cs new file mode 100644 index 000000000000..ba9f4df9f3b7 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentClass.cs new file mode 100644 index 000000000000..c3bc4ccbcc9b --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.Serialization.cs new file mode 100644 index 000000000000..842be257eab9 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityLabel.cs new file mode 100644 index 000000000000..42d863a62eec --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.Serialization.cs new file mode 100644 index 000000000000..35d6e3ca3823 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentEntityRegion.cs new file mode 100644 index 000000000000..ed879a5da600 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.Serialization.cs new file mode 100644 index 000000000000..4c7a252cd611 --- /dev/null +++ b/sdk/cognitivelanguage/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; + } + TextAnalysisAuthoringSentiment? 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 TextAnalysisAuthoringSentiment(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedDocumentSentimentLabel.cs new file mode 100644 index 000000000000..d26d295871ae --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringSentiment? category, int? offset, int? length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The sentiment category. + public TextAnalysisAuthoringSentiment? 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.Serialization.cs new file mode 100644 index 000000000000..f5b8448bbf04 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntity.cs new file mode 100644 index 000000000000..0490de69bb79 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.Serialization.cs new file mode 100644 index 000000000000..b320b2c157d3 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityList.cs new file mode 100644 index 000000000000..bd045aa06efe --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs new file mode 100644 index 000000000000..fc320ed32d5e --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntityListSynonym.cs new file mode 100644 index 000000000000..113b9389092e --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.Serialization.cs new file mode 100644 index 000000000000..5d047b121e92 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedEntitySublist.cs new file mode 100644 index 000000000000..7b2698d2f8ab --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelConfig.Serialization.cs new file mode 100644 index 000000000000..f3c4b144f22f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelConfig.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 ExportedModelConfig : 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(ExportedModelConfig)} 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(); + } + + ExportedModelConfig 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(ExportedModelConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedModelConfig(document.RootElement, options); + } + + internal static ExportedModelConfig DeserializeExportedModelConfig(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 ExportedModelConfig(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(ExportedModelConfig)} does not support writing '{options.Format}' format."); + } + } + + ExportedModelConfig 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 DeserializeExportedModelConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedModelConfig)} 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 ExportedModelConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedModelConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelConfig.cs new file mode 100644 index 000000000000..87a5ceea6df8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelConfig.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 ExportedModelConfig + { + /// + /// 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 ExportedModelConfig(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 ExportedModelConfig(string trainedModelLabel, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedModelConfig() + { + } + + /// The trained model label. + public string TrainedModelLabel { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.Serialization.cs new file mode 100644 index 000000000000..ec7dd042b093 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedModelManifest.cs new file mode 100644 index 000000000000..06586a003896 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs new file mode 100644 index 000000000000..bbe662803b49 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedPrebuiltEntity.cs new file mode 100644 index 000000000000..40beb0111e4d --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.Serialization.cs new file mode 100644 index 000000000000..8dba93568c48 --- /dev/null +++ b/sdk/cognitivelanguage/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; + CreateProjectConfig 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 = CreateProjectConfig.DeserializeCreateProjectConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProject.cs new file mode 100644 index 000000000000..306e80a3b1bf --- /dev/null +++ b/sdk/cognitivelanguage/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, CreateProjectConfig 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, CreateProjectConfig 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 CreateProjectConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..13c7f9f23571 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedProjectAssets.cs new file mode 100644 index 000000000000..f6707552d9b7 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.Serialization.cs new file mode 100644 index 000000000000..c97af0e62dad --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ExportedTrainedModel.cs new file mode 100644 index 000000000000..a515dad66e53 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs new file mode 100644 index 000000000000..212eacce3a18 --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs new file mode 100644 index 000000000000..defa22405acf --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs new file mode 100644 index 000000000000..bb5c4b39c56e --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetCopyProjectStatusResponse.cs new file mode 100644 index 000000000000..343cd0feb0ac --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs new file mode 100644 index 000000000000..771e00bc6e4e --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs new file mode 100644 index 000000000000..d783aa5b93c0 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.Serialization.cs new file mode 100644 index 000000000000..63495fd15d9f --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentResponse.cs new file mode 100644 index 000000000000..ee7bd4622034 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs new file mode 100644 index 000000000000..d833f94c249d --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetDeploymentStatusResponse.cs new file mode 100644 index 000000000000..f3a622686c83 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs new file mode 100644 index 000000000000..77a3d069fb42 --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetEvaluationStatusResponse.cs new file mode 100644 index 000000000000..f68b4447abfd --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.Serialization.cs new file mode 100644 index 000000000000..3f97d6339d90 --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportStatusResponse.cs new file mode 100644 index 000000000000..d0d0489a19e7 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs new file mode 100644 index 000000000000..eb9d9414036c --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelJobStatusResponse.cs new file mode 100644 index 000000000000..621658edc8b5 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.Serialization.cs new file mode 100644 index 000000000000..ec49deb50db7 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetExportedModelResponse.cs new file mode 100644 index 000000000000..a20988d77a80 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.Serialization.cs new file mode 100644 index 000000000000..8427ead7c27e --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetImportStatusResponse.cs new file mode 100644 index 000000000000..5822dbfb37eb --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs new file mode 100644 index 000000000000..33a21cbd9dd5 --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetLoadSnapshotStatusResponse.cs new file mode 100644 index 000000000000..b93d7d19dc10 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs new file mode 100644 index 000000000000..3e501ccbde1d --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectDeletionStatusResponse.cs new file mode 100644 index 000000000000..bf71d4d4eb8e --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.Serialization.cs new file mode 100644 index 000000000000..646012215538 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetProjectResponse.cs new file mode 100644 index 000000000000..7c556b854102 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs new file mode 100644 index 000000000000..64f2fa580019 --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs new file mode 100644 index 000000000000..75514649c26d --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.Serialization.cs new file mode 100644 index 000000000000..2d94dbcd319e --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainedModelResponse.cs new file mode 100644 index 000000000000..4d5248f40e5c --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs new file mode 100644 index 000000000000..e1a2ac07cbf2 --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetTrainingStatusResponse.cs new file mode 100644 index 000000000000..d15140bb0ceb --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs new file mode 100644 index 000000000000..147da165de83 --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs new file mode 100644 index 000000000000..688f6dbad097 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorCode.cs new file mode 100644 index 000000000000..6482736de06e --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.Serialization.cs new file mode 100644 index 000000000000..260685a94ecd --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/InnerErrorModel.cs new file mode 100644 index 000000000000..7e49119ac32f --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/JobStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/JobStatus.cs new file mode 100644 index 000000000000..80722e496fd1 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.Serialization.cs new file mode 100644 index 000000000000..1d502fa84d6b --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ModelFile.cs new file mode 100644 index 000000000000..9c27833ecf41 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..9865214a728b --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassEvaluationSummary.cs new file mode 100644 index 000000000000..fc959e9dcc9f --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..57d2ecd6b818 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/MultiLabelClassificationEvaluationSummary.cs new file mode 100644 index 000000000000..71ab0013c72a --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.Serialization.cs new file mode 100644 index 000000000000..1ab91e0c7303 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/PrebuiltEntity.cs new file mode 100644 index 000000000000..c01964936ff8 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.Serialization.cs new file mode 100644 index 000000000000..ef104b6941cd --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectDeployment.cs new file mode 100644 index 000000000000..ed0e55c12bb2 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectKind.cs new file mode 100644 index 000000000000..29a61f50e1b4 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.Serialization.cs new file mode 100644 index 000000000000..582ade18fc18 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectMetadata.cs new file mode 100644 index 000000000000..6feb141ddb88 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.Serialization.cs new file mode 100644 index 000000000000..da0e7c43020b --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectSettings.cs new file mode 100644 index 000000000000..17913e68c842 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.Serialization.cs new file mode 100644 index 000000000000..20298a02b0b1 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ProjectTrainedModel.cs new file mode 100644 index 000000000000..07dbe464cb2e --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.Serialization.cs new file mode 100644 index 000000000000..afd3c4c109ea --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/ResourceMetadata.cs new file mode 100644 index 000000000000..c5118e4cda33 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..4e0908b6dbca --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SentimentEvaluationSummary.cs new file mode 100644 index 000000000000..fe5a37e9d036 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..f9ed43efc17c --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassEvaluationSummary.cs new file mode 100644 index 000000000000..f565e8255ab6 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..d80b023e9527 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SingleLabelClassificationEvaluationSummary.cs new file mode 100644 index 000000000000..4a51ce364df6 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..5617fb34b3be --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SpanSentimentEvaluationSummary.cs new file mode 100644 index 000000000000..b935983aed0a --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/StringIndexType.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/StringIndexType.cs new file mode 100644 index 000000000000..ff1c47b93e16 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.Serialization.cs new file mode 100644 index 000000000000..cf9f8d71c449 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SubTrainingJobState.cs new file mode 100644 index 000000000000..9d002dd77502 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.Serialization.cs new file mode 100644 index 000000000000..1fa39ccfb11b --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SupportedLanguage.cs new file mode 100644 index 000000000000..68efccbfd2cc --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsConfig.Serialization.cs new file mode 100644 index 000000000000..17d370ed2145 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsConfig.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 SwapDeploymentsConfig : 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(SwapDeploymentsConfig)} 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(); + } + + SwapDeploymentsConfig 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(SwapDeploymentsConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwapDeploymentsConfig(document.RootElement, options); + } + + internal static SwapDeploymentsConfig DeserializeSwapDeploymentsConfig(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 SwapDeploymentsConfig(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(SwapDeploymentsConfig)} does not support writing '{options.Format}' format."); + } + } + + SwapDeploymentsConfig 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 DeserializeSwapDeploymentsConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwapDeploymentsConfig)} 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 SwapDeploymentsConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSwapDeploymentsConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsConfig.cs new file mode 100644 index 000000000000..8f06392a27ba --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/SwapDeploymentsConfig.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 SwapDeploymentsConfig + { + /// + /// 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 SwapDeploymentsConfig(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 SwapDeploymentsConfig(string firstDeploymentName, string secondDeploymentName, IDictionary serializedAdditionalRawData) + { + FirstDeploymentName = firstDeploymentName; + SecondDeploymentName = secondDeploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SwapDeploymentsConfig() + { + } + + /// Represents the first deployment name. + public string FirstDeploymentName { get; } + /// Represents the second deployment name. + public string SecondDeploymentName { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringError.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringError.Serialization.cs new file mode 100644 index 000000000000..2e0c8192ebf3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringError.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 TextAnalysisAuthoringError : 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(TextAnalysisAuthoringError)} 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(); + } + + TextAnalysisAuthoringError 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(TextAnalysisAuthoringError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextAnalysisAuthoringError(document.RootElement, options); + } + + internal static TextAnalysisAuthoringError DeserializeTextAnalysisAuthoringError(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(DeserializeTextAnalysisAuthoringError(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 TextAnalysisAuthoringError( + 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(TextAnalysisAuthoringError)} does not support writing '{options.Format}' format."); + } + } + + TextAnalysisAuthoringError 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 DeserializeTextAnalysisAuthoringError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextAnalysisAuthoringError)} 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 TextAnalysisAuthoringError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringError.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringError.cs new file mode 100644 index 000000000000..769833000400 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringError.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 TextAnalysisAuthoringError + { + /// + /// 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 TextAnalysisAuthoringError(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 TextAnalysisAuthoringError(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 TextAnalysisAuthoringError() + { + } + + /// 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringSentiment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringSentiment.cs new file mode 100644 index 000000000000..a20dafe22d14 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringSentiment.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 TextAnalysisAuthoringSentiment. + public readonly partial struct TextAnalysisAuthoringSentiment : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TextAnalysisAuthoringSentiment(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 TextAnalysisAuthoringSentiment Positive { get; } = new TextAnalysisAuthoringSentiment(PositiveValue); + /// negative. + public static TextAnalysisAuthoringSentiment Negative { get; } = new TextAnalysisAuthoringSentiment(NegativeValue); + /// neutral. + public static TextAnalysisAuthoringSentiment Neutral { get; } = new TextAnalysisAuthoringSentiment(NeutralValue); + /// Determines if two values are the same. + public static bool operator ==(TextAnalysisAuthoringSentiment left, TextAnalysisAuthoringSentiment right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TextAnalysisAuthoringSentiment left, TextAnalysisAuthoringSentiment right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TextAnalysisAuthoringSentiment(string value) => new TextAnalysisAuthoringSentiment(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TextAnalysisAuthoringSentiment other && Equals(other); + /// + public bool Equals(TextAnalysisAuthoringSentiment 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringWarning.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringWarning.Serialization.cs new file mode 100644 index 000000000000..58afea5c33c4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringWarning.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 TextAnalysisAuthoringWarning : 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(TextAnalysisAuthoringWarning)} 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(); + } + + TextAnalysisAuthoringWarning 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(TextAnalysisAuthoringWarning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTextAnalysisAuthoringWarning(document.RootElement, options); + } + + internal static TextAnalysisAuthoringWarning DeserializeTextAnalysisAuthoringWarning(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 TextAnalysisAuthoringWarning(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(TextAnalysisAuthoringWarning)} does not support writing '{options.Format}' format."); + } + } + + TextAnalysisAuthoringWarning 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 DeserializeTextAnalysisAuthoringWarning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TextAnalysisAuthoringWarning)} 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 TextAnalysisAuthoringWarning FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTextAnalysisAuthoringWarning(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringWarning.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringWarning.cs new file mode 100644 index 000000000000..5e205052d248 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextAnalysisAuthoringWarning.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 TextAnalysisAuthoringWarning + { + /// + /// 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 TextAnalysisAuthoringWarning(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 TextAnalysisAuthoringWarning(string code, string message, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TextAnalysisAuthoringWarning() + { + } + + /// The warning code. + public string Code { get; } + /// The warning message. + public string Message { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..30dd31c55487 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TextSentimentEvaluationSummary.cs new file mode 100644 index 000000000000..1cef53f8a33c --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.Serialization.cs new file mode 100644 index 000000000000..640d20626ef4 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingConfigVersion.cs new file mode 100644 index 000000000000..9b15c05d30ec --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobConfig.Serialization.cs new file mode 100644 index 000000000000..09a9bc2c3386 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobConfig.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 TrainingJobConfig : 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(TrainingJobConfig)} 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(); + } + + TrainingJobConfig 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(TrainingJobConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobConfig(document.RootElement, options); + } + + internal static TrainingJobConfig DeserializeTrainingJobConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelLabel = default; + string trainingConfigVersion = default; + EvaluationConfig 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 = EvaluationConfig.DeserializeEvaluationConfig(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 TrainingJobConfig(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(TrainingJobConfig)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobConfig 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 DeserializeTrainingJobConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobConfig)} 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 TrainingJobConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobConfig.cs new file mode 100644 index 000000000000..2dad4d2cf049 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobConfig.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 TrainingJobConfig + { + /// + /// 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 TrainingJobConfig(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 TrainingJobConfig(string modelLabel, string trainingConfigVersion, EvaluationConfig evaluationOptions, DataGenerationSettings dataGenerationSettings, IDictionary serializedAdditionalRawData) + { + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + EvaluationOptions = evaluationOptions; + DataGenerationSettings = dataGenerationSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobConfig() + { + } + + /// 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 EvaluationConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.Serialization.cs new file mode 100644 index 000000000000..edee651f57bf --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobResult.cs new file mode 100644 index 000000000000..8f1960cdc59f --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.Serialization.cs new file mode 100644 index 000000000000..d122237e00f2 --- /dev/null +++ b/sdk/cognitivelanguage/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(TextAnalysisAuthoringWarning.DeserializeTextAnalysisAuthoringWarning(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(TextAnalysisAuthoringError.DeserializeTextAnalysisAuthoringError(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/TrainingJobState.cs new file mode 100644 index 000000000000..6973c112b736 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesConfig.Serialization.cs new file mode 100644 index 000000000000..7d2cda5da562 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesConfig.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 UnassignDeploymentResourcesConfig : 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(UnassignDeploymentResourcesConfig)} 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(); + } + + UnassignDeploymentResourcesConfig 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(UnassignDeploymentResourcesConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUnassignDeploymentResourcesConfig(document.RootElement, options); + } + + internal static UnassignDeploymentResourcesConfig DeserializeUnassignDeploymentResourcesConfig(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 UnassignDeploymentResourcesConfig(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(UnassignDeploymentResourcesConfig)} does not support writing '{options.Format}' format."); + } + } + + UnassignDeploymentResourcesConfig 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 DeserializeUnassignDeploymentResourcesConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesConfig)} 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 UnassignDeploymentResourcesConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnassignDeploymentResourcesConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesConfig.cs new file mode 100644 index 000000000000..e8a69731ec3a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnassignDeploymentResourcesConfig.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 UnassignDeploymentResourcesConfig + { + /// + /// 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 UnassignDeploymentResourcesConfig(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 UnassignDeploymentResourcesConfig(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UnassignDeploymentResourcesConfig() + { + } + + /// Represents the assigned resource IDs to be unassigned. + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..a8dbc74a74ea --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownDocumentEvaluationResult.cs new file mode 100644 index 000000000000..07c58e773910 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..424e916984cd --- /dev/null +++ b/sdk/cognitivelanguage/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"; + EvaluationConfig 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 = EvaluationConfig.DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownEvaluationSummary.cs new file mode 100644 index 000000000000..884ef28b80d6 --- /dev/null +++ b/sdk/cognitivelanguage/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, EvaluationConfig evaluationOptions, IDictionary serializedAdditionalRawData) : base(projectKind, evaluationOptions, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownEvaluationSummary() + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..30e028e8e096 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/Models/UnknownExportedProjectAssets.cs new file mode 100644 index 000000000000..4ae8fea0f568 --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextAnalysisAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Generated/TextAnalysisAuthoring.cs new file mode 100644 index 000000000000..827eddc005da --- /dev/null +++ b/sdk/cognitivelanguage/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(CopyProjectConfig.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(CopyProjectConfig.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, CopyProjectConfig 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, CopyProjectConfig 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, TrainingJobConfig 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, TrainingJobConfig 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, CreateDeploymentConfig 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, CreateDeploymentConfig 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, DeleteDeploymentConfig 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, DeleteDeploymentConfig 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, SwapDeploymentsConfig 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, SwapDeploymentsConfig 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, ExportedModelConfig 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, ExportedModelConfig 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, EvaluationConfig 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, EvaluationConfig 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, AssignDeploymentResourcesConfig 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, AssignDeploymentResourcesConfig 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, UnassignDeploymentResourcesConfig 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, UnassignDeploymentResourcesConfig 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/Azure.AI.Language.Authoring.Analyzetext/src/Properties/AssemblyInfo.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..07c8b23c4afe --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/tests/Azure.AI.Language.Authoring.Analyzetext.Tests.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/tests/Azure.AI.Language.Authoring.Analyzetext.Tests.csproj new file mode 100644 index 000000000000..f5fa6f6d6fff --- /dev/null +++ b/sdk/cognitivelanguage/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/Azure.AI.Language.Authoring.Analyzetext/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/tests/Generated/Samples/Samples_TextAnalysisAuthoring.cs new file mode 100644 index 000000000000..fe23494176d3 --- /dev/null +++ b/sdk/cognitivelanguage/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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectConfig body = new CopyProjectConfig( + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectConfig body = new CopyProjectConfig( + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectConfig body = new CopyProjectConfig( + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectConfig body = new CopyProjectConfig( + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobConfig body = new TrainingJobConfig("", ""); + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobConfig body = new TrainingJobConfig("", ""); + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobConfig body = new TrainingJobConfig("", "") + { + EvaluationOptions = new EvaluationConfig + { + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobConfig body = new TrainingJobConfig("", "") + { + EvaluationOptions = new EvaluationConfig + { + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentConfig body = new CreateDeploymentConfig(""); + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentConfig body = new CreateDeploymentConfig(""); + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentConfig body = new CreateDeploymentConfig("") + { + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentConfig body = new CreateDeploymentConfig("") + { + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentConfig body = new DeleteDeploymentConfig(); + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentConfig body = new DeleteDeploymentConfig(); + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentConfig body = new DeleteDeploymentConfig + { + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentConfig body = new DeleteDeploymentConfig + { + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelConfig body = new ExportedModelConfig(""); + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelConfig body = new ExportedModelConfig(""); + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelConfig body = new ExportedModelConfig(""); + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelConfig body = new ExportedModelConfig(""); + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationConfig body = new EvaluationConfig(); + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationConfig body = new EvaluationConfig(); + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationConfig body = new EvaluationConfig + { + 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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationConfig body = new EvaluationConfig + { + 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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(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 AnalyzetextClient(endpoint, credential).GetTextAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.CancelTrainingJobAsync(WaitUntil.Completed, "", ""); + TrainingJobResult responseData = operation.Value; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/tsp-location.yaml new file mode 100644 index 000000000000..4d04a4a3cb4b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Analyzetext/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/Language.AnalyzeText-authoring +commit: e95392a29798b02be1f02f45ea61fdf82533b39c +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/Azure.AI.Language.Authoring.Conversations.sln b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/Azure.AI.Language.Authoring.Conversations.sln new file mode 100644 index 000000000000..7d6e6e1952c2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/Azure.AI.Language.Authoring.Conversations.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.Conversations", "src\Azure.AI.Language.Authoring.Conversations.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.Authoring.Conversations.Tests", "tests\Azure.AI.Language.Authoring.Conversations.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/Azure.AI.Language.Authoring.Conversations/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/CHANGELOG.md new file mode 100644 index 000000000000..13dd08af78ab --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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/Azure.AI.Language.Authoring.Conversations/Directory.Build.props b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/README.md new file mode 100644 index 000000000000..ad40aec5c023 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/README.md @@ -0,0 +1,107 @@ +# Azure.AI.Language.Authoring.Conversations client library for .NET + +Azure.AI.Language.Authoring.Conversations 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/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations --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/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/README.png) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Azure.AI.Language.Authoring.Conversations.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Azure.AI.Language.Authoring.Conversations.csproj new file mode 100644 index 000000000000..b56b7a51b42b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Azure.AI.Language.Authoring.Conversations.csproj @@ -0,0 +1,20 @@ + + + This is the Azure.AI.Language.Authoring.Conversations client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.AI.Language.Authoring.Conversations for Azure Data Plane + 1.0.0-beta.1 + Azure.AI.Language.Authoring.Conversations + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/AILanguageAuthoringConversationsClientBuilderExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/AILanguageAuthoringConversationsClientBuilderExtensions.cs new file mode 100644 index 000000000000..b2818d4876f6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/AILanguageAuthoringConversationsClientBuilderExtensions.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.Conversations; +using Azure.Core.Extensions; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class AILanguageAuthoringConversationsClientBuilderExtensions + { + /// 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 AddConversationsClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory((options) => new ConversationsClient(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 AddConversationsClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new ConversationsClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddConversationsClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/AILanguageAuthoringConversationsModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/AILanguageAuthoringConversationsModelFactory.cs new file mode 100644 index 000000000000..4063e8a8d968 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/AILanguageAuthoringConversationsModelFactory.cs @@ -0,0 +1,1111 @@ +// 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.Conversations.Models +{ + /// Model factory for models. + public static partial class AILanguageAuthoringConversationsModelFactory + { + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project creation datetime. + /// Represents the project last trained datetime. + /// Represents the project last deployed datetime. + /// Represents the project kind. + /// The project settings. + /// The storage container name in case of conversation summarization. + /// 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, ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new ProjectMetadata( + createdDateTime, + lastModifiedDateTime, + lastTrainedDateTime, + lastDeployedDateTime, + projectKind, + settings, + storageInputContainerName, + 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 AuthoringConversationsError AuthoringConversationsError(ErrorCode code = default, string message = null, string target = null, IEnumerable details = null, InnerErrorModel innererror = null) + { + details ??= new List(); + + return new AuthoringConversationsError( + 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 kind. + /// The project settings. + /// The storage container name in case of conversation summarization. + /// 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 CreateProjectConfig CreateProjectConfig(ProjectKind projectKind = default, ProjectSettings settings = null, string storageInputContainerName = null, string projectName = null, bool? multilingual = null, string description = null, string language = null) + { + return new CreateProjectConfig( + projectKind, + settings, + storageInputContainerName, + 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, CreateProjectConfig metadata = null, ExportedProjectAssets assets = null) + { + return new ExportedProject(projectFileVersion, stringIndexType, metadata, assets, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The category of the entity. + /// The behavior to follow when the entity's components overlap with each other. + /// The list component of the entity. + /// The prebuilt entities components. + /// The regex component of the entity. + /// The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. + /// A new instance for mocking. + public static ConversationExportedEntity ConversationExportedEntity(string category = null, CompositionSetting? compositionSetting = null, ExportedEntityList list = null, IEnumerable prebuilts = null, ExportedEntityRegex regex = null, IEnumerable requiredComponents = null) + { + prebuilts ??= new List(); + requiredComponents ??= new List(); + + return new ConversationExportedEntity( + category, + compositionSetting, + list, + prebuilts?.ToList(), + regex, + requiredComponents?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the entity labels of the utterance. + /// The utterance text. + /// + /// Represents the utterance's 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 intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// A new instance for mocking. + public static ConversationExportedUtterance ConversationExportedUtterance(IEnumerable entities = null, string text = null, string language = null, string intent = null, string dataset = null) + { + entities ??= new List(); + + return new ConversationExportedUtterance( + entities?.ToList(), + text, + language, + intent, + dataset, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Specifies the behavior of this intent in the orchestration flow. + /// 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 . + /// + /// The intent category. + /// A new instance for mocking. + public static OrchestrationExportedIntent OrchestrationExportedIntent(ExportedOrchestrationConfig orchestration = null, string category = null) + { + return new OrchestrationExportedIntent(orchestration, category, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Conversational project target details. + /// A new instance for mocking. + public static ExportedConversationOrchestrationConfig ExportedConversationOrchestrationConfig(ExportedConversationOrchestration conversationOrchestration = null) + { + return new ExportedConversationOrchestrationConfig(OrchestrationTargetProjectKind.Conversation, serializedAdditionalRawData: null, conversationOrchestration); + } + + /// Initializes a new instance of . + /// The LUIS application target details. + /// A new instance for mocking. + public static ExportedLuisOrchestrationConfig ExportedLuisOrchestrationConfig(ExportedLuisOrchestration luisOrchestration = null) + { + return new ExportedLuisOrchestrationConfig(OrchestrationTargetProjectKind.Luis, serializedAdditionalRawData: null, luisOrchestration); + } + + /// Initializes a new instance of . + /// The LUIS application ID. + /// The targeted version Id. + /// The targeted slot name. + /// A new instance for mocking. + public static ExportedLuisOrchestration ExportedLuisOrchestration(Guid appId = default, string appVersion = null, string slotName = null) + { + return new ExportedLuisOrchestration(appId, appVersion, slotName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Question Answering project details. + /// A new instance for mocking. + public static ExportedQuestionAnsweringOrchestrationConfig ExportedQuestionAnsweringOrchestrationConfig(ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration = null) + { + return new ExportedQuestionAnsweringOrchestrationConfig(OrchestrationTargetProjectKind.QuestionAnswering, serializedAdditionalRawData: null, questionAnsweringOrchestration); + } + + /// Initializes a new instance of . + /// The utterance text. + /// + /// Represents the utterance's 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 intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// A new instance for mocking. + public static OrchestrationExportedUtterance OrchestrationExportedUtterance(string text = null, string language = null, string intent = null, string dataset = null) + { + return new OrchestrationExportedUtterance(text, language, intent, dataset, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// + /// Represents training config version. By default, "latest" value is used which + /// uses the latest released training config version. + /// + /// Represents the mode of the training operation. + /// + /// Represents the evaluation options. By default, the evaluation kind is + /// percentage, with training split percentage as 80, and testing split percentage + /// as 20. + /// + /// A new instance for mocking. + public static TrainingJobConfig TrainingJobConfig(string modelLabel = null, string trainingConfigVersion = null, TrainingMode trainingMode = default, EvaluationConfig evaluationOptions = null) + { + return new TrainingJobConfig(modelLabel, trainingConfigVersion, trainingMode, evaluationOptions, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents trained model label. + /// Represents training config version. + /// Represents the mode of the training operation. + /// Represents the model training status. + /// Represents model evaluation status. + /// Represents the estimated end date time for training and evaluation. + /// A new instance for mocking. + public static TrainingJobResult TrainingJobResult(string modelLabel = null, string trainingConfigVersion = null, TrainingMode? trainingMode = null, SubTrainingJobState trainingStatus = null, SubTrainingJobState evaluationStatus = null, DateTimeOffset? estimatedEndDateTime = null) + { + return new TrainingJobResult( + modelLabel, + trainingConfigVersion, + trainingMode, + 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 AuthoringConversationsWarning AuthoringConversationsWarning(string code = null, string message = null) + { + return new AuthoringConversationsWarning(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 CreateDeploymentConfig CreateDeploymentConfig(string trainedModelLabel = null, IEnumerable assignedResourceIds = null) + { + assignedResourceIds ??= new List(); + + return new CreateDeploymentConfig(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 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(EvaluationConfig 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 utterance text. + /// + /// Represents the utterance 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 entities results for the utterance. + /// Represents the intents results for the utterance. + /// A new instance for mocking. + public static UtteranceEvaluationResult UtteranceEvaluationResult(string text = null, string language = null, UtteranceEntitiesEvaluationResult entitiesResult = null, UtteranceIntentsEvaluationResult intentsResult = null) + { + return new UtteranceEvaluationResult(text, language, entitiesResult, intentsResult, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the expected entity labels. + /// Represents the predicted entity labels. + /// A new instance for mocking. + public static UtteranceEntitiesEvaluationResult UtteranceEntitiesEvaluationResult(IEnumerable expectedEntities = null, IEnumerable predictedEntities = null) + { + expectedEntities ??= new List(); + predictedEntities ??= new List(); + + return new UtteranceEntitiesEvaluationResult(expectedEntities?.ToList(), predictedEntities?.ToList(), 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 UtteranceEntityEvaluationResult UtteranceEntityEvaluationResult(string category = null, int offset = default, int length = default) + { + return new UtteranceEntityEvaluationResult(category, offset, length, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Represents the utterance's expected intent. + /// Represents the utterance's predicted intent. + /// A new instance for mocking. + public static UtteranceIntentsEvaluationResult UtteranceIntentsEvaluationResult(string expectedIntent = null, string predictedIntent = null) + { + return new UtteranceIntentsEvaluationResult(expectedIntent, predictedIntent, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Contains the data related to entities evaluation. + /// Contains the data related to intents evaluation. + /// The options that were used while running the evaluation. + /// A new instance for mocking. + public static EvaluationSummary EvaluationSummary(EntitiesEvaluationSummary entitiesEvaluation = null, IntentsEvaluationSummary intentsEvaluation = null, EvaluationConfig evaluationOptions = null) + { + return new EvaluationSummary(entitiesEvaluation, intentsEvaluation, evaluationOptions, serializedAdditionalRawData: null); + } + + /// 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 summary. + /// 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 EntitiesEvaluationSummary EntitiesEvaluationSummary(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 EntitiesEvaluationSummary( + 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 confusion matrix between two intents (the two intents can be the + /// same). The matrix is between the intent that was labelled and the intent that + /// was predicted. + /// + /// Represents the intents evaluation summary. + /// 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 IntentsEvaluationSummary IntentsEvaluationSummary(ConfusionMatrix confusionMatrix = null, IReadOnlyDictionary intents = null, float microF1 = default, float microPrecision = default, float microRecall = default, float macroF1 = default, float macroPrecision = default, float macroRecall = default) + { + intents ??= new Dictionary(); + + return new IntentsEvaluationSummary( + confusionMatrix, + intents, + 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 IntentEvaluationSummary IntentEvaluationSummary(double f1 = default, double precision = default, double recall = default, int truePositiveCount = default, int trueNegativeCount = default, int falsePositiveCount = default, int falseNegativeCount = default) + { + return new IntentEvaluationSummary( + 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 . + /// The list of retrieved assigned project deployments. + /// The next page link. + /// A new instance for mocking. + public static AssignedResourceDeploymentsMetadata AssignedResourceDeploymentsMetadata(IEnumerable value = null, string nextLink = null) + { + value ??= new List(); + + return new AssignedResourceDeploymentsMetadata(value?.ToList(), nextLink, 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 list of the languages. + /// The next page link. + /// A new instance for mocking. + public static SupportedLanguages SupportedLanguages(IEnumerable value = null, string nextLink = null) + { + value ??= new List(); + + return new SupportedLanguages(value?.ToList(), nextLink, 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 supported prebuilt entities. + /// The next page link. + /// A new instance for mocking. + public static PrebuiltEntities PrebuiltEntities(IEnumerable value = null, string nextLink = null) + { + value ??= new List(); + + return new PrebuiltEntities(value?.ToList(), nextLink, 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 . + /// The list of the training config versions. + /// The next page link. + /// A new instance for mocking. + public static TrainingConfigVersions TrainingConfigVersions(IEnumerable value = null, string nextLink = null) + { + value ??= new List(); + + return new TrainingConfigVersions(value?.ToList(), nextLink, 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); + } + + /// 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 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 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); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationalAnalysisAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationalAnalysisAuthoring.cs new file mode 100644 index 000000000000..731a88eda585 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationalAnalysisAuthoring.cs @@ -0,0 +1,6775 @@ +// 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.Conversations.Models; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Authoring.Conversations +{ + // Data plane generated sub-client. + /// The ConversationalAnalysisAuthoring sub-client. + public partial class ConversationalAnalysisAuthoring + { + 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 ConversationalAnalysisAuthoring for mocking. + protected ConversationalAnalysisAuthoring() + { + } + + /// Initializes a new instance of ConversationalAnalysisAuthoring. + /// 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 ConversationalAnalysisAuthoring(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(ProjectMetadata.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(ProjectMetadata.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.GetProject"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectRequest(projectName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates a new project or updates an existing one. + /// + /// + /// + /// 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("ConversationalAnalysisAuthoring.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] Creates a new project or updates an existing one. + /// + /// + /// + /// 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("ConversationalAnalysisAuthoring.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(CopyProjectConfig.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(CopyProjectConfig.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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 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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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 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> 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 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 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 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 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("ConversationalAnalysisAuthoring.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 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 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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.GetProjectDeletionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDeletionStatusRequest(jobId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// 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 maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual async Task> GetAssignedResourceDeploymentsAsync(int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAssignedResourceDeploymentsAsync(top, skip, maxpagesize, context).ConfigureAwait(false); + return Response.FromValue(AssignedResourceDeploymentsMetadata.FromResponse(response), response); + } + + /// + /// 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 maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual Response GetAssignedResourceDeployments(int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAssignedResourceDeployments(top, skip, maxpagesize, context); + return Response.FromValue(AssignedResourceDeploymentsMetadata.FromResponse(response), response); + } + + /// + /// [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 maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 response returned from the service. + /// + public virtual async Task GetAssignedResourceDeploymentsAsync(int? top, int? skip, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.GetAssignedResourceDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignedResourceDeploymentsRequest(top, skip, maxpagesize, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [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 maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 response returned from the service. + /// + public virtual Response GetAssignedResourceDeployments(int? top, int? skip, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.GetAssignedResourceDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssignedResourceDeploymentsRequest(top, skip, maxpagesize, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the supported languages for the given project type. + /// The project kind. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual async Task> GetSupportedLanguagesAsync(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSupportedLanguagesAsync(projectKind.ToString(), top, skip, maxpagesize, context).ConfigureAwait(false); + return Response.FromValue(SupportedLanguages.FromResponse(response), response); + } + + /// Lists the supported languages for the given project type. + /// The project kind. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual Response GetSupportedLanguages(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSupportedLanguages(projectKind.ToString(), top, skip, maxpagesize, context); + return Response.FromValue(SupportedLanguages.FromResponse(response), response); + } + + /// + /// [Protocol Method] Lists the supported languages for the 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. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSupportedLanguagesAsync(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.GetSupportedLanguages"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSupportedLanguagesRequest(projectKind, top, skip, maxpagesize, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Lists the supported languages for the 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. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSupportedLanguages(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.GetSupportedLanguages"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSupportedLanguagesRequest(projectKind, top, skip, maxpagesize, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the supported prebuilt entities that can be used while creating composed + /// entities. + /// + /// + /// The language to get supported prebuilt entities for. Required if multilingual + /// is false. This is BCP-47 representation of a language. For example, use "en" + /// for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// + /// Whether to get the support prebuilt entities for multilingual or monolingual + /// projects. If true, the language parameter is ignored. + /// + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual async Task> GetSupportedPrebuiltEntitiesAsync(string language = null, string multilingual = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSupportedPrebuiltEntitiesAsync(language, multilingual, top, skip, maxpagesize, context).ConfigureAwait(false); + return Response.FromValue(PrebuiltEntities.FromResponse(response), response); + } + + /// + /// Lists the supported prebuilt entities that can be used while creating composed + /// entities. + /// + /// + /// The language to get supported prebuilt entities for. Required if multilingual + /// is false. This is BCP-47 representation of a language. For example, use "en" + /// for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// + /// Whether to get the support prebuilt entities for multilingual or monolingual + /// projects. If true, the language parameter is ignored. + /// + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual Response GetSupportedPrebuiltEntities(string language = null, string multilingual = null, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSupportedPrebuiltEntities(language, multilingual, top, skip, maxpagesize, context); + return Response.FromValue(PrebuiltEntities.FromResponse(response), response); + } + + /// + /// [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 language to get supported prebuilt entities for. Required if multilingual + /// is false. This is BCP-47 representation of a language. For example, use "en" + /// for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// + /// Whether to get the support prebuilt entities for multilingual or monolingual + /// projects. If true, the language parameter is ignored. + /// + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 response returned from the service. + /// + public virtual async Task GetSupportedPrebuiltEntitiesAsync(string language, string multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.GetSupportedPrebuiltEntities"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, top, skip, maxpagesize, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [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 language to get supported prebuilt entities for. Required if multilingual + /// is false. This is BCP-47 representation of a language. For example, use "en" + /// for English, "en-gb" for English (UK), "es" for Spanish etc. + /// + /// + /// Whether to get the support prebuilt entities for multilingual or monolingual + /// projects. If true, the language parameter is ignored. + /// + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// 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 response returned from the service. + /// + public virtual Response GetSupportedPrebuiltEntities(string language, string multilingual, int? top, int? skip, int? maxpagesize, RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.GetSupportedPrebuiltEntities"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSupportedPrebuiltEntitiesRequest(language, multilingual, top, skip, maxpagesize, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the support training config version for a given project type. + /// The project kind. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual async Task> GetTrainingConfigVersionsAsync(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTrainingConfigVersionsAsync(projectKind.ToString(), top, skip, maxpagesize, context).ConfigureAwait(false); + return Response.FromValue(TrainingConfigVersions.FromResponse(response), response); + } + + /// Lists the support training config version for a given project type. + /// The project kind. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The cancellation token to use. + /// + public virtual Response GetTrainingConfigVersions(ProjectKind projectKind, int? top = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTrainingConfigVersions(projectKind.ToString(), top, skip, maxpagesize, context); + return Response.FromValue(TrainingConfigVersions.FromResponse(response), response); + } + + /// + /// [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. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTrainingConfigVersionsAsync(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.GetTrainingConfigVersions"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingConfigVersionsRequest(projectKind, top, skip, maxpagesize, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [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. Allowed values: "Conversation" | "Orchestration" | "CustomConversationSummarization". + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTrainingConfigVersions(string projectKind, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) + { + Argument.AssertNotNull(projectKind, nameof(projectKind)); + + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.GetTrainingConfigVersions"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTrainingConfigVersionsRequest(projectKind, top, skip, maxpagesize, 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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.GetExportedModelJobStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportedModelJobStatusRequest(projectName, exportedModelName, 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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.GetDeployments", "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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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 => UtteranceEvaluationResult.DeserializeUtteranceEvaluationResult(e), ClientDiagnostics, _pipeline, "ConversationalAnalysisAuthoring.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 => UtteranceEvaluationResult.DeserializeUtteranceEvaluationResult(e), ClientDiagnostics, _pipeline, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.GetTrainingJobs", "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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.GetExportedModels", "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("ConversationalAnalysisAuthoring.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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, CopyProjectConfig 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, CopyProjectConfig 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("ConversationalAnalysisAuthoring.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.CopyProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCopyProjectRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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. + /// + /// The format of the exported project file to use. + /// 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, ExportedProjectFormat? exportedProjectFormat = null, 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(), exportedProjectFormat?.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. + /// + /// The format of the exported project file to use. + /// 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, ExportedProjectFormat? exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + RequestContext context = FromCancellationToken(cancellationToken); + return Export(waitUntil, projectName, stringIndexType.ToString(), exportedProjectFormat?.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" + /// + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// 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 exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, exportedProjectFormat, assetKind, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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" + /// + /// The format of the exported project file to use. Allowed values: "Conversation" | "Luis". + /// 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 exportedProjectFormat = null, string assetKind = null, string trainedModelLabel = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(stringIndexType, nameof(stringIndexType)); + + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, stringIndexType, exportedProjectFormat, assetKind, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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 exported project file to use. + /// 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, ExportedProjectFormat? exportedProjectFormat = 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, exportedProjectFormat?.ToString(), 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 exported project file to use. + /// 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, ExportedProjectFormat? exportedProjectFormat = 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, exportedProjectFormat?.ToString(), 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 exported project file to use. Allowed values: "Conversation" | "Luis". + /// 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 exportedProjectFormat = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, exportedProjectFormat, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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 exported project file to use. Allowed values: "Conversation" | "Luis". + /// 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 exportedProjectFormat = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("ConversationalAnalysisAuthoring.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, exportedProjectFormat, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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, TrainingJobConfig 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, "ConversationalAnalysisAuthoring.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, TrainingJobConfig 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, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.Train"); + scope.Start(); + try + { + using HttpMessage message = CreateTrainRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.Train", 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, SwapDeploymentsConfig 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, SwapDeploymentsConfig 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("ConversationalAnalysisAuthoring.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.SwapDeployments"); + scope.Start(); + try + { + using HttpMessage message = CreateSwapDeploymentsRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.SwapDeployments", 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, CreateDeploymentConfig 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, CreateDeploymentConfig 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("ConversationalAnalysisAuthoring.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.DeleteDeployment"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentRequest(projectName, deploymentName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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, DeleteDeploymentConfig 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, DeleteDeploymentConfig 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("ConversationalAnalysisAuthoring.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.DeleteDeploymentFromResources"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDeploymentFromResourcesRequest(projectName, deploymentName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.DeleteDeploymentFromResources", 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, EvaluationConfig 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, "ConversationalAnalysisAuthoring.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, EvaluationConfig 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, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.EvaluateModel"); + scope.Start(); + try + { + using HttpMessage message = CreateEvaluateModelRequest(projectName, trainedModelLabel, content, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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] Restores the snapshot of this trained model to be the current working directory + /// of the 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 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("ConversationalAnalysisAuthoring.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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] Restores the snapshot of this trained model to be the current working directory + /// of the 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 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("ConversationalAnalysisAuthoring.LoadSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateLoadSnapshotRequest(projectName, trainedModelLabel, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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, AssignDeploymentResourcesConfig 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, AssignDeploymentResourcesConfig 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("ConversationalAnalysisAuthoring.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.AssignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateAssignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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, UnassignDeploymentResourcesConfig 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, UnassignDeploymentResourcesConfig 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("ConversationalAnalysisAuthoring.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.UnassignDeploymentResources"); + scope.Start(); + try + { + using HttpMessage message = CreateUnassignDeploymentResourcesRequest(projectName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.CancelTrainingJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTrainingJobRequest(projectName, jobId, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.CancelTrainingJob", 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("ConversationalAnalysisAuthoring.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.DeleteExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteExportedModelRequest(projectName, exportedModelName, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.DeleteExportedModel", 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, ExportedModelConfig 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, ExportedModelConfig 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("ConversationalAnalysisAuthoring.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return await ProtocolOperationHelpers.ProcessMessageWithoutResponseValueAsync(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.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("ConversationalAnalysisAuthoring.CreateOrUpdateExportedModel"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateExportedModelRequest(projectName, exportedModelName, content, context); + return ProtocolOperationHelpers.ProcessMessageWithoutResponseValue(_pipeline, message, ClientDiagnostics, "ConversationalAnalysisAuthoring.CreateOrUpdateExportedModel", 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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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 exportedProjectFormat, 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-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:export", false); + uri.AppendQuery("stringIndexType", stringIndexType, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (exportedProjectFormat != null) + { + uri.AppendQuery("format", exportedProjectFormat, 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 exportedProjectFormat, 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-conversations/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:import", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (exportedProjectFormat != null) + { + uri.AppendQuery("format", exportedProjectFormat, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + 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-conversations/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-conversations/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-conversations/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 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-conversations/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 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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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 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-conversations/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-conversations/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 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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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-conversations/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? top, 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-conversations/projects/global/deployments/resources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.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? top, 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-conversations/projects/global/languages", false); + uri.AppendQuery("projectKind", projectKind, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.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(string language, string multilingual, int? top, 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-conversations/projects/global/prebuilt-entities", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (language != null) + { + uri.AppendQuery("language", language, true); + } + if (multilingual != null) + { + uri.AppendQuery("multilingual", multilingual, true); + } + if (top != null) + { + uri.AppendQuery("top", top.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 CreateGetTrainingConfigVersionsRequest(string projectKind, int? top, 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-conversations/projects/global/training-config-versions", false); + uri.AppendQuery("projectKind", projectKind, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.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-conversations/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 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-conversations/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 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-conversations/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-conversations/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 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-conversations/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 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 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 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; + } + + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationsClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationsClient.cs new file mode 100644 index 000000000000..fa430ee6c879 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationsClient.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.Conversations +{ + // 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>.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. + /// + public partial class ConversationsClient + { + 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 ConversationsClient for mocking. + protected ConversationsClient() + { + } + + /// Initializes a new instance of ConversationsClient. + /// + /// 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 ConversationsClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new ConversationsClientOptions()) + { + } + + /// Initializes a new instance of ConversationsClient. + /// + /// 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 ConversationsClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new ConversationsClientOptions()) + { + } + + /// Initializes a new instance of ConversationsClient. + /// + /// 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 ConversationsClient(Uri endpoint, AzureKeyCredential credential, ConversationsClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new ConversationsClientOptions(); + + 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 ConversationsClient. + /// + /// 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 ConversationsClient(Uri endpoint, TokenCredential credential, ConversationsClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new ConversationsClientOptions(); + + 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 ConversationalAnalysisAuthoring. + /// The API version to use for this operation. + /// is null. + public virtual ConversationalAnalysisAuthoring GetConversationalAnalysisAuthoringClient(string apiVersion = "2024-11-15-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new ConversationalAnalysisAuthoring(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationsClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationsClientOptions.cs new file mode 100644 index 000000000000..c6018673e561 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/ConversationsClientOptions.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.Conversations +{ + /// Client options for ConversationsClient. + public partial class ConversationsClientOptions : 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 ConversationsClientOptions. + public ConversationsClientOptions(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Docs/ConversationalAnalysisAuthoring.xml b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Docs/ConversationalAnalysisAuthoring.xml new file mode 100644 index 000000000000..7770f4d0f6fe --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Docs/ConversationalAnalysisAuthoring.xml @@ -0,0 +1,5847 @@ + + + + + +This sample shows how to call GetProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync(""); +]]> +This sample shows how to call GetProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectAsync(""); +]]> + + + +This sample shows how to call GetProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject(""); +]]> +This sample shows how to call GetProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProject(""); +]]> + + + +This sample shows how to call GetProjectAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("projectName").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").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 GetProject and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("projectName").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").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 CreateProjectAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + 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("projectName").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + 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("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").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 CreateProject and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + 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("projectName").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + 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("settings").GetProperty("confidenceThreshold").ToString()); +Console.WriteLine(result.GetProperty("storageInputContainerName").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 CopyProjectAuthorizationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation); +]]> +This sample shows how to call CopyProjectAuthorizationAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); +]]> + + + +This sample shows how to call CopyProjectAuthorization. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation); +]]> +This sample shows how to call CopyProjectAuthorization with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); +]]> + + + +This sample shows how to call CopyProjectAuthorizationAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", +}); +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", +}); +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", ""); +]]> +This sample shows how to call GetCopyProjectStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetCopyProjectStatusAsync("", ""); +]]> + + + +This sample shows how to call GetCopyProjectStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", ""); +]]> +This sample shows how to call GetCopyProjectStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetCopyProjectStatus("", ""); +]]> + + + +This sample shows how to call GetCopyProjectStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", ""); +]]> +This sample shows how to call GetDeploymentAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentAsync("", ""); +]]> + + + +This sample shows how to call GetDeployment. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", ""); +]]> +This sample shows how to call GetDeployment with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeployment("", ""); +]]> + + + +This sample shows how to call GetDeploymentAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); +]]> +This sample shows how to call GetDeploymentDeleteFromResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentDeleteFromResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", ""); +]]> +This sample shows how to call GetDeploymentStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetDeploymentStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", ""); +]]> +This sample shows how to call GetDeploymentStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetDeploymentStatus("", "", ""); +]]> + + + +This sample shows how to call GetDeploymentStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", ""); +]]> +This sample shows how to call GetSwapDeploymentsStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSwapDeploymentsStatusAsync("", ""); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", ""); +]]> +This sample shows how to call GetSwapDeploymentsStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSwapDeploymentsStatus("", ""); +]]> + + + +This sample shows how to call GetSwapDeploymentsStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", ""); +]]> +This sample shows how to call GetExportStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportStatusAsync("", ""); +]]> + + + +This sample shows how to call GetExportStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", ""); +]]> +This sample shows how to call GetExportStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportStatus("", ""); +]]> + + + +This sample shows how to call GetExportStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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 GetImportStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", ""); +]]> +This sample shows how to call GetImportStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetImportStatusAsync("", ""); +]]> + + + +This sample shows how to call GetImportStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", ""); +]]> +This sample shows how to call GetImportStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetImportStatus("", ""); +]]> + + + +This sample shows how to call GetImportStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", ""); +]]> +This sample shows how to call GetTrainedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainedModelAsync("", ""); +]]> + + + +This sample shows how to call GetTrainedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", ""); +]]> +This sample shows how to call GetTrainedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainedModel("", ""); +]]> + + + +This sample shows how to call GetTrainedModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.DeleteTrainedModel("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetEvaluationStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", ""); +]]> +This sample shows how to call GetEvaluationStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetEvaluationStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetEvaluationStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", ""); +]]> +This sample shows how to call GetEvaluationStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetEvaluationStatus("", "", ""); +]]> + + + +This sample shows how to call GetEvaluationStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", ""); +]]> +This sample shows how to call GetModelEvaluationSummaryAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", ""); +]]> + + + +This sample shows how to call GetModelEvaluationSummary. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", ""); +]]> +This sample shows how to call GetModelEvaluationSummary with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", ""); +]]> + + + +This sample shows how to call GetModelEvaluationSummaryAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); +]]> +This sample shows how to call GetModelEvaluationSummaryAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); +]]> +This sample shows how to call GetModelEvaluationSummary with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetModelEvaluationSummary("", "", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); +Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); +]]> +This sample shows how to call GetLoadSnapshotStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetLoadSnapshotStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", ""); +]]> +This sample shows how to call GetLoadSnapshotStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetLoadSnapshotStatus("", "", ""); +]]> + + + +This sample shows how to call GetLoadSnapshotStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", ""); +]]> +This sample shows how to call GetAssignDeploymentResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignDeploymentResourcesStatus("", ""); +]]> + + + +This sample shows how to call GetAssignDeploymentResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", ""); +]]> +This sample shows how to call GetUnassignDeploymentResourcesStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetUnassignDeploymentResourcesStatus("", ""); +]]> + + + +This sample shows how to call GetUnassignDeploymentResourcesStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", ""); +]]> +This sample shows how to call GetTrainingStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingStatusAsync("", ""); +]]> + + + +This sample shows how to call GetTrainingStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", ""); +]]> +This sample shows how to call GetTrainingStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingStatus("", ""); +]]> + + + +This sample shows how to call GetTrainingStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync(""); +]]> +This sample shows how to call GetProjectDeletionStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetProjectDeletionStatusAsync(""); +]]> + + + +This sample shows how to call GetProjectDeletionStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus(""); +]]> +This sample shows how to call GetProjectDeletionStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetProjectDeletionStatus(""); +]]> + + + +This sample shows how to call GetProjectDeletionStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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 GetAssignedResourceDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignedResourceDeploymentsAsync(); +]]> +This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignedResourceDeploymentsAsync(top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetAssignedResourceDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignedResourceDeployments(); +]]> +This sample shows how to call GetAssignedResourceDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignedResourceDeployments(top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetAssignedResourceDeploymentsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignedResourceDeploymentsAsync(null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +]]> +This sample shows how to call GetAssignedResourceDeploymentsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetAssignedResourceDeployments and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignedResourceDeployments(null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +]]> +This sample shows how to call GetAssignedResourceDeployments with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetAssignedResourceDeployments(1234, 1234, 1234, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetSupportedLanguagesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation); +]]> +This sample shows how to call GetSupportedLanguagesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetSupportedLanguages. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedLanguages(ProjectKind.Conversation); +]]> +This sample shows how to call GetSupportedLanguages with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedLanguages(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetSupportedLanguagesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedLanguagesAsync("Conversation"); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); +]]> +This sample shows how to call GetSupportedLanguagesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedLanguagesAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetSupportedLanguages and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedLanguages("Conversation"); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); +]]> +This sample shows how to call GetSupportedLanguages with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedLanguages("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntitiesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedPrebuiltEntitiesAsync(); +]]> +This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedPrebuiltEntitiesAsync(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntities. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedPrebuiltEntities(); +]]> +This sample shows how to call GetSupportedPrebuiltEntities with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedPrebuiltEntities(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntitiesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedPrebuiltEntitiesAsync(null, null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); +]]> +This sample shows how to call GetSupportedPrebuiltEntitiesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetSupportedPrebuiltEntitiesAsync("", "", 1234, 1234, 1234, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetSupportedPrebuiltEntities and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedPrebuiltEntities(null, null, null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); +]]> +This sample shows how to call GetSupportedPrebuiltEntities with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetSupportedPrebuiltEntities("", "", 1234, 1234, 1234, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetTrainingConfigVersionsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation); +]]> +This sample shows how to call GetTrainingConfigVersionsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetTrainingConfigVersions. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation); +]]> +This sample shows how to call GetTrainingConfigVersions with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); +]]> + + + +This sample shows how to call GetTrainingConfigVersionsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingConfigVersionsAsync("Conversation"); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); +]]> +This sample shows how to call GetTrainingConfigVersionsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetTrainingConfigVersionsAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetTrainingConfigVersions and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingConfigVersions("Conversation"); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); +]]> +This sample shows how to call GetTrainingConfigVersions with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetTrainingConfigVersions("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); +Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); +Console.WriteLine(result.GetProperty("nextLink").ToString()); +]]> + + + +This sample shows how to call GetExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", ""); +]]> +This sample shows how to call GetExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelAsync("", ""); +]]> + + + +This sample shows how to call GetExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", ""); +]]> +This sample shows how to call GetExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModel("", ""); +]]> + + + +This sample shows how to call GetExportedModelAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", ""); +]]> +This sample shows how to call GetExportedModelJobStatusAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = await client.GetExportedModelJobStatusAsync("", "", ""); +]]> + + + +This sample shows how to call GetExportedModelJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", ""); +]]> +This sample shows how to call GetExportedModelJobStatus with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Response response = client.GetExportedModelJobStatus("", "", ""); +]]> + + + +This sample shows how to call GetExportedModelJobStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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 GetProjectsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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 GetTrainedModelsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) +{ +} +]]> +This sample shows how to call GetModelEvaluationResultsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetModelEvaluationResults. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) +{ +} +]]> +This sample shows how to call GetModelEvaluationResults with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (UtteranceEvaluationResult 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); +} +]]> +This sample shows how to call GetModelEvaluationResultsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); +} +]]> + + + +This sample shows how to call GetModelEvaluationResults and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); +} +]]> +This sample shows how to call GetModelEvaluationResults with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); +} +]]> + + + +This sample shows how to call GetDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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 GetExportedModelsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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 DeleteProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); +]]> + + + +This sample shows how to call DeleteProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteProject(WaitUntil.Completed, ""); +]]> + + + +This sample shows how to call CopyProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectConfig body = new CopyProjectConfig( +ProjectKind.Conversation, +"", +"", +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectConfig body = new CopyProjectConfig( +ProjectKind.Conversation, +"", +"", +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectConfig body = new CopyProjectConfig( +ProjectKind.Conversation, +"", +"", +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CopyProjectConfig body = new CopyProjectConfig( +ProjectKind.Conversation, +"", +"", +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectKind = "Conversation", + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call Export. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call ExportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call Export. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); +]]> + + + +This sample shows how to call ImportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(ProjectKind.Conversation, "", "")); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call ImportAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(ProjectKind.Conversation, "", "") +{ + Settings = new ProjectSettings(123.45F), + StorageInputContainerName = "", + Multilingual = true, + Description = "", +}) +{ + Assets = new ConversationExportedProjectAssets + { + Intents = { new ConversationExportedIntent("") }, + Entities = {new ConversationExportedEntity("") + { + CompositionSetting = CompositionSetting.ReturnLongestOverlap, + List = new ExportedEntityList + { + Sublists = {new ExportedEntitySublist + { + ListKey = "", + Synonyms = {new ExportedEntityListSynonym + { + Language = "", + Values = {""}, + }}, + }}, + }, + Prebuilts = {new ExportedPrebuiltEntity("")}, + Regex = new ExportedEntityRegex + { + Expressions = {new ExportedEntityRegexExpression + { + RegexKey = "", + Language = "", + RegexPattern = "", + }}, + }, + RequiredComponents = {""}, + }}, + Utterances = {new ConversationExportedUtterance("", "") + { + Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, + Language = "", + Dataset = "", + }}, + }, +}; +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); +]]> + + + +This sample shows how to call Import. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(ProjectKind.Conversation, "", "")); +Operation operation = client.Import(WaitUntil.Completed, "", body); +]]> +This sample shows how to call Import with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(ProjectKind.Conversation, "", "") +{ + Settings = new ProjectSettings(123.45F), + StorageInputContainerName = "", + Multilingual = true, + Description = "", +}) +{ + Assets = new ConversationExportedProjectAssets + { + Intents = { new ConversationExportedIntent("") }, + Entities = {new ConversationExportedEntity("") + { + CompositionSetting = CompositionSetting.ReturnLongestOverlap, + List = new ExportedEntityList + { + Sublists = {new ExportedEntitySublist + { + ListKey = "", + Synonyms = {new ExportedEntityListSynonym + { + Language = "", + Values = {""}, + }}, + }}, + }, + Prebuilts = {new ExportedPrebuiltEntity("")}, + Regex = new ExportedEntityRegex + { + Expressions = {new ExportedEntityRegexExpression + { + RegexKey = "", + Language = "", + RegexPattern = "", + }}, + }, + RequiredComponents = {""}, + }}, + Utterances = {new ConversationExportedUtterance("", "") + { + Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, + Language = "", + Dataset = "", + }}, + }, +}; +Operation operation = client.Import(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); +]]> + + + +This sample shows how to call ImportAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + intents = new object[] + { + new + { + category = "", + } + }, + entities = new object[] + { + new + { + category = "", + compositionSetting = "returnLongestOverlap", + list = new + { + sublists = new object[] + { + new + { + listKey = "", + synonyms = new object[] + { + new + { + language = "", + values = new object[] + { + "" + }, + } + }, + } + }, + }, + prebuilts = new object[] + { + new + { + category = "", + } + }, + regex = new + { + expressions = new object[] + { + new + { + regexKey = "", + language = "", + regexPattern = "", + } + }, + }, + requiredComponents = new object[] + { + "" + }, + } + }, + utterances = new object[] + { + new + { + entities = new object[] + { + new + { + category = "", + offset = 1234, + length = 1234, + } + }, + text = "", + language = "", + intent = "", + dataset = "", + } + }, + projectKind = "Conversation", + }, +}); +Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); +]]> + + + +This sample shows how to call Import. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + intents = new object[] + { + new + { + category = "", + } + }, + entities = new object[] + { + new + { + category = "", + compositionSetting = "returnLongestOverlap", + list = new + { + sublists = new object[] + { + new + { + listKey = "", + synonyms = new object[] + { + new + { + language = "", + values = new object[] + { + "" + }, + } + }, + } + }, + }, + prebuilts = new object[] + { + new + { + category = "", + } + }, + regex = new + { + expressions = new object[] + { + new + { + regexKey = "", + language = "", + regexPattern = "", + } + }, + }, + requiredComponents = new object[] + { + "" + }, + } + }, + utterances = new object[] + { + new + { + entities = new object[] + { + new + { + category = "", + offset = 1234, + length = 1234, + } + }, + text = "", + language = "", + intent = "", + dataset = "", + } + }, + projectKind = "Conversation", + }, +}); +Operation operation = client.Import(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); +]]> + + + +This sample shows how to call TrainAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobConfig body = new TrainingJobConfig("", TrainingMode.Advanced); +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobConfig body = new TrainingJobConfig("", TrainingMode.Advanced) +{ + TrainingConfigVersion = "", + EvaluationOptions = new EvaluationConfig + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, +}; +Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); +TrainingJobResult responseData = operation.Value; +]]> + + + +This sample shows how to call Train. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobConfig body = new TrainingJobConfig("", TrainingMode.Advanced); +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +TrainingJobConfig body = new TrainingJobConfig("", TrainingMode.Advanced) +{ + TrainingConfigVersion = "", + EvaluationOptions = new EvaluationConfig + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, +}; +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingMode = "advanced", +}); +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", + trainingMode = "advanced", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, +}); +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("trainingMode").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingMode = "advanced", +}); +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + modelLabel = "", + trainingConfigVersion = "", + trainingMode = "advanced", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, +}); +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("trainingMode").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 SwapDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call SwapDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); +Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> +This sample shows how to call SwapDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); +Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call SwapDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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 DeployProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentConfig body = new CreateDeploymentConfig(""); +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeployProjectAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentConfig body = new CreateDeploymentConfig("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProject. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentConfig body = new CreateDeploymentConfig(""); +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeployProject with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +CreateDeploymentConfig body = new CreateDeploymentConfig("") +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeployProjectAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteDeployment. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteDeploymentFromResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentConfig body = new DeleteDeploymentConfig(); +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeleteDeploymentFromResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentConfig body = new DeleteDeploymentConfig +{ + AssignedResourceIds = { "" }, +}; +Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentConfig body = new DeleteDeploymentConfig(); +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call DeleteDeploymentFromResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +DeleteDeploymentConfig body = new DeleteDeploymentConfig +{ + AssignedResourceIds = { "" }, +}; +Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call DeleteDeploymentFromResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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 EvaluateModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationConfig body = new EvaluationConfig(); +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationConfig body = new EvaluationConfig +{ + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationConfig body = new EvaluationConfig(); +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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +EvaluationConfig body = new EvaluationConfig +{ + 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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call LoadSnapshot. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call AssignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call AssignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(new ResourceMetadata[] +{ + new ResourceMetadata("", "", "") +}); +Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call AssignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> +This sample shows how to call UnassignDeploymentResourcesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); +Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResources. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); +]]> +This sample shows how to call UnassignDeploymentResources with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); +Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); +]]> + + + +This sample shows how to call UnassignDeploymentResourcesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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 DeleteExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call DeleteExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelConfig body = new ExportedModelConfig(""); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call CreateOrUpdateExportedModelAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelConfig body = new ExportedModelConfig(""); +Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModel. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelConfig body = new ExportedModelConfig(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> +This sample shows how to call CreateOrUpdateExportedModel with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +ExportedModelConfig body = new ExportedModelConfig(""); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); +]]> + + + +This sample shows how to call CreateOrUpdateExportedModelAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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(""); +ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + trainedModelLabel = "", +}); +Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", content); +]]> + + + \ No newline at end of file diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/Argument.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..908c3a5d8b43 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations +{ + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..1cf218e3912f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations +{ + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/ChangeTrackingList.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..3f4dbe7015be --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations +{ + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..44b7f44a36f4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations +{ + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/Optional.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..67f925cab7a1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations +{ + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..3f7d0cdc88c7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations +{ + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignDeploymentResourcesConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignDeploymentResourcesConfig.Serialization.cs new file mode 100644 index 000000000000..d01f5f789635 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignDeploymentResourcesConfig.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.Conversations.Models +{ + public partial class AssignDeploymentResourcesConfig : 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(AssignDeploymentResourcesConfig)} 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(); + } + + AssignDeploymentResourcesConfig 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(AssignDeploymentResourcesConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignDeploymentResourcesConfig(document.RootElement, options); + } + + internal static AssignDeploymentResourcesConfig DeserializeAssignDeploymentResourcesConfig(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 AssignDeploymentResourcesConfig(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(AssignDeploymentResourcesConfig)} does not support writing '{options.Format}' format."); + } + } + + AssignDeploymentResourcesConfig 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 DeserializeAssignDeploymentResourcesConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignDeploymentResourcesConfig)} 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 AssignDeploymentResourcesConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignDeploymentResourcesConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignDeploymentResourcesConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignDeploymentResourcesConfig.cs new file mode 100644 index 000000000000..7e4f2a50933b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignDeploymentResourcesConfig.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.Conversations.Models +{ + /// Represents the options for assigning Azure resources to a project. + public partial class AssignDeploymentResourcesConfig + { + /// + /// 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 AssignDeploymentResourcesConfig(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 AssignDeploymentResourcesConfig(IList resourcesMetadata, IDictionary serializedAdditionalRawData) + { + ResourcesMetadata = resourcesMetadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignDeploymentResourcesConfig() + { + } + + /// Represents the metadata for the resources to be assigned. + public IList ResourcesMetadata { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedDeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedDeploymentResource.Serialization.cs new file mode 100644 index 000000000000..90ded386eb00 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedDeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedDeploymentResource.cs new file mode 100644 index 000000000000..2df1dc778ccf --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentMetadata.Serialization.cs new file mode 100644 index 000000000000..59626465d811 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentMetadata.cs new file mode 100644 index 000000000000..a74c82ec7b2f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentsMetadata.Serialization.cs new file mode 100644 index 000000000000..d893cd999f41 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedProjectDeploymentsMetadata.cs new file mode 100644 index 000000000000..3f6ee6a897ff --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs new file mode 100644 index 000000000000..0c9726ab28f9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedResourceDeploymentsMetadata.Serialization.cs @@ -0,0 +1,156 @@ +// 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.Conversations.Models +{ + public partial class AssignedResourceDeploymentsMetadata : 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(AssignedResourceDeploymentsMetadata)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + 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(); + } + + AssignedResourceDeploymentsMetadata 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(AssignedResourceDeploymentsMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAssignedResourceDeploymentsMetadata(document.RootElement, options); + } + + internal static AssignedResourceDeploymentsMetadata DeserializeAssignedResourceDeploymentsMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssignedProjectDeploymentsMetadata.DeserializeAssignedProjectDeploymentsMetadata(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AssignedResourceDeploymentsMetadata(value, nextLink, 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(AssignedResourceDeploymentsMetadata)} does not support writing '{options.Format}' format."); + } + } + + AssignedResourceDeploymentsMetadata 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 DeserializeAssignedResourceDeploymentsMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AssignedResourceDeploymentsMetadata)} 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 AssignedResourceDeploymentsMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssignedResourceDeploymentsMetadata(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs new file mode 100644 index 000000000000..6f0c3aa9bd3d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AssignedResourceDeploymentsMetadata.cs @@ -0,0 +1,80 @@ +// 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.Conversations.Models +{ + /// Represents the metadata for deployments assigned to a resource. + public partial class AssignedResourceDeploymentsMetadata + { + /// + /// 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 list of retrieved assigned project deployments. + /// is null. + internal AssignedResourceDeploymentsMetadata(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The list of retrieved assigned project deployments. + /// The next page link. + /// Keeps track of any properties unknown to the library. + internal AssignedResourceDeploymentsMetadata(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AssignedResourceDeploymentsMetadata() + { + } + + /// The list of retrieved assigned project deployments. + public IReadOnlyList Value { get; } + /// The next page link. + public string NextLink { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsError.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsError.Serialization.cs new file mode 100644 index 000000000000..1b81284aa893 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsError.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.Conversations.Models +{ + public partial class AuthoringConversationsError : 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(AuthoringConversationsError)} 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(); + } + + AuthoringConversationsError 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(AuthoringConversationsError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAuthoringConversationsError(document.RootElement, options); + } + + internal static AuthoringConversationsError DeserializeAuthoringConversationsError(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(DeserializeAuthoringConversationsError(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 AuthoringConversationsError( + 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(AuthoringConversationsError)} does not support writing '{options.Format}' format."); + } + } + + AuthoringConversationsError 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 DeserializeAuthoringConversationsError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AuthoringConversationsError)} 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 AuthoringConversationsError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsError.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsError.cs new file mode 100644 index 000000000000..ca282ca83a9b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsError.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.Conversations.Models +{ + /// The error object. + public partial class AuthoringConversationsError + { + /// + /// 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 AuthoringConversationsError(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 AuthoringConversationsError(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 AuthoringConversationsError() + { + } + + /// 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsWarning.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsWarning.Serialization.cs new file mode 100644 index 000000000000..914c94b11421 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsWarning.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.Conversations.Models +{ + public partial class AuthoringConversationsWarning : 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(AuthoringConversationsWarning)} 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(); + } + + AuthoringConversationsWarning 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(AuthoringConversationsWarning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAuthoringConversationsWarning(document.RootElement, options); + } + + internal static AuthoringConversationsWarning DeserializeAuthoringConversationsWarning(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 AuthoringConversationsWarning(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(AuthoringConversationsWarning)} does not support writing '{options.Format}' format."); + } + } + + AuthoringConversationsWarning 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 DeserializeAuthoringConversationsWarning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AuthoringConversationsWarning)} 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 AuthoringConversationsWarning FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAuthoringConversationsWarning(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsWarning.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsWarning.cs new file mode 100644 index 000000000000..3e661e38a995 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/AuthoringConversationsWarning.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.Conversations.Models +{ + /// Represents a warning that was encountered while executing the request. + public partial class AuthoringConversationsWarning + { + /// + /// 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 AuthoringConversationsWarning(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 AuthoringConversationsWarning(string code, string message, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AuthoringConversationsWarning() + { + } + + /// The warning code. + public string Code { get; } + /// The warning message. + public string Message { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CompositionSetting.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CompositionSetting.cs new file mode 100644 index 000000000000..bbc84bacb9c8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CompositionSetting.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Conversations.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 ReturnLongestOverlapValue = "returnLongestOverlap"; + private const string RequireExactOverlapValue = "requireExactOverlap"; + private const string SeparateComponentsValue = "separateComponents"; + private const string CombineComponentsValue = "combineComponents"; + + /// + /// When two or more components are found in the text and overlap, the component + /// with the longest set of characters is returned. + /// + public static CompositionSetting ReturnLongestOverlap { get; } = new CompositionSetting(ReturnLongestOverlapValue); + /// + /// All components must overlap at the exact same characters in the text for the + /// entity to return. If one of the defined components is not matched or predicted, + /// the entity will not return. + /// + public static CompositionSetting RequireExactOverlap { get; } = new CompositionSetting(RequireExactOverlapValue); + /// + /// 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrix.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrix.Serialization.cs new file mode 100644 index 000000000000..6ae206c8189e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrix.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrix.cs new file mode 100644 index 000000000000..04c0528ecb07 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixCell.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixCell.Serialization.cs new file mode 100644 index 000000000000..5824c9ef4a6c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixCell.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixCell.cs new file mode 100644 index 000000000000..89befcb4dba1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixRow.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixRow.Serialization.cs new file mode 100644 index 000000000000..28e372f72ba6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixRow.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConfusionMatrixRow.cs new file mode 100644 index 000000000000..3dd6d2252c09 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedEntity.Serialization.cs new file mode 100644 index 000000000000..a4ec0d2f5559 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedEntity.Serialization.cs @@ -0,0 +1,237 @@ +// 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.Conversations.Models +{ + public partial class ConversationExportedEntity : 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(ConversationExportedEntity)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + 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(Regex)) + { + writer.WritePropertyName("regex"u8); + writer.WriteObjectValue(Regex, options); + } + if (Optional.IsCollectionDefined(RequiredComponents)) + { + writer.WritePropertyName("requiredComponents"u8); + writer.WriteStartArray(); + foreach (var item in RequiredComponents) + { + 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(); + } + + ConversationExportedEntity 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(ConversationExportedEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationExportedEntity(document.RootElement, options); + } + + internal static ConversationExportedEntity DeserializeConversationExportedEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string category = default; + CompositionSetting? compositionSetting = default; + ExportedEntityList list = default; + IList prebuilts = default; + ExportedEntityRegex regex = default; + IList requiredComponents = 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("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("regex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regex = ExportedEntityRegex.DeserializeExportedEntityRegex(property.Value, options); + continue; + } + if (property.NameEquals("requiredComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredComponents = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConversationExportedEntity( + category, + compositionSetting, + list, + prebuilts ?? new ChangeTrackingList(), + regex, + requiredComponents ?? 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(ConversationExportedEntity)} does not support writing '{options.Format}' format."); + } + } + + ConversationExportedEntity 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 DeserializeConversationExportedEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationExportedEntity)} 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 ConversationExportedEntity FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationExportedEntity(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedEntity.cs new file mode 100644 index 000000000000..cf4421e38475 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedEntity.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.Conversations.Models +{ + /// Represents an entity with its components. + public partial class ConversationExportedEntity + { + /// + /// 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 category of the entity. + /// is null. + public ConversationExportedEntity(string category) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + Prebuilts = new ChangeTrackingList(); + RequiredComponents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The category of the entity. + /// The behavior to follow when the entity's components overlap with each other. + /// The list component of the entity. + /// The prebuilt entities components. + /// The regex component of the entity. + /// The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. + /// Keeps track of any properties unknown to the library. + internal ConversationExportedEntity(string category, CompositionSetting? compositionSetting, ExportedEntityList list, IList prebuilts, ExportedEntityRegex regex, IList requiredComponents, IDictionary serializedAdditionalRawData) + { + Category = category; + CompositionSetting = compositionSetting; + List = list; + Prebuilts = prebuilts; + Regex = regex; + RequiredComponents = requiredComponents; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConversationExportedEntity() + { + } + + /// The category of the entity. + public string Category { get; } + /// 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 regex component of the entity. + public ExportedEntityRegex Regex { get; set; } + /// The required components. Allowed values are 'learned', 'list', 'prebuilts' and 'regex'. + public IList RequiredComponents { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedIntent.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedIntent.Serialization.cs new file mode 100644 index 000000000000..c343b0eca1b8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedIntent.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.Conversations.Models +{ + public partial class ConversationExportedIntent : 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(ConversationExportedIntent)} 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(); + } + + ConversationExportedIntent 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(ConversationExportedIntent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationExportedIntent(document.RootElement, options); + } + + internal static ConversationExportedIntent DeserializeConversationExportedIntent(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 ConversationExportedIntent(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(ConversationExportedIntent)} does not support writing '{options.Format}' format."); + } + } + + ConversationExportedIntent 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 DeserializeConversationExportedIntent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationExportedIntent)} 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 ConversationExportedIntent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationExportedIntent(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedIntent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedIntent.cs new file mode 100644 index 000000000000..fc9abd104803 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedIntent.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.Conversations.Models +{ + /// Represents an exported intent of a conversational project. + public partial class ConversationExportedIntent + { + /// + /// 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 intent category. + /// is null. + public ConversationExportedIntent(string category) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + } + + /// Initializes a new instance of . + /// The intent category. + /// Keeps track of any properties unknown to the library. + internal ConversationExportedIntent(string category, IDictionary serializedAdditionalRawData) + { + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConversationExportedIntent() + { + } + + /// The intent category. + public string Category { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..c25d78f2e27d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedProjectAssets.Serialization.cs @@ -0,0 +1,210 @@ +// 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.Conversations.Models +{ + public partial class ConversationExportedProjectAssets : 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(ConversationExportedProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Intents)) + { + writer.WritePropertyName("intents"u8); + writer.WriteStartArray(); + foreach (var item in Intents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Entities)) + { + writer.WritePropertyName("entities"u8); + writer.WriteStartArray(); + foreach (var item in Entities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Utterances)) + { + writer.WritePropertyName("utterances"u8); + writer.WriteStartArray(); + foreach (var item in Utterances) + { + 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(); + } + + ConversationExportedProjectAssets 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(ConversationExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationExportedProjectAssets(document.RootElement, options); + } + + internal static ConversationExportedProjectAssets DeserializeConversationExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList intents = default; + IList entities = default; + IList utterances = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("intents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConversationExportedIntent.DeserializeConversationExportedIntent(item, options)); + } + intents = array; + continue; + } + 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(ConversationExportedEntity.DeserializeConversationExportedEntity(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("utterances"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConversationExportedUtterance.DeserializeConversationExportedUtterance(item, options)); + } + utterances = 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 ConversationExportedProjectAssets(projectKind, serializedAdditionalRawData, intents ?? new ChangeTrackingList(), entities ?? new ChangeTrackingList(), utterances ?? 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(ConversationExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + ConversationExportedProjectAssets 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 DeserializeConversationExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationExportedProjectAssets)} 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 ConversationExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationExportedProjectAssets(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedProjectAssets.cs new file mode 100644 index 000000000000..a032124bb77a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedProjectAssets.cs @@ -0,0 +1,45 @@ +// 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.Conversations.Models +{ + /// Represents the exported assets of a conversational project. + public partial class ConversationExportedProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public ConversationExportedProjectAssets() + { + ProjectKind = ProjectKind.Conversation; + Intents = new ChangeTrackingList(); + Entities = new ChangeTrackingList(); + Utterances = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The type of project containing the assets. + /// Keeps track of any properties unknown to the library. + /// The intents defined in the project. + /// The entities defined in the project. + /// The utterances defined in the project. + internal ConversationExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList intents, IList entities, IList utterances) : base(projectKind, serializedAdditionalRawData) + { + Intents = intents; + Entities = entities; + Utterances = utterances; + } + + /// The intents defined in the project. + public IList Intents { get; } + /// The entities defined in the project. + public IList Entities { get; } + /// The utterances defined in the project. + public IList Utterances { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedUtterance.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedUtterance.Serialization.cs new file mode 100644 index 000000000000..5d51ab23ea51 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedUtterance.Serialization.cs @@ -0,0 +1,196 @@ +// 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.Conversations.Models +{ + public partial class ConversationExportedUtterance : 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(ConversationExportedUtterance)} 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(); + } + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + writer.WritePropertyName("intent"u8); + writer.WriteStringValue(Intent); + 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(); + } + + ConversationExportedUtterance 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(ConversationExportedUtterance)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConversationExportedUtterance(document.RootElement, options); + } + + internal static ConversationExportedUtterance DeserializeConversationExportedUtterance(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList entities = default; + string text = default; + string language = default; + string intent = 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(ExportedUtteranceEntityLabel.DeserializeExportedUtteranceEntityLabel(item, options)); + } + entities = array; + continue; + } + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("intent"u8)) + { + intent = 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 ConversationExportedUtterance( + entities ?? new ChangeTrackingList(), + text, + language, + intent, + 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(ConversationExportedUtterance)} does not support writing '{options.Format}' format."); + } + } + + ConversationExportedUtterance 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 DeserializeConversationExportedUtterance(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConversationExportedUtterance)} 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 ConversationExportedUtterance FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeConversationExportedUtterance(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedUtterance.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedUtterance.cs new file mode 100644 index 000000000000..febf047a1823 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ConversationExportedUtterance.cs @@ -0,0 +1,103 @@ +// 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.Conversations.Models +{ + /// Represents an exported utterance for a conversational project. + public partial class ConversationExportedUtterance + { + /// + /// 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 utterance text. + /// The intent of the utterance. + /// or is null. + public ConversationExportedUtterance(string text, string intent) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(intent, nameof(intent)); + + Entities = new ChangeTrackingList(); + Text = text; + Intent = intent; + } + + /// Initializes a new instance of . + /// Represents the entity labels of the utterance. + /// The utterance text. + /// + /// Represents the utterance's 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 intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal ConversationExportedUtterance(IList entities, string text, string language, string intent, string dataset, IDictionary serializedAdditionalRawData) + { + Entities = entities; + Text = text; + Language = language; + Intent = intent; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConversationExportedUtterance() + { + } + + /// Represents the entity labels of the utterance. + public IList Entities { get; } + /// The utterance text. + public string Text { get; } + /// + /// Represents the utterance's 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 intent of the utterance. + public string Intent { get; } + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectAuthorizationRequest.Serialization.cs new file mode 100644 index 000000000000..a8eb5420c8d0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectAuthorizationRequest.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectAuthorizationRequest.cs new file mode 100644 index 000000000000..e82e169ea71d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectAuthorizationRequest.cs @@ -0,0 +1,80 @@ +// 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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectConfig.Serialization.cs new file mode 100644 index 000000000000..1bc843b8c8df --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectConfig.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.Conversations.Models +{ + public partial class CopyProjectConfig : 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(CopyProjectConfig)} 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(); + } + + CopyProjectConfig 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(CopyProjectConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyProjectConfig(document.RootElement, options); + } + + internal static CopyProjectConfig DeserializeCopyProjectConfig(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 CopyProjectConfig( + 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(CopyProjectConfig)} does not support writing '{options.Format}' format."); + } + } + + CopyProjectConfig 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 DeserializeCopyProjectConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyProjectConfig)} 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 CopyProjectConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCopyProjectConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectConfig.cs new file mode 100644 index 000000000000..bbff4d00f07e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CopyProjectConfig.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.Conversations.Models +{ + /// + /// Represents the options for copying an existing project to another Azure + /// resource. + /// + public partial class CopyProjectConfig + { + /// + /// 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 CopyProjectConfig(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 CopyProjectConfig(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 CopyProjectConfig() + { + } + + /// 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateDeploymentConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateDeploymentConfig.Serialization.cs new file mode 100644 index 000000000000..d7e622b18724 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateDeploymentConfig.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.Conversations.Models +{ + public partial class CreateDeploymentConfig : 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(CreateDeploymentConfig)} 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(); + } + + CreateDeploymentConfig 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(CreateDeploymentConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateDeploymentConfig(document.RootElement, options); + } + + internal static CreateDeploymentConfig DeserializeCreateDeploymentConfig(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 CreateDeploymentConfig(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(CreateDeploymentConfig)} does not support writing '{options.Format}' format."); + } + } + + CreateDeploymentConfig 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 DeserializeCreateDeploymentConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateDeploymentConfig)} 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 CreateDeploymentConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateDeploymentConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateDeploymentConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateDeploymentConfig.cs new file mode 100644 index 000000000000..abcffc46baa2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateDeploymentConfig.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.Conversations.Models +{ + /// Represents the options for creating or updating a project deployment. + public partial class CreateDeploymentConfig + { + /// + /// 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 CreateDeploymentConfig(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 CreateDeploymentConfig(string trainedModelLabel, IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateDeploymentConfig() + { + } + + /// 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateProjectConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateProjectConfig.Serialization.cs new file mode 100644 index 000000000000..d6b111ca1354 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateProjectConfig.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.Conversations.Models +{ + public partial class CreateProjectConfig : 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(CreateProjectConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectKind"u8); + writer.WriteStringValue(ProjectKind.ToString()); + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings, options); + } + if (Optional.IsDefined(StorageInputContainerName)) + { + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + } + 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(); + } + + CreateProjectConfig 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(CreateProjectConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateProjectConfig(document.RootElement, options); + } + + internal static CreateProjectConfig DeserializeCreateProjectConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProjectKind projectKind = default; + ProjectSettings settings = default; + string storageInputContainerName = 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("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + 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 CreateProjectConfig( + projectKind, + settings, + storageInputContainerName, + 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(CreateProjectConfig)} does not support writing '{options.Format}' format."); + } + } + + CreateProjectConfig 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 DeserializeCreateProjectConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateProjectConfig)} 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 CreateProjectConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCreateProjectConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateProjectConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateProjectConfig.cs new file mode 100644 index 000000000000..624bd030f005 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/CreateProjectConfig.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.Conversations.Models +{ + /// Represents the options used to create or update a project. + public partial class CreateProjectConfig + { + /// + /// 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 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 CreateProjectConfig(ProjectKind projectKind, string projectName, string language) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(language, nameof(language)); + + ProjectKind = projectKind; + ProjectName = projectName; + Language = language; + } + + /// Initializes a new instance of . + /// Represents the project kind. + /// The project settings. + /// The storage container name in case of conversation summarization. + /// 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 CreateProjectConfig(ProjectKind projectKind, ProjectSettings settings, string storageInputContainerName, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + Settings = settings; + StorageInputContainerName = storageInputContainerName; + ProjectName = projectName; + Multilingual = multilingual; + Description = description; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateProjectConfig() + { + } + + /// Represents the project kind. + public ProjectKind ProjectKind { get; } + /// The project settings. + public ProjectSettings Settings { get; set; } + /// The storage container name in case of conversation summarization. + public string StorageInputContainerName { 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeleteDeploymentConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeleteDeploymentConfig.Serialization.cs new file mode 100644 index 000000000000..37c9a7784b91 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeleteDeploymentConfig.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.Conversations.Models +{ + public partial class DeleteDeploymentConfig : 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(DeleteDeploymentConfig)} 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(); + } + + DeleteDeploymentConfig 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(DeleteDeploymentConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeleteDeploymentConfig(document.RootElement, options); + } + + internal static DeleteDeploymentConfig DeserializeDeleteDeploymentConfig(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 DeleteDeploymentConfig(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(DeleteDeploymentConfig)} does not support writing '{options.Format}' format."); + } + } + + DeleteDeploymentConfig 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 DeserializeDeleteDeploymentConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeleteDeploymentConfig)} 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 DeleteDeploymentConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDeleteDeploymentConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeleteDeploymentConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeleteDeploymentConfig.cs new file mode 100644 index 000000000000..d625f82422e3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeleteDeploymentConfig.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.Conversations.Models +{ + /// Represents the options for deleting a project deployment. + public partial class DeleteDeploymentConfig + { + /// + /// 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 DeleteDeploymentConfig() + { + 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 DeleteDeploymentConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeploymentResource.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeploymentResource.Serialization.cs new file mode 100644 index 000000000000..a228e7a521e7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeploymentResource.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/DeploymentResource.cs new file mode 100644 index 000000000000..798bce9e4a96 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntitiesEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..ff692912ae62 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntitiesEvaluationSummary.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.Conversations.Models +{ + public partial class EntitiesEvaluationSummary : 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(EntitiesEvaluationSummary)} 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(); + } + + EntitiesEvaluationSummary 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(EntitiesEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntitiesEvaluationSummary(document.RootElement, options); + } + + internal static EntitiesEvaluationSummary DeserializeEntitiesEvaluationSummary(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 EntitiesEvaluationSummary( + 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(EntitiesEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + EntitiesEvaluationSummary 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 DeserializeEntitiesEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntitiesEvaluationSummary)} 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 EntitiesEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEntitiesEvaluationSummary(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntitiesEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntitiesEvaluationSummary.cs new file mode 100644 index 000000000000..f52aed5626a1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntitiesEvaluationSummary.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.Conversations.Models +{ + /// Represents the evaluation result summary for the project's entities. + public partial class EntitiesEvaluationSummary + { + /// + /// 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 summary. + /// 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 EntitiesEvaluationSummary(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 summary. + /// 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 EntitiesEvaluationSummary(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 EntitiesEvaluationSummary() + { + } + + /// + /// 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 summary. + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntityEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntityEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..97ce6c544ed3 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntityEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EntityEvaluationSummary.cs new file mode 100644 index 000000000000..fc1fe9a36fbd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.Models +{ + /// Represents the evaluation result 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ErrorCode.cs new file mode 100644 index 000000000000..d5b1ba8b3ba4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationConfig.Serialization.cs new file mode 100644 index 000000000000..4d42e7c850a6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationConfig.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.Conversations.Models +{ + public partial class EvaluationConfig : 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(EvaluationConfig)} 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(); + } + + EvaluationConfig 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(EvaluationConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvaluationConfig(document.RootElement, options); + } + + internal static EvaluationConfig DeserializeEvaluationConfig(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 EvaluationConfig(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(EvaluationConfig)} does not support writing '{options.Format}' format."); + } + } + + EvaluationConfig 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 DeserializeEvaluationConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EvaluationConfig)} 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 EvaluationConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationConfig.cs new file mode 100644 index 000000000000..088a8a92e6e5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationConfig.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.Conversations.Models +{ + /// Represents the options used running the evaluation. + public partial class EvaluationConfig + { + /// + /// 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 EvaluationConfig() + { + } + + /// 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 EvaluationConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationJobResult.Serialization.cs new file mode 100644 index 000000000000..348dcb3a00fd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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; + } + EvaluationConfig 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 = EvaluationConfig.DeserializeEvaluationConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationJobResult.cs new file mode 100644 index 000000000000..359ac9a80ccb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(EvaluationConfig 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(EvaluationConfig 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 EvaluationConfig 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationKind.cs new file mode 100644 index 000000000000..89e3ae237833 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..b182dd7e103c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationSummary.Serialization.cs @@ -0,0 +1,158 @@ +// 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.Conversations.Models +{ + 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("entitiesEvaluation"u8); + writer.WriteObjectValue(EntitiesEvaluation, options); + writer.WritePropertyName("intentsEvaluation"u8); + writer.WriteObjectValue(IntentsEvaluation, options); + if (Optional.IsDefined(EvaluationOptions)) + { + 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; + } + EntitiesEvaluationSummary entitiesEvaluation = default; + IntentsEvaluationSummary intentsEvaluation = default; + EvaluationConfig evaluationOptions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entitiesEvaluation"u8)) + { + entitiesEvaluation = EntitiesEvaluationSummary.DeserializeEntitiesEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("intentsEvaluation"u8)) + { + intentsEvaluation = IntentsEvaluationSummary.DeserializeIntentsEvaluationSummary(property.Value, options); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evaluationOptions = EvaluationConfig.DeserializeEvaluationConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EvaluationSummary(entitiesEvaluation, intentsEvaluation, 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 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationSummary.cs new file mode 100644 index 000000000000..62a9b5be8132 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/EvaluationSummary.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.Conversations.Models +{ + /// Represents the evaluation result summary. + public 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 IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Contains the data related to entities evaluation. + /// Contains the data related to intents evaluation. + /// or is null. + internal EvaluationSummary(EntitiesEvaluationSummary entitiesEvaluation, IntentsEvaluationSummary intentsEvaluation) + { + Argument.AssertNotNull(entitiesEvaluation, nameof(entitiesEvaluation)); + Argument.AssertNotNull(intentsEvaluation, nameof(intentsEvaluation)); + + EntitiesEvaluation = entitiesEvaluation; + IntentsEvaluation = intentsEvaluation; + } + + /// Initializes a new instance of . + /// Contains the data related to entities evaluation. + /// Contains the data related to intents evaluation. + /// The options that were used while running the evaluation. + /// Keeps track of any properties unknown to the library. + internal EvaluationSummary(EntitiesEvaluationSummary entitiesEvaluation, IntentsEvaluationSummary intentsEvaluation, EvaluationConfig evaluationOptions, IDictionary serializedAdditionalRawData) + { + EntitiesEvaluation = entitiesEvaluation; + IntentsEvaluation = intentsEvaluation; + EvaluationOptions = evaluationOptions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EvaluationSummary() + { + } + + /// Contains the data related to entities evaluation. + public EntitiesEvaluationSummary EntitiesEvaluation { get; } + /// Contains the data related to intents evaluation. + public IntentsEvaluationSummary IntentsEvaluation { get; } + /// The options that were used while running the evaluation. + public EvaluationConfig EvaluationOptions { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestration.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestration.Serialization.cs new file mode 100644 index 000000000000..02898e816d05 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestration.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.Conversations.Models +{ + public partial class ExportedConversationOrchestration : 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(ExportedConversationOrchestration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + 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(); + } + + ExportedConversationOrchestration 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(ExportedConversationOrchestration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedConversationOrchestration(document.RootElement, options); + } + + internal static ExportedConversationOrchestration DeserializeExportedConversationOrchestration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectName = default; + string deploymentName = 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("deploymentName"u8)) + { + deploymentName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedConversationOrchestration(projectName, 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(ExportedConversationOrchestration)} does not support writing '{options.Format}' format."); + } + } + + ExportedConversationOrchestration 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 DeserializeExportedConversationOrchestration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedConversationOrchestration)} 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 ExportedConversationOrchestration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedConversationOrchestration(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestration.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestration.cs new file mode 100644 index 000000000000..eeb906a0a7ed --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestration.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.Conversations.Models +{ + /// Defines the orchestration details for a Conversational project target. + public partial class ExportedConversationOrchestration + { + /// + /// 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 targeted project. + /// The name of the targeted deployment. + /// or is null. + public ExportedConversationOrchestration(string projectName, string deploymentName) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(deploymentName, nameof(deploymentName)); + + ProjectName = projectName; + DeploymentName = deploymentName; + } + + /// Initializes a new instance of . + /// The name of the targeted project. + /// The name of the targeted deployment. + /// Keeps track of any properties unknown to the library. + internal ExportedConversationOrchestration(string projectName, string deploymentName, IDictionary serializedAdditionalRawData) + { + ProjectName = projectName; + DeploymentName = deploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedConversationOrchestration() + { + } + + /// The name of the targeted project. + public string ProjectName { get; } + /// The name of the targeted deployment. + public string DeploymentName { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestrationConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestrationConfig.Serialization.cs new file mode 100644 index 000000000000..74d80d2681b9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestrationConfig.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.Conversations.Models +{ + public partial class ExportedConversationOrchestrationConfig : 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(ExportedConversationOrchestrationConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("conversationOrchestration"u8); + writer.WriteObjectValue(ConversationOrchestration, options); + writer.WritePropertyName("targetProjectKind"u8); + writer.WriteStringValue(TargetProjectKind.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(); + } + + ExportedConversationOrchestrationConfig 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(ExportedConversationOrchestrationConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedConversationOrchestrationConfig(document.RootElement, options); + } + + internal static ExportedConversationOrchestrationConfig DeserializeExportedConversationOrchestrationConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedConversationOrchestration conversationOrchestration = default; + OrchestrationTargetProjectKind targetProjectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("conversationOrchestration"u8)) + { + conversationOrchestration = ExportedConversationOrchestration.DeserializeExportedConversationOrchestration(property.Value, options); + continue; + } + if (property.NameEquals("targetProjectKind"u8)) + { + targetProjectKind = new OrchestrationTargetProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedConversationOrchestrationConfig(targetProjectKind, serializedAdditionalRawData, conversationOrchestration); + } + + 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(ExportedConversationOrchestrationConfig)} does not support writing '{options.Format}' format."); + } + } + + ExportedConversationOrchestrationConfig 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 DeserializeExportedConversationOrchestrationConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedConversationOrchestrationConfig)} 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 ExportedConversationOrchestrationConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedConversationOrchestrationConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestrationConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestrationConfig.cs new file mode 100644 index 000000000000..1cdb23dcfeb2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedConversationOrchestrationConfig.cs @@ -0,0 +1,44 @@ +// 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.Conversations.Models +{ + /// Represents the orchestration options for a Conversational project target. + public partial class ExportedConversationOrchestrationConfig : ExportedOrchestrationConfig + { + /// Initializes a new instance of . + /// The Conversational project target details. + /// is null. + public ExportedConversationOrchestrationConfig(ExportedConversationOrchestration conversationOrchestration) + { + Argument.AssertNotNull(conversationOrchestration, nameof(conversationOrchestration)); + + TargetProjectKind = OrchestrationTargetProjectKind.Conversation; + ConversationOrchestration = conversationOrchestration; + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The Conversational project target details. + internal ExportedConversationOrchestrationConfig(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData, ExportedConversationOrchestration conversationOrchestration) : base(targetProjectKind, serializedAdditionalRawData) + { + ConversationOrchestration = conversationOrchestration; + } + + /// Initializes a new instance of for deserialization. + internal ExportedConversationOrchestrationConfig() + { + } + + /// The Conversational project target details. + public ExportedConversationOrchestration ConversationOrchestration { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityList.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityList.Serialization.cs new file mode 100644 index 000000000000..41deaa1c77c1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityList.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityList.cs new file mode 100644 index 000000000000..2ecfdc5a0911 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityListSynonym.Serialization.cs new file mode 100644 index 000000000000..c13e589fbca0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityListSynonym.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityListSynonym.cs new file mode 100644 index 000000000000..4c7670932b37 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegex.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegex.Serialization.cs new file mode 100644 index 000000000000..86f5fa2a1f99 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegex.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.Conversations.Models +{ + public partial class ExportedEntityRegex : 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(ExportedEntityRegex)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Expressions)) + { + writer.WritePropertyName("expressions"u8); + writer.WriteStartArray(); + foreach (var item in Expressions) + { + 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(); + } + + ExportedEntityRegex 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(ExportedEntityRegex)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityRegex(document.RootElement, options); + } + + internal static ExportedEntityRegex DeserializeExportedEntityRegex(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList expressions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expressions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExportedEntityRegexExpression.DeserializeExportedEntityRegexExpression(item, options)); + } + expressions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityRegex(expressions ?? 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(ExportedEntityRegex)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityRegex 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 DeserializeExportedEntityRegex(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityRegex)} 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 ExportedEntityRegex FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityRegex(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegex.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegex.cs new file mode 100644 index 000000000000..f4b892d2ef79 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegex.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.Conversations.Models +{ + /// Represents a regex component of an entity. + public partial class ExportedEntityRegex + { + /// + /// 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 ExportedEntityRegex() + { + Expressions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The regex expressions of the regex component. These expressions follow the .NET + /// regex syntax. For reference, check here: + /// https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions + /// + /// Keeps track of any properties unknown to the library. + internal ExportedEntityRegex(IList expressions, IDictionary serializedAdditionalRawData) + { + Expressions = expressions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The regex expressions of the regex component. These expressions follow the .NET + /// regex syntax. For reference, check here: + /// https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions + /// + public IList Expressions { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegexExpression.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegexExpression.Serialization.cs new file mode 100644 index 000000000000..da0b072c2b70 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegexExpression.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.Conversations.Models +{ + public partial class ExportedEntityRegexExpression : 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(ExportedEntityRegexExpression)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(RegexKey)) + { + writer.WritePropertyName("regexKey"u8); + writer.WriteStringValue(RegexKey); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + if (Optional.IsDefined(RegexPattern)) + { + writer.WritePropertyName("regexPattern"u8); + writer.WriteStringValue(RegexPattern); + } + 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(); + } + + ExportedEntityRegexExpression 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(ExportedEntityRegexExpression)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedEntityRegexExpression(document.RootElement, options); + } + + internal static ExportedEntityRegexExpression DeserializeExportedEntityRegexExpression(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string regexKey = default; + string language = default; + string regexPattern = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("regexKey"u8)) + { + regexKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("regexPattern"u8)) + { + regexPattern = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedEntityRegexExpression(regexKey, language, regexPattern, 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(ExportedEntityRegexExpression)} does not support writing '{options.Format}' format."); + } + } + + ExportedEntityRegexExpression 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 DeserializeExportedEntityRegexExpression(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedEntityRegexExpression)} 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 ExportedEntityRegexExpression FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedEntityRegexExpression(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegexExpression.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegexExpression.cs new file mode 100644 index 000000000000..6c08d680d727 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntityRegexExpression.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.Conversations.Models +{ + /// + /// Represents a regex expression inside a regex component. This expression follows + /// the .NET regex syntax. For reference, check here: + /// https://learn.microsoft.com/dotnet/standard/base-types/regular-expressions + /// + public partial class ExportedEntityRegexExpression + { + /// + /// 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 ExportedEntityRegexExpression() + { + } + + /// Initializes a new instance of . + /// The key of the regex expression. + /// + /// Represents the language of the regex expression. This is BCP-47 representation + /// of a language. For example, use "en" for English, "en-gb" for English (UK), + /// "es" for Spanish etc. + /// + /// The regex pattern. + /// Keeps track of any properties unknown to the library. + internal ExportedEntityRegexExpression(string regexKey, string language, string regexPattern, IDictionary serializedAdditionalRawData) + { + RegexKey = regexKey; + Language = language; + RegexPattern = regexPattern; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The key of the regex expression. + public string RegexKey { get; set; } + /// + /// Represents the language of the regex expression. 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 regex pattern. + public string RegexPattern { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntitySublist.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntitySublist.Serialization.cs new file mode 100644 index 000000000000..12aa7d128245 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntitySublist.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedEntitySublist.cs new file mode 100644 index 000000000000..7c0df772d51a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestration.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestration.Serialization.cs new file mode 100644 index 000000000000..9a18457bdb77 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestration.Serialization.cs @@ -0,0 +1,157 @@ +// 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.Conversations.Models +{ + public partial class ExportedLuisOrchestration : 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(ExportedLuisOrchestration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("appId"u8); + writer.WriteStringValue(AppId); + if (Optional.IsDefined(AppVersion)) + { + writer.WritePropertyName("appVersion"u8); + writer.WriteStringValue(AppVersion); + } + if (Optional.IsDefined(SlotName)) + { + writer.WritePropertyName("slotName"u8); + writer.WriteStringValue(SlotName); + } + 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(); + } + + ExportedLuisOrchestration 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(ExportedLuisOrchestration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedLuisOrchestration(document.RootElement, options); + } + + internal static ExportedLuisOrchestration DeserializeExportedLuisOrchestration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid appId = default; + string appVersion = default; + string slotName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appId"u8)) + { + appId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("appVersion"u8)) + { + appVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("slotName"u8)) + { + slotName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedLuisOrchestration(appId, appVersion, slotName, 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(ExportedLuisOrchestration)} does not support writing '{options.Format}' format."); + } + } + + ExportedLuisOrchestration 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 DeserializeExportedLuisOrchestration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedLuisOrchestration)} 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 ExportedLuisOrchestration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedLuisOrchestration(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestration.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestration.cs new file mode 100644 index 000000000000..ee94b67086a2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestration.cs @@ -0,0 +1,80 @@ +// 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.Conversations.Models +{ + /// Defines the orchestration details for a LUIS application target. + public partial class ExportedLuisOrchestration + { + /// + /// 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 LUIS application ID. + public ExportedLuisOrchestration(Guid appId) + { + AppId = appId; + } + + /// Initializes a new instance of . + /// The LUIS application ID. + /// The targeted version Id. + /// The targeted slot name. + /// Keeps track of any properties unknown to the library. + internal ExportedLuisOrchestration(Guid appId, string appVersion, string slotName, IDictionary serializedAdditionalRawData) + { + AppId = appId; + AppVersion = appVersion; + SlotName = slotName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedLuisOrchestration() + { + } + + /// The LUIS application ID. + public Guid AppId { get; } + /// The targeted version Id. + public string AppVersion { get; set; } + /// The targeted slot name. + public string SlotName { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestrationConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestrationConfig.Serialization.cs new file mode 100644 index 000000000000..34e916c0582b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestrationConfig.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.Conversations.Models +{ + public partial class ExportedLuisOrchestrationConfig : 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(ExportedLuisOrchestrationConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("luisOrchestration"u8); + writer.WriteObjectValue(LuisOrchestration, options); + writer.WritePropertyName("targetProjectKind"u8); + writer.WriteStringValue(TargetProjectKind.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(); + } + + ExportedLuisOrchestrationConfig 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(ExportedLuisOrchestrationConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedLuisOrchestrationConfig(document.RootElement, options); + } + + internal static ExportedLuisOrchestrationConfig DeserializeExportedLuisOrchestrationConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedLuisOrchestration luisOrchestration = default; + OrchestrationTargetProjectKind targetProjectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("luisOrchestration"u8)) + { + luisOrchestration = ExportedLuisOrchestration.DeserializeExportedLuisOrchestration(property.Value, options); + continue; + } + if (property.NameEquals("targetProjectKind"u8)) + { + targetProjectKind = new OrchestrationTargetProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedLuisOrchestrationConfig(targetProjectKind, serializedAdditionalRawData, luisOrchestration); + } + + 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(ExportedLuisOrchestrationConfig)} does not support writing '{options.Format}' format."); + } + } + + ExportedLuisOrchestrationConfig 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 DeserializeExportedLuisOrchestrationConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedLuisOrchestrationConfig)} 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 ExportedLuisOrchestrationConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedLuisOrchestrationConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestrationConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestrationConfig.cs new file mode 100644 index 000000000000..c64f742075a5 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedLuisOrchestrationConfig.cs @@ -0,0 +1,44 @@ +// 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.Conversations.Models +{ + /// Represents the orchestration options for a LUIS application target. + public partial class ExportedLuisOrchestrationConfig : ExportedOrchestrationConfig + { + /// Initializes a new instance of . + /// The LUIS application target details. + /// is null. + public ExportedLuisOrchestrationConfig(ExportedLuisOrchestration luisOrchestration) + { + Argument.AssertNotNull(luisOrchestration, nameof(luisOrchestration)); + + TargetProjectKind = OrchestrationTargetProjectKind.Luis; + LuisOrchestration = luisOrchestration; + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The LUIS application target details. + internal ExportedLuisOrchestrationConfig(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData, ExportedLuisOrchestration luisOrchestration) : base(targetProjectKind, serializedAdditionalRawData) + { + LuisOrchestration = luisOrchestration; + } + + /// Initializes a new instance of for deserialization. + internal ExportedLuisOrchestrationConfig() + { + } + + /// The LUIS application target details. + public ExportedLuisOrchestration LuisOrchestration { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedModelConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedModelConfig.Serialization.cs new file mode 100644 index 000000000000..39234b5e17f0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedModelConfig.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.Conversations.Models +{ + public partial class ExportedModelConfig : 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(ExportedModelConfig)} 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(); + } + + ExportedModelConfig 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(ExportedModelConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedModelConfig(document.RootElement, options); + } + + internal static ExportedModelConfig DeserializeExportedModelConfig(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 ExportedModelConfig(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(ExportedModelConfig)} does not support writing '{options.Format}' format."); + } + } + + ExportedModelConfig 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 DeserializeExportedModelConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedModelConfig)} 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 ExportedModelConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedModelConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedModelConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedModelConfig.cs new file mode 100644 index 000000000000..331a7793feae --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedModelConfig.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.Conversations.Models +{ + /// Represents the options for creating or replacing an exported model. + public partial class ExportedModelConfig + { + /// + /// 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 ExportedModelConfig(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 ExportedModelConfig(string trainedModelLabel, IDictionary serializedAdditionalRawData) + { + TrainedModelLabel = trainedModelLabel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedModelConfig() + { + } + + /// The trained model label. + public string TrainedModelLabel { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedOrchestrationConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedOrchestrationConfig.Serialization.cs new file mode 100644 index 000000000000..58cd7631f678 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedOrchestrationConfig.Serialization.cs @@ -0,0 +1,128 @@ +// 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.Conversations.Models +{ + [PersistableModelProxy(typeof(UnknownExportedOrchestrationConfig))] + public partial class ExportedOrchestrationConfig : 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(ExportedOrchestrationConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("targetProjectKind"u8); + writer.WriteStringValue(TargetProjectKind.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(); + } + + ExportedOrchestrationConfig 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(ExportedOrchestrationConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedOrchestrationConfig(document.RootElement, options); + } + + internal static ExportedOrchestrationConfig DeserializeExportedOrchestrationConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("targetProjectKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Conversation": return ExportedConversationOrchestrationConfig.DeserializeExportedConversationOrchestrationConfig(element, options); + case "Luis": return ExportedLuisOrchestrationConfig.DeserializeExportedLuisOrchestrationConfig(element, options); + case "QuestionAnswering": return ExportedQuestionAnsweringOrchestrationConfig.DeserializeExportedQuestionAnsweringOrchestrationConfig(element, options); + } + } + return UnknownExportedOrchestrationConfig.DeserializeUnknownExportedOrchestrationConfig(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(ExportedOrchestrationConfig)} does not support writing '{options.Format}' format."); + } + } + + ExportedOrchestrationConfig 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 DeserializeExportedOrchestrationConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedOrchestrationConfig)} 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 ExportedOrchestrationConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedOrchestrationConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedOrchestrationConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedOrchestrationConfig.cs new file mode 100644 index 000000000000..94dfe9af3704 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedOrchestrationConfig.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.Conversations.Models +{ + /// + /// Represents the options used to define the orchestration behavior of an intent. + /// 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 ExportedOrchestrationConfig + { + /// + /// 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 ExportedOrchestrationConfig() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ExportedOrchestrationConfig(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData) + { + TargetProjectKind = targetProjectKind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the target project kind. + internal OrchestrationTargetProjectKind TargetProjectKind { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedPrebuiltEntity.Serialization.cs new file mode 100644 index 000000000000..13234d652894 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedPrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedPrebuiltEntity.cs new file mode 100644 index 000000000000..cefaa8b4c58f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProject.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProject.Serialization.cs new file mode 100644 index 000000000000..7a51c2a08d61 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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; + CreateProjectConfig 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 = CreateProjectConfig.DeserializeCreateProjectConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProject.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProject.cs new file mode 100644 index 000000000000..77b2ba0b6db1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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, CreateProjectConfig 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, CreateProjectConfig 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 CreateProjectConfig 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..7e084be2b856 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectAssets.Serialization.cs @@ -0,0 +1,127 @@ +// 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.Conversations.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 "Conversation": return ConversationExportedProjectAssets.DeserializeConversationExportedProjectAssets(element, options); + case "Orchestration": return OrchestrationExportedProjectAssets.DeserializeOrchestrationExportedProjectAssets(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectAssets.cs new file mode 100644 index 000000000000..0d8ca143c5bb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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 . + /// The type of project containing the assets. + /// Keeps track of any properties unknown to the library. + internal ExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData) + { + ProjectKind = projectKind; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of project containing the assets. + internal ProjectKind ProjectKind { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectFormat.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectFormat.cs new file mode 100644 index 000000000000..cd6e31e0dd8d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedProjectFormat.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Language.Authoring.Conversations.Models +{ + /// The ExportedProjectFormat. + public readonly partial struct ExportedProjectFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExportedProjectFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ConversationValue = "Conversation"; + private const string LuisValue = "Luis"; + + /// Specifies the format for a conversational project. + public static ExportedProjectFormat Conversation { get; } = new ExportedProjectFormat(ConversationValue); + /// Specifies the format for an application that was exported from LUIS. + public static ExportedProjectFormat Luis { get; } = new ExportedProjectFormat(LuisValue); + /// Determines if two values are the same. + public static bool operator ==(ExportedProjectFormat left, ExportedProjectFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExportedProjectFormat left, ExportedProjectFormat right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExportedProjectFormat(string value) => new ExportedProjectFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExportedProjectFormat other && Equals(other); + /// + public bool Equals(ExportedProjectFormat 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestration.Serialization.cs new file mode 100644 index 000000000000..d79600cf0bfe --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestration.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.Conversations.Models +{ + public partial class ExportedQuestionAnsweringOrchestration : 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(ExportedQuestionAnsweringOrchestration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + 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(); + } + + ExportedQuestionAnsweringOrchestration 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(ExportedQuestionAnsweringOrchestration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedQuestionAnsweringOrchestration(document.RootElement, options); + } + + internal static ExportedQuestionAnsweringOrchestration DeserializeExportedQuestionAnsweringOrchestration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectName = 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedQuestionAnsweringOrchestration(projectName, 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(ExportedQuestionAnsweringOrchestration)} does not support writing '{options.Format}' format."); + } + } + + ExportedQuestionAnsweringOrchestration 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 DeserializeExportedQuestionAnsweringOrchestration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestration)} 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 ExportedQuestionAnsweringOrchestration FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedQuestionAnsweringOrchestration(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestration.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestration.cs new file mode 100644 index 000000000000..2a8720526302 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestration.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.Conversations.Models +{ + /// Defines the orchestration details for a Question Answering project target. + public partial class ExportedQuestionAnsweringOrchestration + { + /// + /// 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 target project. + /// is null. + public ExportedQuestionAnsweringOrchestration(string projectName) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + + ProjectName = projectName; + } + + /// Initializes a new instance of . + /// The name of the target project. + /// Keeps track of any properties unknown to the library. + internal ExportedQuestionAnsweringOrchestration(string projectName, IDictionary serializedAdditionalRawData) + { + ProjectName = projectName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedQuestionAnsweringOrchestration() + { + } + + /// The name of the target project. + public string ProjectName { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestrationConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestrationConfig.Serialization.cs new file mode 100644 index 000000000000..88e588c09ad9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestrationConfig.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.Conversations.Models +{ + public partial class ExportedQuestionAnsweringOrchestrationConfig : 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(ExportedQuestionAnsweringOrchestrationConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("questionAnsweringOrchestration"u8); + writer.WriteObjectValue(QuestionAnsweringOrchestration, options); + writer.WritePropertyName("targetProjectKind"u8); + writer.WriteStringValue(TargetProjectKind.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(); + } + + ExportedQuestionAnsweringOrchestrationConfig 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(ExportedQuestionAnsweringOrchestrationConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedQuestionAnsweringOrchestrationConfig(document.RootElement, options); + } + + internal static ExportedQuestionAnsweringOrchestrationConfig DeserializeExportedQuestionAnsweringOrchestrationConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration = default; + OrchestrationTargetProjectKind targetProjectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("questionAnsweringOrchestration"u8)) + { + questionAnsweringOrchestration = ExportedQuestionAnsweringOrchestration.DeserializeExportedQuestionAnsweringOrchestration(property.Value, options); + continue; + } + if (property.NameEquals("targetProjectKind"u8)) + { + targetProjectKind = new OrchestrationTargetProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExportedQuestionAnsweringOrchestrationConfig(targetProjectKind, serializedAdditionalRawData, questionAnsweringOrchestration); + } + + 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(ExportedQuestionAnsweringOrchestrationConfig)} does not support writing '{options.Format}' format."); + } + } + + ExportedQuestionAnsweringOrchestrationConfig 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 DeserializeExportedQuestionAnsweringOrchestrationConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedQuestionAnsweringOrchestrationConfig)} 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 ExportedQuestionAnsweringOrchestrationConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedQuestionAnsweringOrchestrationConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestrationConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestrationConfig.cs new file mode 100644 index 000000000000..eba2bbf0e1f1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedQuestionAnsweringOrchestrationConfig.cs @@ -0,0 +1,44 @@ +// 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.Conversations.Models +{ + /// Represents the orchestration options for a Question Answering project target. + public partial class ExportedQuestionAnsweringOrchestrationConfig : ExportedOrchestrationConfig + { + /// Initializes a new instance of . + /// The Question Answering project details. + /// is null. + public ExportedQuestionAnsweringOrchestrationConfig(ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration) + { + Argument.AssertNotNull(questionAnsweringOrchestration, nameof(questionAnsweringOrchestration)); + + TargetProjectKind = OrchestrationTargetProjectKind.QuestionAnswering; + QuestionAnsweringOrchestration = questionAnsweringOrchestration; + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + /// The Question Answering project details. + internal ExportedQuestionAnsweringOrchestrationConfig(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData, ExportedQuestionAnsweringOrchestration questionAnsweringOrchestration) : base(targetProjectKind, serializedAdditionalRawData) + { + QuestionAnsweringOrchestration = questionAnsweringOrchestration; + } + + /// Initializes a new instance of for deserialization. + internal ExportedQuestionAnsweringOrchestrationConfig() + { + } + + /// The Question Answering project details. + public ExportedQuestionAnsweringOrchestration QuestionAnsweringOrchestration { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedTrainedModel.Serialization.cs new file mode 100644 index 000000000000..e0b6408c242c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedTrainedModel.cs new file mode 100644 index 000000000000..1a3a6a99c017 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedUtteranceEntityLabel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedUtteranceEntityLabel.Serialization.cs new file mode 100644 index 000000000000..9dfe8d29e76f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedUtteranceEntityLabel.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.Conversations.Models +{ + public partial class ExportedUtteranceEntityLabel : 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(ExportedUtteranceEntityLabel)} 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(); + } + + ExportedUtteranceEntityLabel 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(ExportedUtteranceEntityLabel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedUtteranceEntityLabel(document.RootElement, options); + } + + internal static ExportedUtteranceEntityLabel DeserializeExportedUtteranceEntityLabel(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 ExportedUtteranceEntityLabel(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(ExportedUtteranceEntityLabel)} does not support writing '{options.Format}' format."); + } + } + + ExportedUtteranceEntityLabel 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 DeserializeExportedUtteranceEntityLabel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedUtteranceEntityLabel)} 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 ExportedUtteranceEntityLabel FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeExportedUtteranceEntityLabel(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedUtteranceEntityLabel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedUtteranceEntityLabel.cs new file mode 100644 index 000000000000..62831ec63565 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ExportedUtteranceEntityLabel.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.Conversations.Models +{ + /// Represents an entity label for an utterance. + public partial class ExportedUtteranceEntityLabel + { + /// + /// 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 category of the entity label. + /// Start position for the entity text. + /// Length for the entity text. + /// is null. + public ExportedUtteranceEntityLabel(string category, int offset, int length) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + Offset = offset; + Length = length; + } + + /// Initializes a new instance of . + /// The category of the entity label. + /// Start position for the entity text. + /// Length for the entity text. + /// Keeps track of any properties unknown to the library. + internal ExportedUtteranceEntityLabel(string category, int offset, int length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExportedUtteranceEntityLabel() + { + } + + /// The category of the entity label. + public string Category { get; } + /// Start position for the entity text. + public int Offset { get; } + /// Length for the entity text. + public int Length { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.Serialization.cs new file mode 100644 index 000000000000..6714fe770f9c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetAssignDeploymentResourcesStatusResponse.cs new file mode 100644 index 000000000000..c789019e95eb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetCopyProjectStatusResponse.Serialization.cs new file mode 100644 index 000000000000..54a6802c17eb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetCopyProjectStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetCopyProjectStatusResponse.cs new file mode 100644 index 000000000000..fc4eb1c02496 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.Serialization.cs new file mode 100644 index 000000000000..6edcf1e6a4bf --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentDeleteFromResourcesStatusResponse.cs new file mode 100644 index 000000000000..c68e5fc2f6aa --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentResponse.Serialization.cs new file mode 100644 index 000000000000..a20c4f141a37 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentResponse.cs new file mode 100644 index 000000000000..b77cb59cf6c8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentStatusResponse.Serialization.cs new file mode 100644 index 000000000000..01ddfa29127d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetDeploymentStatusResponse.cs new file mode 100644 index 000000000000..6a2c1b75b553 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetEvaluationStatusResponse.Serialization.cs new file mode 100644 index 000000000000..30ed720eacd9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetEvaluationStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetEvaluationStatusResponse.cs new file mode 100644 index 000000000000..82fdbb80c95a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportStatusResponse.Serialization.cs new file mode 100644 index 000000000000..8d3ef2ba73b0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportStatusResponse.cs new file mode 100644 index 000000000000..740e4c0a59e9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelJobStatusResponse.Serialization.cs new file mode 100644 index 000000000000..c0abd47ae13e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelJobStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelJobStatusResponse.cs new file mode 100644 index 000000000000..ba8f7b87d017 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelResponse.Serialization.cs new file mode 100644 index 000000000000..66e9ab2ed8a4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetExportedModelResponse.cs new file mode 100644 index 000000000000..89accfa80b56 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetImportStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetImportStatusResponse.Serialization.cs new file mode 100644 index 000000000000..d84362ddad1a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetImportStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetImportStatusResponse.cs new file mode 100644 index 000000000000..c23f2d06665c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetLoadSnapshotStatusResponse.Serialization.cs new file mode 100644 index 000000000000..66dcc9227198 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetLoadSnapshotStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetLoadSnapshotStatusResponse.cs new file mode 100644 index 000000000000..9906cd892d9f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetProjectDeletionStatusResponse.Serialization.cs new file mode 100644 index 000000000000..1bdc91acfb02 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetProjectDeletionStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetProjectDeletionStatusResponse.cs new file mode 100644 index 000000000000..d5c89ffd882b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetSwapDeploymentsStatusResponse.Serialization.cs new file mode 100644 index 000000000000..1e0d231a11ba --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetSwapDeploymentsStatusResponse.cs new file mode 100644 index 000000000000..5fefc19b85e0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainedModelResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainedModelResponse.Serialization.cs new file mode 100644 index 000000000000..55b8d9c5bf38 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainedModelResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainedModelResponse.cs new file mode 100644 index 000000000000..3d6cd006bed4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainingStatusResponse.Serialization.cs new file mode 100644 index 000000000000..05c4c0b5eedf --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainingStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetTrainingStatusResponse.cs new file mode 100644 index 000000000000..f078e26d35f7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.Serialization.cs new file mode 100644 index 000000000000..32ff3dfeafb8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/GetUnassignDeploymentResourcesStatusResponse.cs new file mode 100644 index 000000000000..b3accaace795 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/InnerErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/InnerErrorCode.cs new file mode 100644 index 000000000000..c405e3267945 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/InnerErrorModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/InnerErrorModel.Serialization.cs new file mode 100644 index 000000000000..9d76c9274883 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/InnerErrorModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/InnerErrorModel.cs new file mode 100644 index 000000000000..e9c46e07cc27 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..e9b908297946 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentEvaluationSummary.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.Conversations.Models +{ + public partial class IntentEvaluationSummary : 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(IntentEvaluationSummary)} 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(); + } + + IntentEvaluationSummary 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(IntentEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIntentEvaluationSummary(document.RootElement, options); + } + + internal static IntentEvaluationSummary DeserializeIntentEvaluationSummary(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 IntentEvaluationSummary( + 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(IntentEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + IntentEvaluationSummary 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 DeserializeIntentEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IntentEvaluationSummary)} 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 IntentEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIntentEvaluationSummary(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentEvaluationSummary.cs new file mode 100644 index 000000000000..7ac271f33676 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentEvaluationSummary.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.Conversations.Models +{ + /// The evaluation summary for an intent. + public partial class IntentEvaluationSummary + { + /// + /// 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 IntentEvaluationSummary(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 IntentEvaluationSummary(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 IntentEvaluationSummary() + { + } + + /// 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentsEvaluationSummary.Serialization.cs new file mode 100644 index 000000000000..0b5173c34559 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentsEvaluationSummary.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.Conversations.Models +{ + public partial class IntentsEvaluationSummary : 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(IntentsEvaluationSummary)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("confusionMatrix"u8); + writer.WriteObjectValue(ConfusionMatrix, options); + writer.WritePropertyName("intents"u8); + writer.WriteStartObject(); + foreach (var item in Intents) + { + 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(); + } + + IntentsEvaluationSummary 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(IntentsEvaluationSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIntentsEvaluationSummary(document.RootElement, options); + } + + internal static IntentsEvaluationSummary DeserializeIntentsEvaluationSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConfusionMatrix confusionMatrix = default; + IReadOnlyDictionary intents = 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("intents"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, IntentEvaluationSummary.DeserializeIntentEvaluationSummary(property0.Value, options)); + } + intents = 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 IntentsEvaluationSummary( + confusionMatrix, + intents, + 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(IntentsEvaluationSummary)} does not support writing '{options.Format}' format."); + } + } + + IntentsEvaluationSummary 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 DeserializeIntentsEvaluationSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IntentsEvaluationSummary)} 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 IntentsEvaluationSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIntentsEvaluationSummary(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentsEvaluationSummary.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentsEvaluationSummary.cs new file mode 100644 index 000000000000..8d4b962e5b10 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/IntentsEvaluationSummary.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.Conversations.Models +{ + /// Represents the evaluation summary for the project's intents. + public partial class IntentsEvaluationSummary + { + /// + /// 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 intents (the two intents can be the + /// same). The matrix is between the intent that was labelled and the intent that + /// was predicted. + /// + /// Represents the intents evaluation summary. + /// 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 IntentsEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary intents, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall) + { + Argument.AssertNotNull(confusionMatrix, nameof(confusionMatrix)); + Argument.AssertNotNull(intents, nameof(intents)); + + ConfusionMatrix = confusionMatrix; + Intents = intents; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + } + + /// Initializes a new instance of . + /// + /// Represents the confusion matrix between two intents (the two intents can be the + /// same). The matrix is between the intent that was labelled and the intent that + /// was predicted. + /// + /// Represents the intents evaluation summary. + /// 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 IntentsEvaluationSummary(ConfusionMatrix confusionMatrix, IReadOnlyDictionary intents, float microF1, float microPrecision, float microRecall, float macroF1, float macroPrecision, float macroRecall, IDictionary serializedAdditionalRawData) + { + ConfusionMatrix = confusionMatrix; + Intents = intents; + MicroF1 = microF1; + MicroPrecision = microPrecision; + MicroRecall = microRecall; + MacroF1 = macroF1; + MacroPrecision = macroPrecision; + MacroRecall = macroRecall; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IntentsEvaluationSummary() + { + } + + /// + /// Represents the confusion matrix between two intents (the two intents can be the + /// same). The matrix is between the intent that was labelled and the intent that + /// was predicted. + /// + public ConfusionMatrix ConfusionMatrix { get; } + /// Represents the intents evaluation summary. + public IReadOnlyDictionary Intents { 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/JobStatus.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/JobStatus.cs new file mode 100644 index 000000000000..096009cf3e3b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedIntent.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedIntent.Serialization.cs new file mode 100644 index 000000000000..5d9838a20609 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedIntent.Serialization.cs @@ -0,0 +1,150 @@ +// 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.Conversations.Models +{ + public partial class OrchestrationExportedIntent : 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(OrchestrationExportedIntent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Orchestration)) + { + writer.WritePropertyName("orchestration"u8); + writer.WriteObjectValue(Orchestration, options); + } + 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(); + } + + OrchestrationExportedIntent 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(OrchestrationExportedIntent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOrchestrationExportedIntent(document.RootElement, options); + } + + internal static OrchestrationExportedIntent DeserializeOrchestrationExportedIntent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExportedOrchestrationConfig orchestration = default; + string category = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("orchestration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + orchestration = ExportedOrchestrationConfig.DeserializeExportedOrchestrationConfig(property.Value, options); + 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 OrchestrationExportedIntent(orchestration, 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(OrchestrationExportedIntent)} does not support writing '{options.Format}' format."); + } + } + + OrchestrationExportedIntent 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 DeserializeOrchestrationExportedIntent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OrchestrationExportedIntent)} 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 OrchestrationExportedIntent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOrchestrationExportedIntent(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedIntent.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedIntent.cs new file mode 100644 index 000000000000..e9cf580ed4c8 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedIntent.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.Conversations.Models +{ + /// Represents an exported intent for an orchestration project. + public partial class OrchestrationExportedIntent + { + /// + /// 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 intent category. + /// is null. + public OrchestrationExportedIntent(string category) + { + Argument.AssertNotNull(category, nameof(category)); + + Category = category; + } + + /// Initializes a new instance of . + /// + /// Specifies the behavior of this intent in the orchestration flow. + /// 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 . + /// + /// The intent category. + /// Keeps track of any properties unknown to the library. + internal OrchestrationExportedIntent(ExportedOrchestrationConfig orchestration, string category, IDictionary serializedAdditionalRawData) + { + Orchestration = orchestration; + Category = category; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OrchestrationExportedIntent() + { + } + + /// + /// Specifies the behavior of this intent in the orchestration flow. + /// 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 ExportedOrchestrationConfig Orchestration { get; set; } + /// The intent category. + public string Category { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..43eab3457779 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedProjectAssets.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.Conversations.Models +{ + public partial class OrchestrationExportedProjectAssets : 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(OrchestrationExportedProjectAssets)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Intents)) + { + writer.WritePropertyName("intents"u8); + writer.WriteStartArray(); + foreach (var item in Intents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Utterances)) + { + writer.WritePropertyName("utterances"u8); + writer.WriteStartArray(); + foreach (var item in Utterances) + { + 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(); + } + + OrchestrationExportedProjectAssets 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(OrchestrationExportedProjectAssets)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOrchestrationExportedProjectAssets(document.RootElement, options); + } + + internal static OrchestrationExportedProjectAssets DeserializeOrchestrationExportedProjectAssets(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList intents = default; + IList utterances = default; + ProjectKind projectKind = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("intents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OrchestrationExportedIntent.DeserializeOrchestrationExportedIntent(item, options)); + } + intents = array; + continue; + } + if (property.NameEquals("utterances"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OrchestrationExportedUtterance.DeserializeOrchestrationExportedUtterance(item, options)); + } + utterances = 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 OrchestrationExportedProjectAssets(projectKind, serializedAdditionalRawData, intents ?? new ChangeTrackingList(), utterances ?? 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(OrchestrationExportedProjectAssets)} does not support writing '{options.Format}' format."); + } + } + + OrchestrationExportedProjectAssets 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 DeserializeOrchestrationExportedProjectAssets(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OrchestrationExportedProjectAssets)} 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 OrchestrationExportedProjectAssets FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOrchestrationExportedProjectAssets(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedProjectAssets.cs new file mode 100644 index 000000000000..53b42f5b2feb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedProjectAssets.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.Conversations.Models +{ + /// Represents the assets of an orchestration project. + public partial class OrchestrationExportedProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + public OrchestrationExportedProjectAssets() + { + ProjectKind = ProjectKind.Orchestration; + Intents = new ChangeTrackingList(); + Utterances = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The type of project containing the assets. + /// Keeps track of any properties unknown to the library. + /// Represents the intents of the project. + /// Represents the utterances of the project. + internal OrchestrationExportedProjectAssets(ProjectKind projectKind, IDictionary serializedAdditionalRawData, IList intents, IList utterances) : base(projectKind, serializedAdditionalRawData) + { + Intents = intents; + Utterances = utterances; + } + + /// Represents the intents of the project. + public IList Intents { get; } + /// Represents the utterances of the project. + public IList Utterances { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedUtterance.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedUtterance.Serialization.cs new file mode 100644 index 000000000000..02deab6612b7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedUtterance.Serialization.cs @@ -0,0 +1,165 @@ +// 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.Conversations.Models +{ + public partial class OrchestrationExportedUtterance : 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(OrchestrationExportedUtterance)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + writer.WritePropertyName("intent"u8); + writer.WriteStringValue(Intent); + 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(); + } + + OrchestrationExportedUtterance 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(OrchestrationExportedUtterance)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOrchestrationExportedUtterance(document.RootElement, options); + } + + internal static OrchestrationExportedUtterance DeserializeOrchestrationExportedUtterance(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + string language = default; + string intent = default; + string dataset = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("intent"u8)) + { + intent = 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 OrchestrationExportedUtterance(text, language, intent, 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(OrchestrationExportedUtterance)} does not support writing '{options.Format}' format."); + } + } + + OrchestrationExportedUtterance 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 DeserializeOrchestrationExportedUtterance(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OrchestrationExportedUtterance)} 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 OrchestrationExportedUtterance FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeOrchestrationExportedUtterance(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedUtterance.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedUtterance.cs new file mode 100644 index 000000000000..01dd41f2d60d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationExportedUtterance.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.Conversations.Models +{ + /// Represents an utterance of an orchestration project. + public partial class OrchestrationExportedUtterance + { + /// + /// 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 utterance text. + /// The intent of the utterance. + /// or is null. + public OrchestrationExportedUtterance(string text, string intent) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(intent, nameof(intent)); + + Text = text; + Intent = intent; + } + + /// Initializes a new instance of . + /// The utterance text. + /// + /// Represents the utterance's 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 intent of the utterance. + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + /// Keeps track of any properties unknown to the library. + internal OrchestrationExportedUtterance(string text, string language, string intent, string dataset, IDictionary serializedAdditionalRawData) + { + Text = text; + Language = language; + Intent = intent; + Dataset = dataset; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OrchestrationExportedUtterance() + { + } + + /// The utterance text. + public string Text { get; } + /// + /// Represents the utterance's 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 intent of the utterance. + public string Intent { get; } + /// The dataset for this utterance. Allowed values are 'Train' and 'Test'. + public string Dataset { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationTargetProjectKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationTargetProjectKind.cs new file mode 100644 index 000000000000..84fb7033cab6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/OrchestrationTargetProjectKind.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.Conversations.Models +{ + /// The OrchestrationTargetProjectKind. + internal readonly partial struct OrchestrationTargetProjectKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OrchestrationTargetProjectKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LuisValue = "Luis"; + private const string ConversationValue = "Conversation"; + private const string QuestionAnsweringValue = "QuestionAnswering"; + + /// Luis. + public static OrchestrationTargetProjectKind Luis { get; } = new OrchestrationTargetProjectKind(LuisValue); + /// Conversation. + public static OrchestrationTargetProjectKind Conversation { get; } = new OrchestrationTargetProjectKind(ConversationValue); + /// QuestionAnswering. + public static OrchestrationTargetProjectKind QuestionAnswering { get; } = new OrchestrationTargetProjectKind(QuestionAnsweringValue); + /// Determines if two values are the same. + public static bool operator ==(OrchestrationTargetProjectKind left, OrchestrationTargetProjectKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OrchestrationTargetProjectKind left, OrchestrationTargetProjectKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OrchestrationTargetProjectKind(string value) => new OrchestrationTargetProjectKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OrchestrationTargetProjectKind other && Equals(other); + /// + public bool Equals(OrchestrationTargetProjectKind 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntities.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntities.Serialization.cs new file mode 100644 index 000000000000..aeba793e44c7 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntities.Serialization.cs @@ -0,0 +1,156 @@ +// 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.Conversations.Models +{ + public partial class PrebuiltEntities : 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(PrebuiltEntities)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + 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(); + } + + PrebuiltEntities 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(PrebuiltEntities)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrebuiltEntities(document.RootElement, options); + } + + internal static PrebuiltEntities DeserializePrebuiltEntities(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrebuiltEntity.DeserializePrebuiltEntity(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrebuiltEntities(value, nextLink, 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(PrebuiltEntities)} does not support writing '{options.Format}' format."); + } + } + + PrebuiltEntities 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 DeserializePrebuiltEntities(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrebuiltEntities)} 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 PrebuiltEntities FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePrebuiltEntities(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntities.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntities.cs new file mode 100644 index 000000000000..033325e4b4b1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntities.cs @@ -0,0 +1,80 @@ +// 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.Conversations.Models +{ + /// Represents a list of the retrieved supported prebuilt entities. + public partial class PrebuiltEntities + { + /// + /// 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 supported prebuilt entities. + /// is null. + internal PrebuiltEntities(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The supported prebuilt entities. + /// The next page link. + /// Keeps track of any properties unknown to the library. + internal PrebuiltEntities(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrebuiltEntities() + { + } + + /// The supported prebuilt entities. + public IReadOnlyList Value { get; } + /// The next page link. + public string NextLink { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntity.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntity.Serialization.cs new file mode 100644 index 000000000000..549e0ce11a8a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntity.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/PrebuiltEntity.cs new file mode 100644 index 000000000000..1240233357bd --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectDeployment.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectDeployment.Serialization.cs new file mode 100644 index 000000000000..c24b53ca7dba --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectDeployment.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectDeployment.cs new file mode 100644 index 000000000000..3db0fd9ad150 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectKind.cs new file mode 100644 index 000000000000..c85b61e20158 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectKind.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.Conversations.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 ConversationValue = "Conversation"; + private const string OrchestrationValue = "Orchestration"; + private const string CustomConversationSummarizationValue = "CustomConversationSummarization"; + + /// A project to build natural language into apps, bots, and IoT devices. + public static ProjectKind Conversation { get; } = new ProjectKind(ConversationValue); + /// A project to connect and orchestrate Conversation, Custom question answering and LUIS projects together in one single project. + public static ProjectKind Orchestration { get; } = new ProjectKind(OrchestrationValue); + /// A project to build conversation summarization models which are able to summarize long conversations. + public static ProjectKind CustomConversationSummarization { get; } = new ProjectKind(CustomConversationSummarizationValue); + /// 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectMetadata.Serialization.cs new file mode 100644 index 000000000000..e3b97c6c6ffa --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectMetadata.Serialization.cs @@ -0,0 +1,261 @@ +// 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.Conversations.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()); + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteObjectValue(Settings, options); + } + if (Optional.IsDefined(StorageInputContainerName)) + { + writer.WritePropertyName("storageInputContainerName"u8); + writer.WriteStringValue(StorageInputContainerName); + } + 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; + ProjectSettings settings = default; + string storageInputContainerName = 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("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settings = ProjectSettings.DeserializeProjectSettings(property.Value, options); + continue; + } + if (property.NameEquals("storageInputContainerName"u8)) + { + storageInputContainerName = property.Value.GetString(); + 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, + settings, + storageInputContainerName, + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectMetadata.cs new file mode 100644 index 000000000000..e08cae680f94 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectMetadata.cs @@ -0,0 +1,124 @@ +// 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.Conversations.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 creation datetime. + /// Represents the project kind. + /// 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 projectName, string language) + { + Argument.AssertNotNull(projectName, nameof(projectName)); + Argument.AssertNotNull(language, nameof(language)); + + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + ProjectKind = projectKind; + ProjectName = projectName; + Language = language; + } + + /// Initializes a new instance of . + /// Represents the project creation datetime. + /// Represents the project creation datetime. + /// Represents the project last trained datetime. + /// Represents the project last deployed datetime. + /// Represents the project kind. + /// The project settings. + /// The storage container name in case of conversation summarization. + /// 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, ProjectSettings settings, string storageInputContainerName, string projectName, bool? multilingual, string description, string language, IDictionary serializedAdditionalRawData) + { + CreatedDateTime = createdDateTime; + LastModifiedDateTime = lastModifiedDateTime; + LastTrainedDateTime = lastTrainedDateTime; + LastDeployedDateTime = lastDeployedDateTime; + ProjectKind = projectKind; + Settings = settings; + StorageInputContainerName = storageInputContainerName; + 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 creation datetime. + public DateTimeOffset LastModifiedDateTime { get; } + /// Represents the project last trained datetime. + public DateTimeOffset? LastTrainedDateTime { get; } + /// Represents the project last deployed datetime. + public DateTimeOffset? LastDeployedDateTime { get; } + /// Represents the project kind. + public ProjectKind ProjectKind { get; } + /// The project settings. + public ProjectSettings Settings { get; } + /// The storage container name in case of conversation summarization. + public string StorageInputContainerName { 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectSettings.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectSettings.Serialization.cs new file mode 100644 index 000000000000..43f34106c74c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectSettings.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.Conversations.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(); + writer.WritePropertyName("confidenceThreshold"u8); + writer.WriteNumberValue(ConfidenceThreshold); + 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; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("confidenceThreshold"u8)) + { + confidenceThreshold = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectSettings(confidenceThreshold, 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectSettings.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectSettings.cs new file mode 100644 index 000000000000..06fbb8bdd850 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectSettings.cs @@ -0,0 +1,72 @@ +// 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.Conversations.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 . + /// 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. + public ProjectSettings(float confidenceThreshold) + { + ConfidenceThreshold = confidenceThreshold; + } + + /// Initializes a new instance of . + /// 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. + /// Keeps track of any properties unknown to the library. + internal ProjectSettings(float confidenceThreshold, IDictionary serializedAdditionalRawData) + { + ConfidenceThreshold = confidenceThreshold; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectSettings() + { + } + + /// 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. + public float ConfidenceThreshold { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectTrainedModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectTrainedModel.Serialization.cs new file mode 100644 index 000000000000..fb03a2521a27 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectTrainedModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ProjectTrainedModel.cs new file mode 100644 index 000000000000..0cabe958db40 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ResourceMetadata.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ResourceMetadata.Serialization.cs new file mode 100644 index 000000000000..629a6454fea9 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ResourceMetadata.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/ResourceMetadata.cs new file mode 100644 index 000000000000..6b2d5bb5e2c0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/StringIndexType.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/StringIndexType.cs new file mode 100644 index 000000000000..6422d222b70b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SubTrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SubTrainingJobState.Serialization.cs new file mode 100644 index 000000000000..4c716c8d949e --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SubTrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SubTrainingJobState.cs new file mode 100644 index 000000000000..678dffd1e2f4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguage.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguage.Serialization.cs new file mode 100644 index 000000000000..336362b87a9c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguage.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguage.cs new file mode 100644 index 000000000000..9a7900ff57cb --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguages.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguages.Serialization.cs new file mode 100644 index 000000000000..ee1fadbe34ff --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguages.Serialization.cs @@ -0,0 +1,156 @@ +// 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.Conversations.Models +{ + public partial class SupportedLanguages : 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(SupportedLanguages)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + 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(); + } + + SupportedLanguages 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(SupportedLanguages)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSupportedLanguages(document.RootElement, options); + } + + internal static SupportedLanguages DeserializeSupportedLanguages(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SupportedLanguage.DeserializeSupportedLanguage(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SupportedLanguages(value, nextLink, 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(SupportedLanguages)} does not support writing '{options.Format}' format."); + } + } + + SupportedLanguages 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 DeserializeSupportedLanguages(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SupportedLanguages)} 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 SupportedLanguages FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSupportedLanguages(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguages.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguages.cs new file mode 100644 index 000000000000..4550f34fc42d --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SupportedLanguages.cs @@ -0,0 +1,80 @@ +// 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.Conversations.Models +{ + /// Represents a list of retrieved languages. + public partial class SupportedLanguages + { + /// + /// 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 list of the languages. + /// is null. + internal SupportedLanguages(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The list of the languages. + /// The next page link. + /// Keeps track of any properties unknown to the library. + internal SupportedLanguages(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SupportedLanguages() + { + } + + /// The list of the languages. + public IReadOnlyList Value { get; } + /// The next page link. + public string NextLink { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SwapDeploymentsConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SwapDeploymentsConfig.Serialization.cs new file mode 100644 index 000000000000..0a7be7ea106b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SwapDeploymentsConfig.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.Conversations.Models +{ + public partial class SwapDeploymentsConfig : 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(SwapDeploymentsConfig)} 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(); + } + + SwapDeploymentsConfig 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(SwapDeploymentsConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwapDeploymentsConfig(document.RootElement, options); + } + + internal static SwapDeploymentsConfig DeserializeSwapDeploymentsConfig(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 SwapDeploymentsConfig(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(SwapDeploymentsConfig)} does not support writing '{options.Format}' format."); + } + } + + SwapDeploymentsConfig 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 DeserializeSwapDeploymentsConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwapDeploymentsConfig)} 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 SwapDeploymentsConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSwapDeploymentsConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SwapDeploymentsConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SwapDeploymentsConfig.cs new file mode 100644 index 000000000000..c96138194720 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/SwapDeploymentsConfig.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.Conversations.Models +{ + /// Represents the options for swapping two deployments together. + public partial class SwapDeploymentsConfig + { + /// + /// 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 SwapDeploymentsConfig(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 SwapDeploymentsConfig(string firstDeploymentName, string secondDeploymentName, IDictionary serializedAdditionalRawData) + { + FirstDeploymentName = firstDeploymentName; + SecondDeploymentName = secondDeploymentName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SwapDeploymentsConfig() + { + } + + /// Represents the first deployment name. + public string FirstDeploymentName { get; } + /// Represents the second deployment name. + public string SecondDeploymentName { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersion.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersion.Serialization.cs new file mode 100644 index 000000000000..18edde7a4b05 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersion.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersion.cs new file mode 100644 index 000000000000..4eb97147c72a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersions.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersions.Serialization.cs new file mode 100644 index 000000000000..58e942068978 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersions.Serialization.cs @@ -0,0 +1,156 @@ +// 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.Conversations.Models +{ + public partial class TrainingConfigVersions : 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(TrainingConfigVersions)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + 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(); + } + + TrainingConfigVersions 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(TrainingConfigVersions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingConfigVersions(document.RootElement, options); + } + + internal static TrainingConfigVersions DeserializeTrainingConfigVersions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TrainingConfigVersion.DeserializeTrainingConfigVersion(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingConfigVersions(value, nextLink, 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(TrainingConfigVersions)} does not support writing '{options.Format}' format."); + } + } + + TrainingConfigVersions 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 DeserializeTrainingConfigVersions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingConfigVersions)} 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 TrainingConfigVersions FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingConfigVersions(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersions.cs new file mode 100644 index 000000000000..e51e37a08d49 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingConfigVersions.cs @@ -0,0 +1,80 @@ +// 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.Conversations.Models +{ + /// Represents a list of training config versions. + public partial class TrainingConfigVersions + { + /// + /// 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 list of the training config versions. + /// is null. + internal TrainingConfigVersions(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The list of the training config versions. + /// The next page link. + /// Keeps track of any properties unknown to the library. + internal TrainingConfigVersions(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingConfigVersions() + { + } + + /// The list of the training config versions. + public IReadOnlyList Value { get; } + /// The next page link. + public string NextLink { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobConfig.Serialization.cs new file mode 100644 index 000000000000..04781301b9a2 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobConfig.Serialization.cs @@ -0,0 +1,169 @@ +// 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.Conversations.Models +{ + public partial class TrainingJobConfig : 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(TrainingJobConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelLabel"u8); + writer.WriteStringValue(ModelLabel); + if (Optional.IsDefined(TrainingConfigVersion)) + { + writer.WritePropertyName("trainingConfigVersion"u8); + writer.WriteStringValue(TrainingConfigVersion); + } + writer.WritePropertyName("trainingMode"u8); + writer.WriteStringValue(TrainingMode.ToString()); + if (Optional.IsDefined(EvaluationOptions)) + { + 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(); + } + + TrainingJobConfig 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(TrainingJobConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrainingJobConfig(document.RootElement, options); + } + + internal static TrainingJobConfig DeserializeTrainingJobConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelLabel = default; + string trainingConfigVersion = default; + TrainingMode trainingMode = default; + EvaluationConfig evaluationOptions = 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("trainingMode"u8)) + { + trainingMode = new TrainingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("evaluationOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evaluationOptions = EvaluationConfig.DeserializeEvaluationConfig(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TrainingJobConfig(modelLabel, trainingConfigVersion, trainingMode, 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(TrainingJobConfig)} does not support writing '{options.Format}' format."); + } + } + + TrainingJobConfig 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 DeserializeTrainingJobConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TrainingJobConfig)} 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 TrainingJobConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTrainingJobConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobConfig.cs new file mode 100644 index 000000000000..fb18500734ac --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobConfig.cs @@ -0,0 +1,103 @@ +// 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.Conversations.Models +{ + /// Represents the options for starting a new training job. + public partial class TrainingJobConfig + { + /// + /// 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 the mode of the training operation. + /// is null. + public TrainingJobConfig(string modelLabel, TrainingMode trainingMode) + { + Argument.AssertNotNull(modelLabel, nameof(modelLabel)); + + ModelLabel = modelLabel; + TrainingMode = trainingMode; + } + + /// Initializes a new instance of . + /// Represents the output model label. + /// + /// Represents training config version. By default, "latest" value is used which + /// uses the latest released training config version. + /// + /// Represents the mode of the training operation. + /// + /// Represents the evaluation options. By default, the evaluation kind is + /// percentage, with training split percentage as 80, and testing split percentage + /// as 20. + /// + /// Keeps track of any properties unknown to the library. + internal TrainingJobConfig(string modelLabel, string trainingConfigVersion, TrainingMode trainingMode, EvaluationConfig evaluationOptions, IDictionary serializedAdditionalRawData) + { + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + TrainingMode = trainingMode; + EvaluationOptions = evaluationOptions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TrainingJobConfig() + { + } + + /// Represents the output model label. + public string ModelLabel { get; } + /// + /// Represents training config version. By default, "latest" value is used which + /// uses the latest released training config version. + /// + public string TrainingConfigVersion { get; set; } + /// Represents the mode of the training operation. + public TrainingMode TrainingMode { 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 EvaluationConfig EvaluationOptions { get; set; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobResult.Serialization.cs new file mode 100644 index 000000000000..20e981ba801b --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobResult.Serialization.cs @@ -0,0 +1,203 @@ +// 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.Conversations.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); + if (Optional.IsDefined(TrainingMode)) + { + writer.WritePropertyName("trainingMode"u8); + writer.WriteStringValue(TrainingMode.Value.ToString()); + } + 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; + TrainingMode? trainingMode = 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("trainingMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trainingMode = new TrainingMode(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, + trainingMode, + 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobResult.cs new file mode 100644 index 000000000000..09d35f71aa58 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobResult.cs @@ -0,0 +1,101 @@ +// 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.Conversations.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 the model training 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 the mode of the training operation. + /// Represents the model training status. + /// Represents model evaluation status. + /// Represents the estimated end date time for training and evaluation. + /// Keeps track of any properties unknown to the library. + internal TrainingJobResult(string modelLabel, string trainingConfigVersion, TrainingMode? trainingMode, SubTrainingJobState trainingStatus, SubTrainingJobState evaluationStatus, DateTimeOffset? estimatedEndDateTime, IDictionary serializedAdditionalRawData) + { + ModelLabel = modelLabel; + TrainingConfigVersion = trainingConfigVersion; + TrainingMode = trainingMode; + 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 the mode of the training operation. + public TrainingMode? TrainingMode { get; } + /// Represents the model training status. + public SubTrainingJobState TrainingStatus { get; } + /// Represents model evaluation status. + public SubTrainingJobState EvaluationStatus { get; } + /// Represents the estimated end date time for training and evaluation. + public DateTimeOffset? EstimatedEndDateTime { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobState.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobState.Serialization.cs new file mode 100644 index 000000000000..614ef2763429 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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(AuthoringConversationsWarning.DeserializeAuthoringConversationsWarning(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(AuthoringConversationsError.DeserializeAuthoringConversationsError(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobState.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingJobState.cs new file mode 100644 index 000000000000..ec1865a5b143 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingMode.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingMode.cs new file mode 100644 index 000000000000..e34f624b9130 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/TrainingMode.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.Conversations.Models +{ + /// The TrainingMode. + public readonly partial struct TrainingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TrainingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AdvancedValue = "advanced"; + private const string StandardValue = "standard"; + + /// + /// Trains using fine-tuned neural network transformer models. Can train + /// multilingual projects. + /// + public static TrainingMode Advanced { get; } = new TrainingMode(AdvancedValue); + /// Faster training times for quicker iterations. + public static TrainingMode Standard { get; } = new TrainingMode(StandardValue); + /// Determines if two values are the same. + public static bool operator ==(TrainingMode left, TrainingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TrainingMode left, TrainingMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TrainingMode(string value) => new TrainingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TrainingMode other && Equals(other); + /// + public bool Equals(TrainingMode 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnassignDeploymentResourcesConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnassignDeploymentResourcesConfig.Serialization.cs new file mode 100644 index 000000000000..efde7405d4e4 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnassignDeploymentResourcesConfig.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.Conversations.Models +{ + public partial class UnassignDeploymentResourcesConfig : 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(UnassignDeploymentResourcesConfig)} 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(); + } + + UnassignDeploymentResourcesConfig 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(UnassignDeploymentResourcesConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUnassignDeploymentResourcesConfig(document.RootElement, options); + } + + internal static UnassignDeploymentResourcesConfig DeserializeUnassignDeploymentResourcesConfig(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 UnassignDeploymentResourcesConfig(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(UnassignDeploymentResourcesConfig)} does not support writing '{options.Format}' format."); + } + } + + UnassignDeploymentResourcesConfig 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 DeserializeUnassignDeploymentResourcesConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UnassignDeploymentResourcesConfig)} 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 UnassignDeploymentResourcesConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnassignDeploymentResourcesConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnassignDeploymentResourcesConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnassignDeploymentResourcesConfig.cs new file mode 100644 index 000000000000..393d51445409 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnassignDeploymentResourcesConfig.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.Conversations.Models +{ + /// Represents the options to unassign Azure resources from a project. + public partial class UnassignDeploymentResourcesConfig + { + /// + /// 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 UnassignDeploymentResourcesConfig(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 UnassignDeploymentResourcesConfig(IList assignedResourceIds, IDictionary serializedAdditionalRawData) + { + AssignedResourceIds = assignedResourceIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UnassignDeploymentResourcesConfig() + { + } + + /// Represents the assigned resource IDs to be unassigned. + public IList AssignedResourceIds { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedOrchestrationConfig.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedOrchestrationConfig.Serialization.cs new file mode 100644 index 000000000000..08cf5f058372 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedOrchestrationConfig.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.Conversations.Models +{ + internal partial class UnknownExportedOrchestrationConfig : 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(ExportedOrchestrationConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("targetProjectKind"u8); + writer.WriteStringValue(TargetProjectKind.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(); + } + + ExportedOrchestrationConfig 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(ExportedOrchestrationConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExportedOrchestrationConfig(document.RootElement, options); + } + + internal static UnknownExportedOrchestrationConfig DeserializeUnknownExportedOrchestrationConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OrchestrationTargetProjectKind targetProjectKind = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetProjectKind"u8)) + { + targetProjectKind = new OrchestrationTargetProjectKind(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownExportedOrchestrationConfig(targetProjectKind, 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(ExportedOrchestrationConfig)} does not support writing '{options.Format}' format."); + } + } + + ExportedOrchestrationConfig 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 DeserializeExportedOrchestrationConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExportedOrchestrationConfig)} 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 UnknownExportedOrchestrationConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownExportedOrchestrationConfig(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedOrchestrationConfig.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedOrchestrationConfig.cs new file mode 100644 index 000000000000..4d1e66a24ade --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedOrchestrationConfig.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.Conversations.Models +{ + /// Unknown version of ExportedOrchestrationConfig. + internal partial class UnknownExportedOrchestrationConfig : ExportedOrchestrationConfig + { + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal UnknownExportedOrchestrationConfig(OrchestrationTargetProjectKind targetProjectKind, IDictionary serializedAdditionalRawData) : base(targetProjectKind, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownExportedOrchestrationConfig() + { + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedProjectAssets.Serialization.cs new file mode 100644 index 000000000000..6c75a2c9f26a --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedProjectAssets.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UnknownExportedProjectAssets.cs new file mode 100644 index 000000000000..ee565b1aa3f6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.Models +{ + /// Unknown version of ExportedProjectAssets. + internal partial class UnknownExportedProjectAssets : ExportedProjectAssets + { + /// Initializes a new instance of . + /// The type of project containing the assets. + /// 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntitiesEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntitiesEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..6e150d824cb6 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntitiesEvaluationResult.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.Conversations.Models +{ + public partial class UtteranceEntitiesEvaluationResult : 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(UtteranceEntitiesEvaluationResult)} 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(); + 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(); + } + + UtteranceEntitiesEvaluationResult 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(UtteranceEntitiesEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUtteranceEntitiesEvaluationResult(document.RootElement, options); + } + + internal static UtteranceEntitiesEvaluationResult DeserializeUtteranceEntitiesEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList expectedEntities = default; + IReadOnlyList predictedEntities = 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(UtteranceEntityEvaluationResult.DeserializeUtteranceEntityEvaluationResult(item, options)); + } + expectedEntities = array; + continue; + } + if (property.NameEquals("predictedEntities"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UtteranceEntityEvaluationResult.DeserializeUtteranceEntityEvaluationResult(item, options)); + } + predictedEntities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UtteranceEntitiesEvaluationResult(expectedEntities, predictedEntities, 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(UtteranceEntitiesEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + UtteranceEntitiesEvaluationResult 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 DeserializeUtteranceEntitiesEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UtteranceEntitiesEvaluationResult)} 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 UtteranceEntitiesEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUtteranceEntitiesEvaluationResult(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntitiesEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntitiesEvaluationResult.cs new file mode 100644 index 000000000000..f9d2544b918c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntitiesEvaluationResult.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.Conversations.Models +{ + /// + /// Represents the comparison between the expected and predicted entities for an + /// utterance. + /// + public partial class UtteranceEntitiesEvaluationResult + { + /// + /// 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 expected entity labels. + /// Represents the predicted entity labels. + /// or is null. + internal UtteranceEntitiesEvaluationResult(IEnumerable expectedEntities, IEnumerable predictedEntities) + { + Argument.AssertNotNull(expectedEntities, nameof(expectedEntities)); + Argument.AssertNotNull(predictedEntities, nameof(predictedEntities)); + + ExpectedEntities = expectedEntities.ToList(); + PredictedEntities = predictedEntities.ToList(); + } + + /// Initializes a new instance of . + /// Represents the expected entity labels. + /// Represents the predicted entity labels. + /// Keeps track of any properties unknown to the library. + internal UtteranceEntitiesEvaluationResult(IReadOnlyList expectedEntities, IReadOnlyList predictedEntities, IDictionary serializedAdditionalRawData) + { + ExpectedEntities = expectedEntities; + PredictedEntities = predictedEntities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UtteranceEntitiesEvaluationResult() + { + } + + /// Represents the expected entity labels. + public IReadOnlyList ExpectedEntities { get; } + /// Represents the predicted entity labels. + public IReadOnlyList PredictedEntities { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntityEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntityEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..8c2515d02cd0 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntityEvaluationResult.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.Conversations.Models +{ + public partial class UtteranceEntityEvaluationResult : 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(UtteranceEntityEvaluationResult)} 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(); + } + + UtteranceEntityEvaluationResult 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(UtteranceEntityEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUtteranceEntityEvaluationResult(document.RootElement, options); + } + + internal static UtteranceEntityEvaluationResult DeserializeUtteranceEntityEvaluationResult(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 UtteranceEntityEvaluationResult(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(UtteranceEntityEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + UtteranceEntityEvaluationResult 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 DeserializeUtteranceEntityEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UtteranceEntityEvaluationResult)} 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 UtteranceEntityEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUtteranceEntityEvaluationResult(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntityEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntityEvaluationResult.cs new file mode 100644 index 000000000000..f4a9ba651877 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEntityEvaluationResult.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.Conversations.Models +{ + /// Represents the evaluation output of an entity label or prediction. + public partial class UtteranceEntityEvaluationResult + { + /// + /// 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 UtteranceEntityEvaluationResult(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 UtteranceEntityEvaluationResult(string category, int offset, int length, IDictionary serializedAdditionalRawData) + { + Category = category; + Offset = offset; + Length = length; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UtteranceEntityEvaluationResult() + { + } + + /// 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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..a99feb6f9960 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEvaluationResult.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.Conversations.Models +{ + public partial class UtteranceEvaluationResult : 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(UtteranceEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("text"u8); + writer.WriteStringValue(Text); + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + writer.WritePropertyName("entitiesResult"u8); + writer.WriteObjectValue(EntitiesResult, options); + writer.WritePropertyName("intentsResult"u8); + writer.WriteObjectValue(IntentsResult, 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(); + } + + UtteranceEvaluationResult 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(UtteranceEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUtteranceEvaluationResult(document.RootElement, options); + } + + internal static UtteranceEvaluationResult DeserializeUtteranceEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string text = default; + string language = default; + UtteranceEntitiesEvaluationResult entitiesResult = default; + UtteranceIntentsEvaluationResult intentsResult = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("text"u8)) + { + text = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (property.NameEquals("entitiesResult"u8)) + { + entitiesResult = UtteranceEntitiesEvaluationResult.DeserializeUtteranceEntitiesEvaluationResult(property.Value, options); + continue; + } + if (property.NameEquals("intentsResult"u8)) + { + intentsResult = UtteranceIntentsEvaluationResult.DeserializeUtteranceIntentsEvaluationResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UtteranceEvaluationResult(text, language, entitiesResult, intentsResult, 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(UtteranceEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + UtteranceEvaluationResult 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 DeserializeUtteranceEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UtteranceEvaluationResult)} 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 UtteranceEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUtteranceEvaluationResult(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEvaluationResult.cs new file mode 100644 index 000000000000..3bdab032bb77 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceEvaluationResult.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.Conversations.Models +{ + /// Represents the evaluation result for an utterance. + public partial class UtteranceEvaluationResult + { + /// + /// 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 utterance text. + /// + /// Represents the utterance 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 entities results for the utterance. + /// Represents the intents results for the utterance. + /// , , or is null. + internal UtteranceEvaluationResult(string text, string language, UtteranceEntitiesEvaluationResult entitiesResult, UtteranceIntentsEvaluationResult intentsResult) + { + Argument.AssertNotNull(text, nameof(text)); + Argument.AssertNotNull(language, nameof(language)); + Argument.AssertNotNull(entitiesResult, nameof(entitiesResult)); + Argument.AssertNotNull(intentsResult, nameof(intentsResult)); + + Text = text; + Language = language; + EntitiesResult = entitiesResult; + IntentsResult = intentsResult; + } + + /// Initializes a new instance of . + /// Represents the utterance text. + /// + /// Represents the utterance 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 entities results for the utterance. + /// Represents the intents results for the utterance. + /// Keeps track of any properties unknown to the library. + internal UtteranceEvaluationResult(string text, string language, UtteranceEntitiesEvaluationResult entitiesResult, UtteranceIntentsEvaluationResult intentsResult, IDictionary serializedAdditionalRawData) + { + Text = text; + Language = language; + EntitiesResult = entitiesResult; + IntentsResult = intentsResult; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UtteranceEvaluationResult() + { + } + + /// Represents the utterance text. + public string Text { get; } + /// + /// Represents the utterance 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; } + /// Represents the entities results for the utterance. + public UtteranceEntitiesEvaluationResult EntitiesResult { get; } + /// Represents the intents results for the utterance. + public UtteranceIntentsEvaluationResult IntentsResult { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceIntentsEvaluationResult.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceIntentsEvaluationResult.Serialization.cs new file mode 100644 index 000000000000..f68ff4d78664 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceIntentsEvaluationResult.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.Conversations.Models +{ + public partial class UtteranceIntentsEvaluationResult : 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(UtteranceIntentsEvaluationResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("expectedIntent"u8); + writer.WriteStringValue(ExpectedIntent); + writer.WritePropertyName("predictedIntent"u8); + writer.WriteStringValue(PredictedIntent); + 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(); + } + + UtteranceIntentsEvaluationResult 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(UtteranceIntentsEvaluationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUtteranceIntentsEvaluationResult(document.RootElement, options); + } + + internal static UtteranceIntentsEvaluationResult DeserializeUtteranceIntentsEvaluationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string expectedIntent = default; + string predictedIntent = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expectedIntent"u8)) + { + expectedIntent = property.Value.GetString(); + continue; + } + if (property.NameEquals("predictedIntent"u8)) + { + predictedIntent = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UtteranceIntentsEvaluationResult(expectedIntent, predictedIntent, 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(UtteranceIntentsEvaluationResult)} does not support writing '{options.Format}' format."); + } + } + + UtteranceIntentsEvaluationResult 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 DeserializeUtteranceIntentsEvaluationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UtteranceIntentsEvaluationResult)} 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 UtteranceIntentsEvaluationResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUtteranceIntentsEvaluationResult(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/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceIntentsEvaluationResult.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceIntentsEvaluationResult.cs new file mode 100644 index 000000000000..b2c012e0370c --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Generated/Models/UtteranceIntentsEvaluationResult.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.Conversations.Models +{ + /// + /// Represents the comparison between the expected and the predicted intent for an + /// utterance. + /// + public partial class UtteranceIntentsEvaluationResult + { + /// + /// 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 utterance's expected intent. + /// Represents the utterance's predicted intent. + /// or is null. + internal UtteranceIntentsEvaluationResult(string expectedIntent, string predictedIntent) + { + Argument.AssertNotNull(expectedIntent, nameof(expectedIntent)); + Argument.AssertNotNull(predictedIntent, nameof(predictedIntent)); + + ExpectedIntent = expectedIntent; + PredictedIntent = predictedIntent; + } + + /// Initializes a new instance of . + /// Represents the utterance's expected intent. + /// Represents the utterance's predicted intent. + /// Keeps track of any properties unknown to the library. + internal UtteranceIntentsEvaluationResult(string expectedIntent, string predictedIntent, IDictionary serializedAdditionalRawData) + { + ExpectedIntent = expectedIntent; + PredictedIntent = predictedIntent; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UtteranceIntentsEvaluationResult() + { + } + + /// Represents the utterance's expected intent. + public string ExpectedIntent { get; } + /// Represents the utterance's predicted intent. + public string PredictedIntent { get; } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Properties/AssemblyInfo.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..71306c5583ab --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/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.Conversations.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/Azure.AI.Language.Authoring.Conversations/tests/Azure.AI.Language.Authoring.Conversations.Tests.csproj b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tests/Azure.AI.Language.Authoring.Conversations.Tests.csproj new file mode 100644 index 000000000000..d1bd1bb3a1ce --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tests/Azure.AI.Language.Authoring.Conversations.Tests.csproj @@ -0,0 +1,20 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tests/Generated/Samples/Samples_ConversationalAnalysisAuthoring.cs b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tests/Generated/Samples/Samples_ConversationalAnalysisAuthoring.cs new file mode 100644 index 000000000000..47d3fdfbb258 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tests/Generated/Samples/Samples_ConversationalAnalysisAuthoring.cs @@ -0,0 +1,6402 @@ +// 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.Conversations.Models; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.AI.Language.Authoring.Conversations.Samples +{ + public partial class Samples_ConversationalAnalysisAuthoring + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectMetadata_GetProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectMetadata_GetProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectMetadata_GetProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").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_ConversationalAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").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_ConversationalAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProject(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectMetadata_GetProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectMetadata_CreateProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + 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("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectMetadata_CreateProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + 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("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectMetadata_CreateProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + 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("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").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_ConversationalAnalysisAuthoringProjectMetadata_CreateProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + 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("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").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_ConversationalAnalysisAuthoring_CopyProjectAuthorization_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + }); + 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_ConversationalAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + }); + 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_ConversationalAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_CopyProjectAuthorization_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_CopyProjectAuthorization_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + 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_ConversationalAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + 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_ConversationalAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.CopyProjectAuthorization("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_CopyProjectAuthorization_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.CopyProjectAuthorizationAsync("", ProjectKind.Conversation, storageInputContainerName: "", allowOverwrite: true); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetCopyProjectStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringCopyProjectJobState_GetCopyProjectStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetCopyProjectStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectDeployment_GetDeployment_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeployment("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectDeployment_GetDeployment_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentDeleteFromResourcesStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringDeploymentDeleteFromResourcesJobState_GetDeploymentDeleteFromResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentDeleteFromResourcesStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetDeploymentStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringDeploymentJobState_GetDeploymentStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetDeploymentStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSwapDeploymentsStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringSwapDeploymentsJobState_GetSwapDeploymentsStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSwapDeploymentsStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringExportProjectJobState_GetExportStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringExportProjectJobState_GetExportStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringImportProjectJobState_GetImportStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetImportStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringImportProjectJobState_GetImportStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetImportStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.DeleteTrainedModel("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.DeleteTrainedModelAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.DeleteTrainedModel("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectTrainedModel_DeleteTrainedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.DeleteTrainedModelAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetEvaluationStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringEvaluationJobState_GetEvaluationStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetEvaluationStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetModelEvaluationSummary_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetModelEvaluationSummary_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").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_ConversationalAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", "", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("entities").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("entitiesEvaluation").GetProperty("macroRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("confusionMatrix").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("f1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("precision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("recall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("truePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("trueNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falsePositiveCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("intents").GetProperty("").GetProperty("falseNegativeCount").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("microRecall").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroF1").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroPrecision").ToString()); + Console.WriteLine(result.GetProperty("intentsEvaluation").GetProperty("macroRecall").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_ConversationalAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetModelEvaluationSummary("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetModelEvaluationSummary_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetModelEvaluationSummaryAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetLoadSnapshotStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringLoadSnapshotJobState_GetLoadSnapshotStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetLoadSnapshotStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringDeploymentResourcesJobState_GetAssignDeploymentResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetUnassignDeploymentResourcesStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetUnassignDeploymentResourcesStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetUnassignDeploymentResourcesStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetUnassignDeploymentResourcesStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingStatus("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingStatusAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetProjectDeletionStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_GetProjectDeletionStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_GetProjectDeletionStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetProjectDeletionStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetProjectDeletionStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_GetProjectDeletionStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_GetProjectDeletionStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetProjectDeletionStatus(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetProjectDeletionStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetProjectDeletionStatusAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetAssignedResourceDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignedResourceDeployments(null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetAssignedResourceDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignedResourceDeploymentsAsync(null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetAssignedResourceDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignedResourceDeployments(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetAssignedResourceDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignedResourceDeploymentsAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetAssignedResourceDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignedResourceDeployments(1234, 1234, 1234, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetAssignedResourceDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignedResourceDeploymentsAsync(1234, 1234, 1234, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("projectName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("lastDeployedDateTime").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("deploymentsMetadata")[0].GetProperty("deploymentExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetAssignedResourceDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetAssignedResourceDeployments(top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetAssignedResourceDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetAssignedResourceDeploymentsAsync(top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetSupportedLanguages_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedLanguages("Conversation"); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetSupportedLanguages_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedLanguagesAsync("Conversation"); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetSupportedLanguages_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedLanguages(ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetSupportedLanguages_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetSupportedLanguages_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedLanguages("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetSupportedLanguages_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedLanguagesAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageName").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("languageCode").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetSupportedLanguages_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedLanguages(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetSupportedLanguages_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedLanguagesAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetSupportedPrebuiltEntities_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedPrebuiltEntities(null, null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetSupportedPrebuiltEntities_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedPrebuiltEntitiesAsync(null, null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetSupportedPrebuiltEntities_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedPrebuiltEntities(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetSupportedPrebuiltEntities_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedPrebuiltEntitiesAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetSupportedPrebuiltEntities_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedPrebuiltEntities("", "", 1234, 1234, 1234, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetSupportedPrebuiltEntities_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedPrebuiltEntitiesAsync("", "", 1234, 1234, 1234, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("examples").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetSupportedPrebuiltEntities_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetSupportedPrebuiltEntities(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetSupportedPrebuiltEntities_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetSupportedPrebuiltEntitiesAsync(language: "", multilingual: "", top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetTrainingConfigVersions_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingConfigVersions("Conversation"); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetTrainingConfigVersions_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingConfigVersionsAsync("Conversation"); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetTrainingConfigVersions_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetTrainingConfigVersions_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetTrainingConfigVersions_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingConfigVersions("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetTrainingConfigVersions_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingConfigVersionsAsync("Conversation", top: 1234, skip: 1234, maxpagesize: 1234); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("value")[0].GetProperty("trainingConfigVersion").ToString()); + Console.WriteLine(result.GetProperty("value")[0].GetProperty("modelExpirationDate").ToString()); + Console.WriteLine(result.GetProperty("nextLink").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_GetTrainingConfigVersions_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetTrainingConfigVersions(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_GetTrainingConfigVersions_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetTrainingConfigVersionsAsync(ProjectKind.Conversation, top: 1234, skip: 1234, maxpagesize: 1234); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModel("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = client.GetExportedModelJobStatus("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringExportedModelJobState_GetExportedModelJobStatus_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Response response = await client.GetExportedModelJobStatusAsync("", "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("projectName").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectMetadata item in client.GetProjects()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectMetadata_GetProjects_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectMetadata item in client.GetProjectsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectMetadata_GetProjects_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").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_ConversationalAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("settings").GetProperty("confidenceThreshold").ToString()); + Console.WriteLine(result.GetProperty("storageInputContainerName").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_ConversationalAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectMetadata_GetProjects_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectDeployment item in client.GetDeployments("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectDeployment_GetDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectDeployment item in client.GetDeploymentsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectDeployment_GetDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ProjectTrainedModel item in client.GetTrainedModels("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModels_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ProjectTrainedModel item in client.GetTrainedModelsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringProjectTrainedModel_GetTrainedModels_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (BinaryData item in client.GetModelEvaluationResults("", "", "Utf16CodeUnit")) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (BinaryData item in client.GetModelEvaluationResultsAsync("", "", "Utf16CodeUnit")) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("text").ToString()); + Console.WriteLine(result.GetProperty("language").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("expectedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("category").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("offset").ToString()); + Console.WriteLine(result.GetProperty("entitiesResult").GetProperty("predictedEntities")[0].GetProperty("length").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("expectedIntent").ToString()); + Console.WriteLine(result.GetProperty("intentsResult").GetProperty("predictedIntent").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResults("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringUtteranceEvaluationResult_GetModelEvaluationResults_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (UtteranceEvaluationResult item in client.GetModelEvaluationResultsAsync("", "", StringIndexType.Utf16CodeUnit, maxCount: 1234, skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (AssignedDeploymentResource item in client.GetDeploymentResources("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (AssignedDeploymentResource item in client.GetDeploymentResourcesAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringAssignedDeploymentResource_GetDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (TrainingJobState item in client.GetTrainingJobs("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingJobs_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (TrainingJobState item in client.GetTrainingJobsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringTrainingJobState_GetTrainingJobs_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + foreach (ExportedTrainedModel item in client.GetExportedModels("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModels_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + await foreach (ExportedTrainedModel item in client.GetExportedModelsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoringExportedTrainedModel_GetExportedModels_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeleteProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteProject(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeleteProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_DeleteProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteProject(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeleteProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_CopyProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + 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_ConversationalAnalysisAuthoring_CopyProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + 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_ConversationalAnalysisAuthoring_CopyProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectConfig body = new CopyProjectConfig( + ProjectKind.Conversation, + "", + "", + 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_ConversationalAnalysisAuthoring_CopyProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectConfig body = new CopyProjectConfig( + ProjectKind.Conversation, + "", + "", + 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_ConversationalAnalysisAuthoring_CopyProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + 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_ConversationalAnalysisAuthoring_CopyProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectKind = "Conversation", + 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_ConversationalAnalysisAuthoring_CopyProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectConfig body = new CopyProjectConfig( + ProjectKind.Conversation, + "", + "", + 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_ConversationalAnalysisAuthoring_CopyProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CopyProjectConfig body = new CopyProjectConfig( + ProjectKind.Conversation, + "", + "", + 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_ConversationalAnalysisAuthoring_Export_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Export_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_Export_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Export_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_Export_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Export_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "Utf16CodeUnit", exportedProjectFormat: "Conversation", assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_Export_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.Export(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Export_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.ExportAsync(WaitUntil.Completed, "", StringIndexType.Utf16CodeUnit, exportedProjectFormat: ExportedProjectFormat.Conversation, assetKind: "", trainedModelLabel: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_Import_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + projectName = "", + language = "", + }, + }); + Operation operation = client.Import(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Import_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + projectName = "", + language = "", + }, + }); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_Import_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(ProjectKind.Conversation, "", "")); + Operation operation = client.Import(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Import_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(ProjectKind.Conversation, "", "")); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_Import_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + intents = new object[] + { +new +{ +category = "", +} + }, + entities = new object[] + { +new +{ +category = "", +compositionSetting = "returnLongestOverlap", +list = new +{ +sublists = new object[] +{ +new +{ +listKey = "", +synonyms = new object[] +{ +new +{ +language = "", +values = new object[] +{ +"" +}, +} +}, +} +}, +}, +prebuilts = new object[] +{ +new +{ +category = "", +} +}, +regex = new +{ +expressions = new object[] +{ +new +{ +regexKey = "", +language = "", +regexPattern = "", +} +}, +}, +requiredComponents = new object[] +{ +"" +}, +} + }, + utterances = new object[] + { +new +{ +entities = new object[] +{ +new +{ +category = "", +offset = 1234, +length = 1234, +} +}, +text = "", +language = "", +intent = "", +dataset = "", +} + }, + projectKind = "Conversation", + }, + }); + Operation operation = client.Import(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Import_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + projectFileVersion = "", + stringIndexType = "Utf16CodeUnit", + metadata = new + { + projectKind = "Conversation", + settings = new + { + confidenceThreshold = 123.45F, + }, + storageInputContainerName = "", + projectName = "", + multilingual = true, + description = "", + language = "", + }, + assets = new + { + intents = new object[] + { +new +{ +category = "", +} + }, + entities = new object[] + { +new +{ +category = "", +compositionSetting = "returnLongestOverlap", +list = new +{ +sublists = new object[] +{ +new +{ +listKey = "", +synonyms = new object[] +{ +new +{ +language = "", +values = new object[] +{ +"" +}, +} +}, +} +}, +}, +prebuilts = new object[] +{ +new +{ +category = "", +} +}, +regex = new +{ +expressions = new object[] +{ +new +{ +regexKey = "", +language = "", +regexPattern = "", +} +}, +}, +requiredComponents = new object[] +{ +"" +}, +} + }, + utterances = new object[] + { +new +{ +entities = new object[] +{ +new +{ +category = "", +offset = 1234, +length = 1234, +} +}, +text = "", +language = "", +intent = "", +dataset = "", +} + }, + projectKind = "Conversation", + }, + }); + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, exportedProjectFormat: "Conversation"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_Import_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(ProjectKind.Conversation, "", "") + { + Settings = new ProjectSettings(123.45F), + StorageInputContainerName = "", + Multilingual = true, + Description = "", + }) + { + Assets = new ConversationExportedProjectAssets + { + Intents = { new ConversationExportedIntent("") }, + Entities = {new ConversationExportedEntity("") +{ +CompositionSetting = CompositionSetting.ReturnLongestOverlap, +List = new ExportedEntityList +{ +Sublists = {new ExportedEntitySublist +{ +ListKey = "", +Synonyms = {new ExportedEntityListSynonym +{ +Language = "", +Values = {""}, +}}, +}}, +}, +Prebuilts = {new ExportedPrebuiltEntity("")}, +Regex = new ExportedEntityRegex +{ +Expressions = {new ExportedEntityRegexExpression +{ +RegexKey = "", +Language = "", +RegexPattern = "", +}}, +}, +RequiredComponents = {""}, +}}, + Utterances = {new ConversationExportedUtterance("", "") +{ +Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, +Language = "", +Dataset = "", +}}, + }, + }; + Operation operation = client.Import(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Import_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedProject body = new ExportedProject("", StringIndexType.Utf16CodeUnit, new CreateProjectConfig(ProjectKind.Conversation, "", "") + { + Settings = new ProjectSettings(123.45F), + StorageInputContainerName = "", + Multilingual = true, + Description = "", + }) + { + Assets = new ConversationExportedProjectAssets + { + Intents = { new ConversationExportedIntent("") }, + Entities = {new ConversationExportedEntity("") +{ +CompositionSetting = CompositionSetting.ReturnLongestOverlap, +List = new ExportedEntityList +{ +Sublists = {new ExportedEntitySublist +{ +ListKey = "", +Synonyms = {new ExportedEntityListSynonym +{ +Language = "", +Values = {""}, +}}, +}}, +}, +Prebuilts = {new ExportedPrebuiltEntity("")}, +Regex = new ExportedEntityRegex +{ +Expressions = {new ExportedEntityRegexExpression +{ +RegexKey = "", +Language = "", +RegexPattern = "", +}}, +}, +RequiredComponents = {""}, +}}, + Utterances = {new ConversationExportedUtterance("", "") +{ +Entities = {new ExportedUtteranceEntityLabel("", 1234, 1234)}, +Language = "", +Dataset = "", +}}, + }, + }; + Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body, exportedProjectFormat: ExportedProjectFormat.Conversation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_Train_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingMode = "advanced", + }); + 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_ConversationalAnalysisAuthoring_Train_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingMode = "advanced", + }); + 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_ConversationalAnalysisAuthoring_Train_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobConfig body = new TrainingJobConfig("", TrainingMode.Advanced); + Operation operation = client.Train(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Train_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobConfig body = new TrainingJobConfig("", TrainingMode.Advanced); + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_Train_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + trainingMode = "advanced", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + }); + 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("trainingMode").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_ConversationalAnalysisAuthoring_Train_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + modelLabel = "", + trainingConfigVersion = "", + trainingMode = "advanced", + evaluationOptions = new + { + kind = "percentage", + trainingSplitPercentage = 1234, + testingSplitPercentage = 1234, + }, + }); + 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("trainingMode").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_ConversationalAnalysisAuthoring_Train_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobConfig body = new TrainingJobConfig("", TrainingMode.Advanced) + { + TrainingConfigVersion = "", + EvaluationOptions = new EvaluationConfig + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + }; + Operation operation = client.Train(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_Train_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + TrainingJobConfig body = new TrainingJobConfig("", TrainingMode.Advanced) + { + TrainingConfigVersion = "", + EvaluationOptions = new EvaluationConfig + { + Kind = EvaluationKind.Percentage, + TrainingSplitPercentage = 1234, + TestingSplitPercentage = 1234, + }, + }; + Operation operation = await client.TrainAsync(WaitUntil.Completed, "", body); + TrainingJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_SwapDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_SwapDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_SwapDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_SwapDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_SwapDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_SwapDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_SwapDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); + Operation operation = client.SwapDeployments(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_SwapDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + SwapDeploymentsConfig body = new SwapDeploymentsConfig("", ""); + Operation operation = await client.SwapDeploymentsAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_DeployProject_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeployProject_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeployProject_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentConfig body = new CreateDeploymentConfig(""); + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeployProject_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentConfig body = new CreateDeploymentConfig(""); + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_DeployProject_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeployProject_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeployProject_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentConfig body = new CreateDeploymentConfig("") + { + AssignedResourceIds = { "" }, + }; + Operation operation = client.DeployProject(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeployProject_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + CreateDeploymentConfig body = new CreateDeploymentConfig("") + { + AssignedResourceIds = { "" }, + }; + Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_DeleteDeployment_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeleteDeployment_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_DeleteDeployment_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteDeployment(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeleteDeployment_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteDeploymentAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentConfig body = new DeleteDeploymentConfig(); + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeleteDeploymentFromResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentConfig body = new DeleteDeploymentConfig(); + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentConfig body = new DeleteDeploymentConfig + { + AssignedResourceIds = { "" }, + }; + Operation operation = client.DeleteDeploymentFromResources(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeleteDeploymentFromResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + DeleteDeploymentConfig body = new DeleteDeploymentConfig + { + AssignedResourceIds = { "" }, + }; + Operation operation = await client.DeleteDeploymentFromResourcesAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_EvaluateModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_EvaluateModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_EvaluateModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationConfig body = new EvaluationConfig(); + Operation operation = client.EvaluateModel(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_EvaluateModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationConfig body = new EvaluationConfig(); + Operation operation = await client.EvaluateModelAsync(WaitUntil.Completed, "", "", body); + EvaluationJobResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_EvaluateModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_EvaluateModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_EvaluateModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationConfig body = new EvaluationConfig + { + 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_ConversationalAnalysisAuthoring_EvaluateModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + EvaluationConfig body = new EvaluationConfig + { + 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_ConversationalAnalysisAuthoring_LoadSnapshot_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_LoadSnapshot_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_LoadSnapshot_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.LoadSnapshot(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_LoadSnapshot_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.LoadSnapshotAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_AssignDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_AssignDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_AssignDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_AssignDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_AssignDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = client.AssignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_AssignDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + AssignDeploymentResourcesConfig body = new AssignDeploymentResourcesConfig(new ResourceMetadata[] + { +new ResourceMetadata("", "", "") + }); + Operation operation = await client.AssignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_UnassignDeploymentResources_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_UnassignDeploymentResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_UnassignDeploymentResources_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); + Operation operation = client.UnassignDeploymentResources(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_UnassignDeploymentResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + UnassignDeploymentResourcesConfig body = new UnassignDeploymentResourcesConfig(new string[] { "" }); + Operation operation = await client.UnassignDeploymentResourcesAsync(WaitUntil.Completed, "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_CancelTrainingJob_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_CancelTrainingJob_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_CancelTrainingJob_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_CancelTrainingJob_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_CancelTrainingJob_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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_ConversationalAnalysisAuthoring_CancelTrainingJob_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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("trainingMode").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_ConversationalAnalysisAuthoring_CancelTrainingJob_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_CancelTrainingJob_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_DeleteExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeleteExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_DeleteExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = client.DeleteExportedModel(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_DeleteExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + Operation operation = await client.DeleteExportedModelAsync(WaitUntil.Completed, "", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelConfig body = new ExportedModelConfig(""); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_CreateOrUpdateExportedModel_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelConfig body = new ExportedModelConfig(""); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ConversationalAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(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_ConversationalAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelConfig body = new ExportedModelConfig(""); + Operation operation = client.CreateOrUpdateExportedModel(WaitUntil.Completed, "", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_ConversationalAnalysisAuthoring_CreateOrUpdateExportedModel_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationalAnalysisAuthoring client = new ConversationsClient(endpoint, credential).GetConversationalAnalysisAuthoringClient(apiVersion: "2024-11-15-preview"); + + ExportedModelConfig body = new ExportedModelConfig(""); + Operation operation = await client.CreateOrUpdateExportedModelAsync(WaitUntil.Completed, "", "", body); + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tsp-location.yaml b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tsp-location.yaml new file mode 100644 index 000000000000..496f29b580e1 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Authoring.Conversations/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/Language.AnalyzeConversations-authoring +commit: e95392a29798b02be1f02f45ea61fdf82533b39c +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: