From d38840ab40c8ba0e9000939ca4078c6c8b130937 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 7 Mar 2025 13:28:14 +0000 Subject: [PATCH] CodeGen from PR 33052 in Azure/azure-rest-api-specs Merge f52772b35208dd08d7cdfec6b5c0c02b5559a66e into 71e34b514eab79627aeb556edffa08de2b76efc3 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 16 + .../README.md | 78 + .../assets.json | 1 + .../pom.xml | 71 + .../AliasDictionaryAliasesAsyncClient.java | 386 +++ .../copilot/AliasDictionaryAliasesClient.java | 364 +++ .../copilot/CopilotServiceClientBuilder.java | 516 ++++ .../mds/copilot/CopilotServiceVersion.java | 40 + ...viceExampleQueryOperationsAsyncClient.java | 474 ++++ ...ryServiceExampleQueryOperationsClient.java | 440 ++++ .../FeedbackServiceFeedbackAsyncClient.java | 89 + .../FeedbackServiceFeedbackClient.java | 86 + .../mds/copilot/HealthServiceAsyncClient.java | 95 + .../mds/copilot/HealthServiceClient.java | 92 + .../InstructionsInstructionsAsyncClient.java | 500 ++++ .../InstructionsInstructionsClient.java | 482 ++++ ...ionStatusOperationProgressAsyncClient.java | 92 + ...perationStatusOperationProgressClient.java | 89 + .../QueryServiceQueryApiAsyncClient.java | 156 ++ .../copilot/QueryServiceQueryApiClient.java | 154 ++ ...eryServiceValidateQueryApiAsyncClient.java | 315 +++ ...ateQueryServiceValidateQueryApiClient.java | 281 +++ .../AliasDictionaryAliasesImpl.java | 1219 ++++++++++ .../CopilotServiceClientImpl.java | 249 ++ ...ueryServiceExampleQueryOperationsImpl.java | 892 +++++++ .../FeedbackServiceFeedbacksImpl.java | 156 ++ .../implementation/HealthServicesImpl.java | 164 ++ .../InstructionsInstructionsImpl.java | 2095 +++++++++++++++++ .../implementation/JsonMergePatchHelper.java | 46 + .../OperationLocationPollingStrategy.java | 140 ++ .../OperationStatusOperationProgressImpl.java | 158 ++ .../copilot/implementation/PollingUtils.java | 151 ++ .../QueryServiceQueryApisImpl.java | 210 ++ .../SyncOperationLocationPollingStrategy.java | 133 ++ ...dateQueryServiceValidateQueryApisImpl.java | 576 +++++ .../models/ActivateRequest.java | 83 + .../implementation/models/ExecuteRequest.java | 165 ++ .../models/ExecuteRequest1.java | 92 + .../models/LinkInstructionRequest.java | 95 + .../models/UpdateStatusRequest.java | 84 + .../implementation/models/package-info.java | 8 + .../copilot/implementation/package-info.java | 8 + .../mds/copilot/models/ActivateAlias.java | 83 + .../mds/copilot/models/Alias.java | 168 ++ .../mds/copilot/models/CopilotHealth.java | 152 ++ .../mds/copilot/models/CopilotSetupInfo.java | 186 ++ .../mds/copilot/models/CopilotTestCase.java | 154 ++ .../copilot/models/ExampleQueryRequest.java | 249 ++ .../mds/copilot/models/FeedbackCategory.java | 63 + .../mds/copilot/models/FeedbackRequest.java | 150 ++ .../mds/copilot/models/GetResponse.java | 252 ++ .../mds/copilot/models/Instruction.java | 297 +++ .../models/InstructionCategoryEnum.java | 69 + .../models/InstructionLanguageEnum.java | 51 + .../copilot/models/InstructionStatusEnum.java | 57 + .../models/InstructionSubDomainEnum.java | 87 + .../copilot/models/InstrustionDomainEnum.java | 63 + .../models/LinkInstructionRequest1.java | 83 + .../copilot/models/OperationResultQuery.java | 118 + .../copilot/models/OperationStatusValue.java | 99 + .../mds/copilot/models/QueryEndpoint.java | 57 + .../mds/copilot/models/QueryResponse.java | 99 + .../mds/copilot/models/Relationships.java | 106 + .../copilot/models/RetrievalProperties.java | 129 + .../mds/copilot/models/SampleQuery.java | 183 ++ .../mds/copilot/models/TestQuery.java | 125 + .../mds/copilot/models/TestResponse.java | 154 ++ .../copilot/models/ValidateTestSummary.java | 127 + .../mds/copilot/models/package-info.java | 8 + .../mds/copilot/package-info.java | 8 + .../src/main/java/module-info.java | 13 + ...turing-mds-copilot_apiview_properties.json | 145 ++ ...ustry-manufacturing-mds-copilot.properties | 2 + .../mds/copilot/ReadmeSamples.java | 12 + .../generated/AliasesActivateMaximumSet.java | 24 + .../generated/AliasesCreateMaximumSet.java | 28 + .../AliasesCreateOrReplaceMaximumSet.java | 28 + .../generated/AliasesDeleteMaximumSet.java | 23 + .../generated/AliasesGetMaximumSet.java | 24 + .../generated/AliasesListMaximumSet.java | 25 + ...ueryOperationsCreateExampleMaximumSet.java | 29 + ...ueryOperationsDeleteExampleMaximumSet.java | 23 + ...leQueryOperationsGetExampleMaximumSet.java | 24 + ...ryOperationsLinkInstructionMaximumSet.java | 26 + ...ryOperationsListAllExamplesMaximumSet.java | 26 + ...ueryOperationsUpdateExampleMaximumSet.java | 30 + .../generated/FeedbackSubmitMaximumSet.java | 26 + ...ealthServiceGetHealthStatusMaximumSet.java | 24 + .../InstructionsCreateMaximumSet.java | 34 + ...InstructionsCreateOrReplaceMaximumSet.java | 35 + .../InstructionsDeleteMaximumSet.java | 25 + .../generated/InstructionsGetMaximumSet.java | 24 + .../generated/InstructionsListMaximumSet.java | 25 + .../InstructionsUpdateStatusMaximumSet.java | 27 + ...nProgressGetOperationResultMaximumSet.java | 24 + .../generated/QueryApiExecuteMaximumSet.java | 25 + .../ValidateQueryApiExecuteMaximumSet.java | 30 + ...ryApiGetValidateTestDetailsMaximumSet.java | 24 + ...ApiListValidateTestRequestsMaximumSet.java | 28 + .../AliasesActivateMaximumSetTests.java | 25 + .../AliasesCreateMaximumSetTests.java | 30 + ...AliasesCreateOrReplaceMaximumSetTests.java | 30 + .../AliasesDeleteMaximumSetTests.java | 18 + .../generated/AliasesGetMaximumSetTests.java | 35 + .../generated/AliasesListMaximumSetTests.java | 38 + .../CopilotServiceClientTestBase.java | 174 ++ ...perationsCreateExampleMaximumSetTests.java | 24 + ...perationsDeleteExampleMaximumSetTests.java | 18 + ...ryOperationsGetExampleMaximumSetTests.java | 37 + ...rationsLinkInstructionMaximumSetTests.java | 29 + ...rationsListAllExamplesMaximumSetTests.java | 41 + ...perationsUpdateExampleMaximumSetTests.java | 42 + .../FeedbackSubmitMaximumSetTests.java | 21 + ...ServiceGetHealthStatusMaximumSetTests.java | 46 + .../InstructionsCreateMaximumSetTests.java | 36 + ...uctionsCreateOrReplaceMaximumSetTests.java | 36 + .../InstructionsDeleteMaximumSetTests.java | 27 + .../InstructionsGetMaximumSetTests.java | 61 + .../InstructionsListMaximumSetTests.java | 64 + ...structionsUpdateStatusMaximumSetTests.java | 29 + ...ressGetOperationResultMaximumSetTests.java | 32 + .../QueryApiExecuteMaximumSetTests.java | 28 + ...alidateQueryApiExecuteMaximumSetTests.java | 37 + ...GetValidateTestDetailsMaximumSetTests.java | 29 + ...stValidateTestRequestsMaximumSetTests.java | 35 + .../tsp-location.yaml | 4 + sdk/manufacturingdatasolution/ci.yml | 46 + sdk/manufacturingdatasolution/pom.xml | 15 + 130 files changed, 16840 insertions(+) create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/CHANGELOG.md create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/README.md create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/assets.json create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/pom.xml create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/AliasDictionaryAliasesAsyncClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/AliasDictionaryAliasesClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/CopilotServiceClientBuilder.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/CopilotServiceVersion.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ExampleQueryServiceExampleQueryOperationsAsyncClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ExampleQueryServiceExampleQueryOperationsClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/FeedbackServiceFeedbackAsyncClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/FeedbackServiceFeedbackClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/HealthServiceAsyncClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/HealthServiceClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/InstructionsInstructionsAsyncClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/InstructionsInstructionsClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/OperationStatusOperationProgressAsyncClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/OperationStatusOperationProgressClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/QueryServiceQueryApiAsyncClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/QueryServiceQueryApiClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ValidateQueryServiceValidateQueryApiAsyncClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ValidateQueryServiceValidateQueryApiClient.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/AliasDictionaryAliasesImpl.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/CopilotServiceClientImpl.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/ExampleQueryServiceExampleQueryOperationsImpl.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/FeedbackServiceFeedbacksImpl.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/HealthServicesImpl.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/InstructionsInstructionsImpl.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/JsonMergePatchHelper.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/OperationLocationPollingStrategy.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/OperationStatusOperationProgressImpl.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/PollingUtils.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/QueryServiceQueryApisImpl.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/SyncOperationLocationPollingStrategy.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/ValidateQueryServiceValidateQueryApisImpl.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ActivateRequest.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ExecuteRequest.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ExecuteRequest1.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/LinkInstructionRequest.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/UpdateStatusRequest.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/package-info.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/package-info.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ActivateAlias.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Alias.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotHealth.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotSetupInfo.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotTestCase.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ExampleQueryRequest.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/FeedbackCategory.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/FeedbackRequest.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/GetResponse.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Instruction.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionCategoryEnum.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionLanguageEnum.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionStatusEnum.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionSubDomainEnum.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstrustionDomainEnum.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/LinkInstructionRequest1.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/OperationResultQuery.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/OperationStatusValue.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/QueryEndpoint.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/QueryResponse.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Relationships.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/RetrievalProperties.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/SampleQuery.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/TestQuery.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/TestResponse.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ValidateTestSummary.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/package-info.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/package-info.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/module-info.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/resources/META-INF/azure-microsoft-industry-manufacturing-mds-copilot_apiview_properties.json create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/resources/azure-microsoft-industry-manufacturing-mds-copilot.properties create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ReadmeSamples.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesActivateMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateOrReplaceMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesDeleteMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesGetMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesListMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsCreateExampleMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsDeleteExampleMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsGetExampleMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsLinkInstructionMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsListAllExamplesMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsUpdateExampleMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/FeedbackSubmitMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/HealthServiceGetHealthStatusMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateOrReplaceMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsDeleteMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsGetMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsListMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsUpdateStatusMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/OperationProgressGetOperationResultMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/QueryApiExecuteMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiExecuteMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiGetValidateTestDetailsMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiListValidateTestRequestsMaximumSet.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesActivateMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateOrReplaceMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesDeleteMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesGetMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesListMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/CopilotServiceClientTestBase.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsCreateExampleMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsDeleteExampleMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsGetExampleMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsLinkInstructionMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsListAllExamplesMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsUpdateExampleMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/FeedbackSubmitMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/HealthServiceGetHealthStatusMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateOrReplaceMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsDeleteMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsGetMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsListMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsUpdateStatusMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/OperationProgressGetOperationResultMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/QueryApiExecuteMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiExecuteMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiGetValidateTestDetailsMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiListValidateTestRequestsMaximumSetTests.java create mode 100644 sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/tsp-location.yaml create mode 100644 sdk/manufacturingdatasolution/ci.yml create mode 100644 sdk/manufacturingdatasolution/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index c8c0eda8cecc..0620ef2b1fdb 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -262,6 +262,7 @@ com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;5.20.1;5.21.0- com.azure.spring:spring-cloud-azure-stream-binder-servicebus;5.20.1;5.21.0-beta.1 com.azure.spring:spring-cloud-azure-testcontainers;5.20.1;5.21.0-beta.1 com.azure:azure-spring-data-cosmos;5.20.1;5.21.0-beta.1 +com.azure:azure-microsoft-industry-manufacturing-mds-copilot;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager;2.48.0;2.49.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appplatform;2.48.0;2.49.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appservice;2.48.0;2.49.0-beta.1 diff --git a/pom.xml b/pom.xml index 933f70cda255..ee4acac0108c 100644 --- a/pom.xml +++ b/pom.xml @@ -135,6 +135,7 @@ sdk/managedapplications sdk/managednetworkfabric sdk/managementgroups + sdk/manufacturingdatasolution sdk/maps sdk/mariadb sdk/marketplaceordering diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/CHANGELOG.md b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/CHANGELOG.md new file mode 100644 index 000000000000..87fb5276bcf1 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/CHANGELOG.md @@ -0,0 +1,16 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure CopilotService client library for Java. This package contains Microsoft Azure CopilotService client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes +### Features Added + +- Initial release for the azure-microsoft-industry-manufacturing-mds-copilot Java SDK. diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/README.md b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/README.md new file mode 100644 index 000000000000..698bbe633c9d --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/README.md @@ -0,0 +1,78 @@ +# Azure CopilotService client library for Java + +Azure CopilotService client library for Java. + +This package contains Microsoft Azure CopilotService client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-microsoft-industry-manufacturing-mds-copilot;current}) +```xml + + com.azure + azure-microsoft-industry-manufacturing-mds-copilot + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts + +## Examples + +```java com.azure.microsoft.industry.manufacturing.mds.copilot.readme +``` + +### Service API versions + +The client library targets the latest service API version by default. +The service client builder accepts an optional service API version parameter to specify which API version to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder. +This ensures that the client can communicate with services using the specified API version. + +When selecting an API version, it is 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. + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/assets.json b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/assets.json new file mode 100644 index 000000000000..337f199bed5a --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/assets.json @@ -0,0 +1 @@ +{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot","Tag":""} \ No newline at end of file diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/pom.xml b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/pom.xml new file mode 100644 index 000000000000..eff0fddb2cc2 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/pom.xml @@ -0,0 +1,71 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-microsoft-industry-manufacturing-mds-copilot + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for CopilotService + This package contains Microsoft Azure CopilotService client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + com.azure + azure-core + 1.55.2 + + + com.azure + azure-core-http-netty + 1.15.10 + + + com.azure + azure-core-test + 1.27.0-beta.7 + test + + + com.azure + azure-identity + 1.15.3 + test + + + diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/AliasDictionaryAliasesAsyncClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/AliasDictionaryAliasesAsyncClient.java new file mode 100644 index 000000000000..daff7bd24768 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/AliasDictionaryAliasesAsyncClient.java @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.AliasDictionaryAliasesImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.ActivateRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ActivateAlias; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class, isAsync = true) +public final class AliasDictionaryAliasesAsyncClient { + @Generated + private final AliasDictionaryAliasesImpl serviceClient; + + /** + * Initializes an instance of AliasDictionaryAliasesAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AliasDictionaryAliasesAsyncClient(AliasDictionaryAliasesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get an alias by Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an alias by Id along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(id, requestOptions); + } + + /** + * Create an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreate(BinaryData resource, RequestOptions requestOptions) { + return this.serviceClient.beginCreateAsync(resource, requestOptions); + } + + /** + * Update an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of this is the request model for Alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrReplace(String id, BinaryData resource, + RequestOptions requestOptions) { + return this.serviceClient.beginCreateOrReplaceAsync(id, resource, requestOptions); + } + + /** + * Delete an alias. + * + * @param id Id for the alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponseAsync(id, requestOptions); + } + + /** + * List all aliases. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Alias items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux list(RequestOptions requestOptions) { + return this.serviceClient.listAsync(requestOptions); + } + + /** + * Deactivate an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param activateRequest The activateRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return this is the patch request to update the status of Alias along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> activateWithResponse(String id, BinaryData activateRequest, + RequestOptions requestOptions) { + return this.serviceClient.activateWithResponseAsync(id, activateRequest, requestOptions); + } + + /** + * Get an alias by Id. + * + * @param id Id for the alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alias by Id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get(String id) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(id, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Alias.class)); + } + + /** + * Create an alias. + * + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreate(Alias resource) { + // Generated convenience method for beginCreateWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateWithModelAsync(BinaryData.fromObject(resource), requestOptions); + } + + /** + * Update an alias. + * + * @param id Id for the alias. + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of this is the request model for Alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrReplace(String id, Alias resource) { + // Generated convenience method for beginCreateOrReplaceWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateOrReplaceWithModelAsync(id, BinaryData.fromObject(resource), requestOptions); + } + + /** + * Delete an alias. + * + * @param id Id for the alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono delete(String id) { + // Generated convenience method for deleteWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteWithResponse(id, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * List all aliases. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Alias items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux list() { + // Generated convenience method for list + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = list(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Alias.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Deactivate an alias. + * + * @param id Id for the alias. + * @param enabled status of the alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this is the patch request to update the status of Alias on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono activate(String id, boolean enabled) { + // Generated convenience method for activateWithResponse + RequestOptions requestOptions = new RequestOptions(); + ActivateRequest activateRequestObj = new ActivateRequest(enabled); + BinaryData activateRequest = BinaryData.fromObject(activateRequestObj); + return activateWithResponse(id, activateRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ActivateAlias.class)); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/AliasDictionaryAliasesClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/AliasDictionaryAliasesClient.java new file mode 100644 index 000000000000..bb614a504023 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/AliasDictionaryAliasesClient.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.AliasDictionaryAliasesImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.ActivateRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ActivateAlias; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; + +/** + * Initializes a new instance of the synchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class) +public final class AliasDictionaryAliasesClient { + @Generated + private final AliasDictionaryAliasesImpl serviceClient; + + /** + * Initializes an instance of AliasDictionaryAliasesClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AliasDictionaryAliasesClient(AliasDictionaryAliasesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get an alias by Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an alias by Id along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(id, requestOptions); + } + + /** + * Create an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreate(BinaryData resource, RequestOptions requestOptions) { + return this.serviceClient.beginCreate(resource, requestOptions); + } + + /** + * Update an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of this is the request model for Alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrReplace(String id, BinaryData resource, + RequestOptions requestOptions) { + return this.serviceClient.beginCreateOrReplace(id, resource, requestOptions); + } + + /** + * Delete an alias. + * + * @param id Id for the alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.deleteWithResponse(id, requestOptions); + } + + /** + * List all aliases. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Alias items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(RequestOptions requestOptions) { + return this.serviceClient.list(requestOptions); + } + + /** + * Deactivate an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param activateRequest The activateRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return this is the patch request to update the status of Alias along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response activateWithResponse(String id, BinaryData activateRequest, + RequestOptions requestOptions) { + return this.serviceClient.activateWithResponse(id, activateRequest, requestOptions); + } + + /** + * Get an alias by Id. + * + * @param id Id for the alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alias by Id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Alias get(String id) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(id, requestOptions).getValue().toObject(Alias.class); + } + + /** + * Create an alias. + * + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreate(Alias resource) { + // Generated convenience method for beginCreateWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateWithModel(BinaryData.fromObject(resource), requestOptions); + } + + /** + * Update an alias. + * + * @param id Id for the alias. + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of this is the request model for Alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrReplace(String id, Alias resource) { + // Generated convenience method for beginCreateOrReplaceWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateOrReplaceWithModel(id, BinaryData.fromObject(resource), requestOptions); + } + + /** + * Delete an alias. + * + * @param id Id for the alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String id) { + // Generated convenience method for deleteWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteWithResponse(id, requestOptions).getValue(); + } + + /** + * List all aliases. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Alias items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + // Generated convenience method for list + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.list(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Alias.class)); + } + + /** + * Deactivate an alias. + * + * @param id Id for the alias. + * @param enabled status of the alias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return this is the patch request to update the status of Alias. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ActivateAlias activate(String id, boolean enabled) { + // Generated convenience method for activateWithResponse + RequestOptions requestOptions = new RequestOptions(); + ActivateRequest activateRequestObj = new ActivateRequest(enabled); + BinaryData activateRequest = BinaryData.fromObject(activateRequestObj); + return activateWithResponse(id, activateRequest, requestOptions).getValue().toObject(ActivateAlias.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/CopilotServiceClientBuilder.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/CopilotServiceClientBuilder.java new file mode 100644 index 000000000000..c0d927dae4a9 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/CopilotServiceClientBuilder.java @@ -0,0 +1,516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.CopilotServiceClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the CopilotServiceClient type. + */ +@ServiceClientBuilder( + serviceClients = { + QueryServiceQueryApiClient.class, + OperationStatusOperationProgressClient.class, + InstructionsInstructionsClient.class, + ExampleQueryServiceExampleQueryOperationsClient.class, + AliasDictionaryAliasesClient.class, + HealthServiceClient.class, + ValidateQueryServiceValidateQueryApiClient.class, + FeedbackServiceFeedbackClient.class, + QueryServiceQueryApiAsyncClient.class, + OperationStatusOperationProgressAsyncClient.class, + InstructionsInstructionsAsyncClient.class, + ExampleQueryServiceExampleQueryOperationsAsyncClient.class, + AliasDictionaryAliasesAsyncClient.class, + HealthServiceAsyncClient.class, + ValidateQueryServiceValidateQueryApiAsyncClient.class, + FeedbackServiceFeedbackAsyncClient.class }) +public final class CopilotServiceClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://azure-mds-service/.default" }; + + @Generated + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-microsoft-industry-manufacturing-mds-copilot.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the CopilotServiceClientBuilder. + */ + @Generated + public CopilotServiceClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CopilotServiceClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CopilotServiceClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CopilotServiceClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CopilotServiceClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CopilotServiceClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CopilotServiceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CopilotServiceClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public CopilotServiceClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * + */ + @Generated + private String mdsUniqueId; + + /** + * Sets. + * + * @param mdsUniqueId the mdsUniqueId value. + * @return the CopilotServiceClientBuilder. + */ + @Generated + public CopilotServiceClientBuilder mdsUniqueId(String mdsUniqueId) { + this.mdsUniqueId = mdsUniqueId; + return this; + } + + /* + * + */ + @Generated + private String location; + + /** + * Sets. + * + * @param location the location value. + * @return the CopilotServiceClientBuilder. + */ + @Generated + public CopilotServiceClientBuilder location(String location) { + this.location = location; + return this; + } + + /* + * Service version + */ + @Generated + private CopilotServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the CopilotServiceClientBuilder. + */ + @Generated + public CopilotServiceClientBuilder serviceVersion(CopilotServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the CopilotServiceClientBuilder. + */ + @Generated + public CopilotServiceClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of CopilotServiceClientImpl with the provided parameters. + * + * @return an instance of CopilotServiceClientImpl. + */ + @Generated + private CopilotServiceClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localLocation = (location != null) ? location : "mds.azure.com"; + CopilotServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : CopilotServiceVersion.getLatest(); + CopilotServiceClientImpl client = new CopilotServiceClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.mdsUniqueId, localLocation, localServiceVersion); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(mdsUniqueId, "'mdsUniqueId' cannot be null."); + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of QueryServiceQueryApiAsyncClient class. + * + * @return an instance of QueryServiceQueryApiAsyncClient. + */ + @Generated + public QueryServiceQueryApiAsyncClient buildQueryServiceQueryApiAsyncClient() { + return new QueryServiceQueryApiAsyncClient(buildInnerClient().getQueryServiceQueryApis()); + } + + /** + * Builds an instance of OperationStatusOperationProgressAsyncClient class. + * + * @return an instance of OperationStatusOperationProgressAsyncClient. + */ + @Generated + public OperationStatusOperationProgressAsyncClient buildOperationStatusOperationProgressAsyncClient() { + return new OperationStatusOperationProgressAsyncClient( + buildInnerClient().getOperationStatusOperationProgress()); + } + + /** + * Builds an instance of InstructionsInstructionsAsyncClient class. + * + * @return an instance of InstructionsInstructionsAsyncClient. + */ + @Generated + public InstructionsInstructionsAsyncClient buildInstructionsInstructionsAsyncClient() { + return new InstructionsInstructionsAsyncClient(buildInnerClient().getInstructionsInstructions()); + } + + /** + * Builds an instance of ExampleQueryServiceExampleQueryOperationsAsyncClient class. + * + * @return an instance of ExampleQueryServiceExampleQueryOperationsAsyncClient. + */ + @Generated + public ExampleQueryServiceExampleQueryOperationsAsyncClient + buildExampleQueryServiceExampleQueryOperationsAsyncClient() { + return new ExampleQueryServiceExampleQueryOperationsAsyncClient( + buildInnerClient().getExampleQueryServiceExampleQueryOperations()); + } + + /** + * Builds an instance of AliasDictionaryAliasesAsyncClient class. + * + * @return an instance of AliasDictionaryAliasesAsyncClient. + */ + @Generated + public AliasDictionaryAliasesAsyncClient buildAliasDictionaryAliasesAsyncClient() { + return new AliasDictionaryAliasesAsyncClient(buildInnerClient().getAliasDictionaryAliases()); + } + + /** + * Builds an instance of HealthServiceAsyncClient class. + * + * @return an instance of HealthServiceAsyncClient. + */ + @Generated + public HealthServiceAsyncClient buildHealthServiceAsyncClient() { + return new HealthServiceAsyncClient(buildInnerClient().getHealthServices()); + } + + /** + * Builds an instance of ValidateQueryServiceValidateQueryApiAsyncClient class. + * + * @return an instance of ValidateQueryServiceValidateQueryApiAsyncClient. + */ + @Generated + public ValidateQueryServiceValidateQueryApiAsyncClient buildValidateQueryServiceValidateQueryApiAsyncClient() { + return new ValidateQueryServiceValidateQueryApiAsyncClient( + buildInnerClient().getValidateQueryServiceValidateQueryApis()); + } + + /** + * Builds an instance of FeedbackServiceFeedbackAsyncClient class. + * + * @return an instance of FeedbackServiceFeedbackAsyncClient. + */ + @Generated + public FeedbackServiceFeedbackAsyncClient buildFeedbackServiceFeedbackAsyncClient() { + return new FeedbackServiceFeedbackAsyncClient(buildInnerClient().getFeedbackServiceFeedbacks()); + } + + /** + * Builds an instance of QueryServiceQueryApiClient class. + * + * @return an instance of QueryServiceQueryApiClient. + */ + @Generated + public QueryServiceQueryApiClient buildQueryServiceQueryApiClient() { + return new QueryServiceQueryApiClient(buildInnerClient().getQueryServiceQueryApis()); + } + + /** + * Builds an instance of OperationStatusOperationProgressClient class. + * + * @return an instance of OperationStatusOperationProgressClient. + */ + @Generated + public OperationStatusOperationProgressClient buildOperationStatusOperationProgressClient() { + return new OperationStatusOperationProgressClient(buildInnerClient().getOperationStatusOperationProgress()); + } + + /** + * Builds an instance of InstructionsInstructionsClient class. + * + * @return an instance of InstructionsInstructionsClient. + */ + @Generated + public InstructionsInstructionsClient buildInstructionsInstructionsClient() { + return new InstructionsInstructionsClient(buildInnerClient().getInstructionsInstructions()); + } + + /** + * Builds an instance of ExampleQueryServiceExampleQueryOperationsClient class. + * + * @return an instance of ExampleQueryServiceExampleQueryOperationsClient. + */ + @Generated + public ExampleQueryServiceExampleQueryOperationsClient buildExampleQueryServiceExampleQueryOperationsClient() { + return new ExampleQueryServiceExampleQueryOperationsClient( + buildInnerClient().getExampleQueryServiceExampleQueryOperations()); + } + + /** + * Builds an instance of AliasDictionaryAliasesClient class. + * + * @return an instance of AliasDictionaryAliasesClient. + */ + @Generated + public AliasDictionaryAliasesClient buildAliasDictionaryAliasesClient() { + return new AliasDictionaryAliasesClient(buildInnerClient().getAliasDictionaryAliases()); + } + + /** + * Builds an instance of HealthServiceClient class. + * + * @return an instance of HealthServiceClient. + */ + @Generated + public HealthServiceClient buildHealthServiceClient() { + return new HealthServiceClient(buildInnerClient().getHealthServices()); + } + + /** + * Builds an instance of ValidateQueryServiceValidateQueryApiClient class. + * + * @return an instance of ValidateQueryServiceValidateQueryApiClient. + */ + @Generated + public ValidateQueryServiceValidateQueryApiClient buildValidateQueryServiceValidateQueryApiClient() { + return new ValidateQueryServiceValidateQueryApiClient( + buildInnerClient().getValidateQueryServiceValidateQueryApis()); + } + + /** + * Builds an instance of FeedbackServiceFeedbackClient class. + * + * @return an instance of FeedbackServiceFeedbackClient. + */ + @Generated + public FeedbackServiceFeedbackClient buildFeedbackServiceFeedbackClient() { + return new FeedbackServiceFeedbackClient(buildInnerClient().getFeedbackServiceFeedbacks()); + } + + private static final ClientLogger LOGGER = new ClientLogger(CopilotServiceClientBuilder.class); +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/CopilotServiceVersion.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/CopilotServiceVersion.java new file mode 100644 index 000000000000..9669cc0657fe --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/CopilotServiceVersion.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of CopilotServiceClient. + */ +public enum CopilotServiceVersion implements ServiceVersion { + /** + * Enum value 2025-03-01. + */ + V2025_03_01("2025-03-01"); + + private final String version; + + CopilotServiceVersion(String version) { + this.version = version; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link CopilotServiceVersion}. + */ + public static CopilotServiceVersion getLatest() { + return V2025_03_01; + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ExampleQueryServiceExampleQueryOperationsAsyncClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ExampleQueryServiceExampleQueryOperationsAsyncClient.java new file mode 100644 index 000000000000..cb2c7d2767e0 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ExampleQueryServiceExampleQueryOperationsAsyncClient.java @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.ExampleQueryServiceExampleQueryOperationsImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.JsonMergePatchHelper; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.LinkInstructionRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.LinkInstructionRequest1; +import java.util.List; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class, isAsync = true) +public final class ExampleQueryServiceExampleQueryOperationsAsyncClient { + @Generated + private final ExampleQueryServiceExampleQueryOperationsImpl serviceClient; + + /** + * Initializes an instance of ExampleQueryServiceExampleQueryOperationsAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ExampleQueryServiceExampleQueryOperationsAsyncClient(ExampleQueryServiceExampleQueryOperationsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * get the example query. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the example query along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExampleWithResponse(String exampleId, RequestOptions requestOptions) { + return this.serviceClient.getExampleWithResponseAsync(exampleId, requestOptions); + } + + /** + * get all example queries. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
instructionIdStringNoInstruction id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all example queries as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAllExamples(RequestOptions requestOptions) { + return this.serviceClient.listAllExamplesAsync(requestOptions); + } + + /** + * update the example query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the example query resource along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateExampleWithResponse(String exampleId, BinaryData resource, + RequestOptions requestOptions) { + return this.serviceClient.updateExampleWithResponseAsync(exampleId, resource, requestOptions); + } + + /** + * delete the example query. + * + * @param exampleId The ID of the example query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteExampleWithResponse(String exampleId, RequestOptions requestOptions) { + return this.serviceClient.deleteExampleWithResponseAsync(exampleId, requestOptions); + } + + /** + * create the example query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createExampleWithResponse(BinaryData resource, RequestOptions requestOptions) { + return this.serviceClient.createExampleWithResponseAsync(resource, requestOptions); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     linkedInstructions (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     linkedInstructions (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param linkInstructionRequest The linkInstructionRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the patch request for the example query along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> linkInstructionWithResponse(String exampleId, BinaryData linkInstructionRequest, + RequestOptions requestOptions) { + return this.serviceClient.linkInstructionWithResponseAsync(exampleId, linkInstructionRequest, requestOptions); + } + + /** + * get the example query. + * + * @param exampleId The ID of the example query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the example query on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getExample(String exampleId) { + // Generated convenience method for getExampleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExampleWithResponse(exampleId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ExampleQueryRequest.class)); + } + + /** + * get all example queries. + * + * @param instructionId Instruction id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all example queries as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAllExamples(String instructionId) { + // Generated convenience method for listAllExamples + RequestOptions requestOptions = new RequestOptions(); + if (instructionId != null) { + requestOptions.addQueryParam("instructionId", instructionId, false); + } + PagedFlux pagedFluxResponse = listAllExamples(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(ExampleQueryRequest.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * get all example queries. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all example queries as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAllExamples() { + // Generated convenience method for listAllExamples + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listAllExamples(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(ExampleQueryRequest.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * update the example query. + * + * @param exampleId The ID of the example query. + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the example query resource on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateExample(String exampleId, ExampleQueryRequest resource) { + // Generated convenience method for updateExampleWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getExampleQueryRequestAccessor().prepareModelForJsonMergePatch(resource, true); + BinaryData resourceInBinaryData = BinaryData.fromObject(resource); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + resourceInBinaryData.getLength(); + JsonMergePatchHelper.getExampleQueryRequestAccessor().prepareModelForJsonMergePatch(resource, false); + return updateExampleWithResponse(exampleId, resourceInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ExampleQueryRequest.class)); + } + + /** + * delete the example query. + * + * @param exampleId The ID of the example query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteExample(String exampleId) { + // Generated convenience method for deleteExampleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteExampleWithResponse(exampleId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * create the example query. + * + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createExample(ExampleQueryRequest resource) { + // Generated convenience method for createExampleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createExampleWithResponse(BinaryData.fromObject(resource), requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Update instruction status. + * + * @param exampleId The ID of the example query. + * @param linkedInstructions The linked instructions for the example query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the patch request for the example query on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono linkInstruction(String exampleId, List linkedInstructions) { + // Generated convenience method for linkInstructionWithResponse + RequestOptions requestOptions = new RequestOptions(); + LinkInstructionRequest linkInstructionRequestObj + = new LinkInstructionRequest().setLinkedInstructions(linkedInstructions); + BinaryData linkInstructionRequest = BinaryData.fromObject(linkInstructionRequestObj); + return linkInstructionWithResponse(exampleId, linkInstructionRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LinkInstructionRequest1.class)); + } + + /** + * Update instruction status. + * + * @param exampleId The ID of the example query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the patch request for the example query on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono linkInstruction(String exampleId) { + // Generated convenience method for linkInstructionWithResponse + RequestOptions requestOptions = new RequestOptions(); + LinkInstructionRequest linkInstructionRequestObj = new LinkInstructionRequest(); + BinaryData linkInstructionRequest = BinaryData.fromObject(linkInstructionRequestObj); + return linkInstructionWithResponse(exampleId, linkInstructionRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LinkInstructionRequest1.class)); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ExampleQueryServiceExampleQueryOperationsClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ExampleQueryServiceExampleQueryOperationsClient.java new file mode 100644 index 000000000000..b2534986406f --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ExampleQueryServiceExampleQueryOperationsClient.java @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.ExampleQueryServiceExampleQueryOperationsImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.JsonMergePatchHelper; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.LinkInstructionRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.LinkInstructionRequest1; +import java.util.List; + +/** + * Initializes a new instance of the synchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class) +public final class ExampleQueryServiceExampleQueryOperationsClient { + @Generated + private final ExampleQueryServiceExampleQueryOperationsImpl serviceClient; + + /** + * Initializes an instance of ExampleQueryServiceExampleQueryOperationsClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ExampleQueryServiceExampleQueryOperationsClient(ExampleQueryServiceExampleQueryOperationsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * get the example query. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the example query along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExampleWithResponse(String exampleId, RequestOptions requestOptions) { + return this.serviceClient.getExampleWithResponse(exampleId, requestOptions); + } + + /** + * get all example queries. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
instructionIdStringNoInstruction id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all example queries as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAllExamples(RequestOptions requestOptions) { + return this.serviceClient.listAllExamples(requestOptions); + } + + /** + * update the example query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the example query resource along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateExampleWithResponse(String exampleId, BinaryData resource, + RequestOptions requestOptions) { + return this.serviceClient.updateExampleWithResponse(exampleId, resource, requestOptions); + } + + /** + * delete the example query. + * + * @param exampleId The ID of the example query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteExampleWithResponse(String exampleId, RequestOptions requestOptions) { + return this.serviceClient.deleteExampleWithResponse(exampleId, requestOptions); + } + + /** + * create the example query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createExampleWithResponse(BinaryData resource, RequestOptions requestOptions) { + return this.serviceClient.createExampleWithResponse(resource, requestOptions); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     linkedInstructions (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     linkedInstructions (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param linkInstructionRequest The linkInstructionRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the patch request for the example query along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response linkInstructionWithResponse(String exampleId, BinaryData linkInstructionRequest, + RequestOptions requestOptions) { + return this.serviceClient.linkInstructionWithResponse(exampleId, linkInstructionRequest, requestOptions); + } + + /** + * get the example query. + * + * @param exampleId The ID of the example query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the example query. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ExampleQueryRequest getExample(String exampleId) { + // Generated convenience method for getExampleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getExampleWithResponse(exampleId, requestOptions).getValue().toObject(ExampleQueryRequest.class); + } + + /** + * get all example queries. + * + * @param instructionId Instruction id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all example queries as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAllExamples(String instructionId) { + // Generated convenience method for listAllExamples + RequestOptions requestOptions = new RequestOptions(); + if (instructionId != null) { + requestOptions.addQueryParam("instructionId", instructionId, false); + } + return serviceClient.listAllExamples(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(ExampleQueryRequest.class)); + } + + /** + * get all example queries. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all example queries as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAllExamples() { + // Generated convenience method for listAllExamples + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listAllExamples(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(ExampleQueryRequest.class)); + } + + /** + * update the example query. + * + * @param exampleId The ID of the example query. + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the example query resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ExampleQueryRequest updateExample(String exampleId, ExampleQueryRequest resource) { + // Generated convenience method for updateExampleWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getExampleQueryRequestAccessor().prepareModelForJsonMergePatch(resource, true); + BinaryData resourceInBinaryData = BinaryData.fromObject(resource); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + resourceInBinaryData.getLength(); + JsonMergePatchHelper.getExampleQueryRequestAccessor().prepareModelForJsonMergePatch(resource, false); + return updateExampleWithResponse(exampleId, resourceInBinaryData, requestOptions).getValue() + .toObject(ExampleQueryRequest.class); + } + + /** + * delete the example query. + * + * @param exampleId The ID of the example query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteExample(String exampleId) { + // Generated convenience method for deleteExampleWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteExampleWithResponse(exampleId, requestOptions).getValue(); + } + + /** + * create the example query. + * + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createExample(ExampleQueryRequest resource) { + // Generated convenience method for createExampleWithResponse + RequestOptions requestOptions = new RequestOptions(); + createExampleWithResponse(BinaryData.fromObject(resource), requestOptions).getValue(); + } + + /** + * Update instruction status. + * + * @param exampleId The ID of the example query. + * @param linkedInstructions The linked instructions for the example query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the patch request for the example query. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkInstructionRequest1 linkInstruction(String exampleId, List linkedInstructions) { + // Generated convenience method for linkInstructionWithResponse + RequestOptions requestOptions = new RequestOptions(); + LinkInstructionRequest linkInstructionRequestObj + = new LinkInstructionRequest().setLinkedInstructions(linkedInstructions); + BinaryData linkInstructionRequest = BinaryData.fromObject(linkInstructionRequestObj); + return linkInstructionWithResponse(exampleId, linkInstructionRequest, requestOptions).getValue() + .toObject(LinkInstructionRequest1.class); + } + + /** + * Update instruction status. + * + * @param exampleId The ID of the example query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the patch request for the example query. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkInstructionRequest1 linkInstruction(String exampleId) { + // Generated convenience method for linkInstructionWithResponse + RequestOptions requestOptions = new RequestOptions(); + LinkInstructionRequest linkInstructionRequestObj = new LinkInstructionRequest(); + BinaryData linkInstructionRequest = BinaryData.fromObject(linkInstructionRequestObj); + return linkInstructionWithResponse(exampleId, linkInstructionRequest, requestOptions).getValue() + .toObject(LinkInstructionRequest1.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/FeedbackServiceFeedbackAsyncClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/FeedbackServiceFeedbackAsyncClient.java new file mode 100644 index 000000000000..1a4568904401 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/FeedbackServiceFeedbackAsyncClient.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.FeedbackServiceFeedbacksImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.FeedbackRequest; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class, isAsync = true) +public final class FeedbackServiceFeedbackAsyncClient { + @Generated + private final FeedbackServiceFeedbacksImpl serviceClient; + + /** + * Initializes an instance of FeedbackServiceFeedbackAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FeedbackServiceFeedbackAsyncClient(FeedbackServiceFeedbacksImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Send feedback for a query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     operationId: String (Required)
+     *     conversationId: String (Required)
+     *     feedback: String(Neutral/ThumbUp/ThumbDown) (Required)
+     *     queryEndpoint: String(V3/Assistant) (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> submitWithResponse(BinaryData resource, RequestOptions requestOptions) { + return this.serviceClient.submitWithResponseAsync(resource, requestOptions); + } + + /** + * Send feedback for a query. + * + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono submit(FeedbackRequest resource) { + // Generated convenience method for submitWithResponse + RequestOptions requestOptions = new RequestOptions(); + return submitWithResponse(BinaryData.fromObject(resource), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/FeedbackServiceFeedbackClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/FeedbackServiceFeedbackClient.java new file mode 100644 index 000000000000..f39919396382 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/FeedbackServiceFeedbackClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.FeedbackServiceFeedbacksImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.FeedbackRequest; + +/** + * Initializes a new instance of the synchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class) +public final class FeedbackServiceFeedbackClient { + @Generated + private final FeedbackServiceFeedbacksImpl serviceClient; + + /** + * Initializes an instance of FeedbackServiceFeedbackClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FeedbackServiceFeedbackClient(FeedbackServiceFeedbacksImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Send feedback for a query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     operationId: String (Required)
+     *     conversationId: String (Required)
+     *     feedback: String(Neutral/ThumbUp/ThumbDown) (Required)
+     *     queryEndpoint: String(V3/Assistant) (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response submitWithResponse(BinaryData resource, RequestOptions requestOptions) { + return this.serviceClient.submitWithResponse(resource, requestOptions); + } + + /** + * Send feedback for a query. + * + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void submit(FeedbackRequest resource) { + // Generated convenience method for submitWithResponse + RequestOptions requestOptions = new RequestOptions(); + submitWithResponse(BinaryData.fromObject(resource), requestOptions).getValue(); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/HealthServiceAsyncClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/HealthServiceAsyncClient.java new file mode 100644 index 000000000000..adf6ba2de390 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/HealthServiceAsyncClient.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.HealthServicesImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotHealth; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class, isAsync = true) +public final class HealthServiceAsyncClient { + @Generated + private final HealthServicesImpl serviceClient; + + /** + * Initializes an instance of HealthServiceAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + HealthServiceAsyncClient(HealthServicesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get the health status of the service. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     message: String (Required)
+     *     operationStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     copilotSetupInfo (Required): {
+     *         createAzureDataExplorerFunctionJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInBuiltInstructionJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInbuiltExampleQueryJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInBuiltAliasJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerAssistantViewJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     }
+     *     errorMessage (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the health status of the service along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getHealthStatusWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getHealthStatusWithResponseAsync(requestOptions); + } + + /** + * Get the health status of the service. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the health status of the service on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getHealthStatus() { + // Generated convenience method for getHealthStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getHealthStatusWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CopilotHealth.class)); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/HealthServiceClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/HealthServiceClient.java new file mode 100644 index 000000000000..05204351600e --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/HealthServiceClient.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.HealthServicesImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotHealth; + +/** + * Initializes a new instance of the synchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class) +public final class HealthServiceClient { + @Generated + private final HealthServicesImpl serviceClient; + + /** + * Initializes an instance of HealthServiceClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + HealthServiceClient(HealthServicesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get the health status of the service. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     message: String (Required)
+     *     operationStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     copilotSetupInfo (Required): {
+     *         createAzureDataExplorerFunctionJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInBuiltInstructionJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInbuiltExampleQueryJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInBuiltAliasJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerAssistantViewJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     }
+     *     errorMessage (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the health status of the service along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getHealthStatusWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getHealthStatusWithResponse(requestOptions); + } + + /** + * Get the health status of the service. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the health status of the service. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CopilotHealth getHealthStatus() { + // Generated convenience method for getHealthStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getHealthStatusWithResponse(requestOptions).getValue().toObject(CopilotHealth.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/InstructionsInstructionsAsyncClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/InstructionsInstructionsAsyncClient.java new file mode 100644 index 000000000000..6a216db617c3 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/InstructionsInstructionsAsyncClient.java @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.InstructionsInstructionsImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.UpdateStatusRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.GetResponse; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionStatusEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class, isAsync = true) +public final class InstructionsInstructionsAsyncClient { + @Generated + private final InstructionsInstructionsImpl serviceClient; + + /** + * Initializes an instance of InstructionsInstructionsAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + InstructionsInstructionsAsyncClient(InstructionsInstructionsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Gets single instruction. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return single instruction along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(id, requestOptions); + } + + /** + * List Instruction resources. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param showActive The instruction status. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Instruction items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux list(boolean showActive, RequestOptions requestOptions) { + return this.serviceClient.listAsync(showActive, requestOptions); + } + + /** + * Create an instruction. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreate(BinaryData resource, RequestOptions requestOptions) { + return this.serviceClient.beginCreateAsync(resource, requestOptions); + } + + /** + * update instructions. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrReplace(String id, BinaryData resource, + RequestOptions requestOptions) { + return this.serviceClient.beginCreateOrReplaceAsync(id, resource, requestOptions); + } + + /** + * Delete instructions. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDelete(String id, RequestOptions requestOptions) { + return this.serviceClient.beginDeleteAsync(id, requestOptions); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Active/Inactive) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         status: String(Active/Inactive) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param updateStatusRequest The updateStatusRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateStatus(String id, BinaryData updateStatusRequest, + RequestOptions requestOptions) { + return this.serviceClient.beginUpdateStatusAsync(id, updateStatusRequest, requestOptions); + } + + /** + * Gets single instruction. + * + * @param id Id for the instruction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single instruction on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get(String id) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(id, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(GetResponse.class)); + } + + /** + * List Instruction resources. + * + * @param showActive The instruction status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Instruction items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux list(boolean showActive) { + // Generated convenience method for list + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = list(showActive, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Instruction.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Create an instruction. + * + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreate(Instruction resource) { + // Generated convenience method for beginCreateWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateWithModelAsync(BinaryData.fromObject(resource), requestOptions); + } + + /** + * update instructions. + * + * @param id Id for the instruction. + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrReplace(String id, Instruction resource) { + // Generated convenience method for beginCreateOrReplaceWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateOrReplaceWithModelAsync(id, BinaryData.fromObject(resource), requestOptions); + } + + /** + * Delete instructions. + * + * @param id Id for the instruction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDelete(String id) { + // Generated convenience method for beginDeleteWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteWithModelAsync(id, requestOptions); + } + + /** + * Update instruction status. + * + * @param id Id for the instruction. + * @param status status of the instruction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateStatus(String id, InstructionStatusEnum status) { + // Generated convenience method for beginUpdateStatusWithModel + RequestOptions requestOptions = new RequestOptions(); + UpdateStatusRequest updateStatusRequestObj = new UpdateStatusRequest(status); + BinaryData updateStatusRequest = BinaryData.fromObject(updateStatusRequestObj); + return serviceClient.beginUpdateStatusWithModelAsync(id, updateStatusRequest, requestOptions); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/InstructionsInstructionsClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/InstructionsInstructionsClient.java new file mode 100644 index 000000000000..08705d287c72 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/InstructionsInstructionsClient.java @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.InstructionsInstructionsImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.UpdateStatusRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.GetResponse; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionStatusEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; + +/** + * Initializes a new instance of the synchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class) +public final class InstructionsInstructionsClient { + @Generated + private final InstructionsInstructionsImpl serviceClient; + + /** + * Initializes an instance of InstructionsInstructionsClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + InstructionsInstructionsClient(InstructionsInstructionsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Gets single instruction. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return single instruction along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(id, requestOptions); + } + + /** + * List Instruction resources. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param showActive The instruction status. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Instruction items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(boolean showActive, RequestOptions requestOptions) { + return this.serviceClient.list(showActive, requestOptions); + } + + /** + * Create an instruction. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreate(BinaryData resource, RequestOptions requestOptions) { + return this.serviceClient.beginCreate(resource, requestOptions); + } + + /** + * update instructions. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrReplace(String id, BinaryData resource, + RequestOptions requestOptions) { + return this.serviceClient.beginCreateOrReplace(id, resource, requestOptions); + } + + /** + * Delete instructions. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDelete(String id, RequestOptions requestOptions) { + return this.serviceClient.beginDelete(id, requestOptions); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Active/Inactive) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         status: String(Active/Inactive) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param updateStatusRequest The updateStatusRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdateStatus(String id, BinaryData updateStatusRequest, + RequestOptions requestOptions) { + return this.serviceClient.beginUpdateStatus(id, updateStatusRequest, requestOptions); + } + + /** + * Gets single instruction. + * + * @param id Id for the instruction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single instruction. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public GetResponse get(String id) { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(id, requestOptions).getValue().toObject(GetResponse.class); + } + + /** + * List Instruction resources. + * + * @param showActive The instruction status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Instruction items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(boolean showActive) { + // Generated convenience method for list + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.list(showActive, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Instruction.class)); + } + + /** + * Create an instruction. + * + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreate(Instruction resource) { + // Generated convenience method for beginCreateWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateWithModel(BinaryData.fromObject(resource), requestOptions); + } + + /** + * update instructions. + * + * @param id Id for the instruction. + * @param resource The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrReplace(String id, Instruction resource) { + // Generated convenience method for beginCreateOrReplaceWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginCreateOrReplaceWithModel(id, BinaryData.fromObject(resource), requestOptions); + } + + /** + * Delete instructions. + * + * @param id Id for the instruction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDelete(String id) { + // Generated convenience method for beginDeleteWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteWithModel(id, requestOptions); + } + + /** + * Update instruction status. + * + * @param id Id for the instruction. + * @param status status of the instruction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdateStatus(String id, InstructionStatusEnum status) { + // Generated convenience method for beginUpdateStatusWithModel + RequestOptions requestOptions = new RequestOptions(); + UpdateStatusRequest updateStatusRequestObj = new UpdateStatusRequest(status); + BinaryData updateStatusRequest = BinaryData.fromObject(updateStatusRequestObj); + return serviceClient.beginUpdateStatusWithModel(id, updateStatusRequest, requestOptions); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/OperationStatusOperationProgressAsyncClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/OperationStatusOperationProgressAsyncClient.java new file mode 100644 index 000000000000..3ed1da5a2858 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/OperationStatusOperationProgressAsyncClient.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.OperationStatusOperationProgressImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class, isAsync = true) +public final class OperationStatusOperationProgressAsyncClient { + @Generated + private final OperationStatusOperationProgressImpl serviceClient; + + /** + * Initializes an instance of OperationStatusOperationProgressAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + OperationStatusOperationProgressAsyncClient(OperationStatusOperationProgressImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get operation progress. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     operationId: String (Required)
+     *     errorMessage (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param operationId The operation id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return operation progress along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationResultWithResponse(String operationId, + RequestOptions requestOptions) { + return this.serviceClient.getOperationResultWithResponseAsync(operationId, requestOptions); + } + + /** + * Get operation progress. + * + * @param operationId The operation id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation progress on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOperationResult(String operationId) { + // Generated convenience method for getOperationResultWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOperationResultWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OperationResultQuery.class)); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/OperationStatusOperationProgressClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/OperationStatusOperationProgressClient.java new file mode 100644 index 000000000000..df44adac9b69 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/OperationStatusOperationProgressClient.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.OperationStatusOperationProgressImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; + +/** + * Initializes a new instance of the synchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class) +public final class OperationStatusOperationProgressClient { + @Generated + private final OperationStatusOperationProgressImpl serviceClient; + + /** + * Initializes an instance of OperationStatusOperationProgressClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + OperationStatusOperationProgressClient(OperationStatusOperationProgressImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get operation progress. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     operationId: String (Required)
+     *     errorMessage (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param operationId The operation id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return operation progress along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationResultWithResponse(String operationId, RequestOptions requestOptions) { + return this.serviceClient.getOperationResultWithResponse(operationId, requestOptions); + } + + /** + * Get operation progress. + * + * @param operationId The operation id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation progress. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultQuery getOperationResult(String operationId) { + // Generated convenience method for getOperationResultWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOperationResultWithResponse(operationId, requestOptions).getValue() + .toObject(OperationResultQuery.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/QueryServiceQueryApiAsyncClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/QueryServiceQueryApiAsyncClient.java new file mode 100644 index 000000000000..34feffb66d5a --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/QueryServiceQueryApiAsyncClient.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.QueryServiceQueryApisImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.ExecuteRequest1; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.QueryResponse; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class, isAsync = true) +public final class QueryServiceQueryApiAsyncClient { + @Generated + private final QueryServiceQueryApisImpl serviceClient; + + /** + * Initializes an instance of QueryServiceQueryApiAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryServiceQueryApiAsyncClient(QueryServiceQueryApisImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * execute the query. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxRetryIntegerNomaxRetry
includeSummaryBooleanNoInclude summary in the response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Conversation-IdStringNoConversation-Id header
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ask: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     result: String (Optional)
+     *     summary: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param acceptLanguage Accept-Language header. + * @param executeRequest1 The executeRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return query Response Result along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> executeWithResponse(String acceptLanguage, BinaryData executeRequest1, + RequestOptions requestOptions) { + return this.serviceClient.executeWithResponseAsync(acceptLanguage, executeRequest1, requestOptions); + } + + /** + * execute the query. + * + * @param acceptLanguage Accept-Language header. + * @param conversationId Conversation-Id header. + * @param maxRetry maxRetry. + * @param includeSummary Include summary in the response. + * @param ask Natural language query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return query Response Result on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono execute(String acceptLanguage, String conversationId, Integer maxRetry, + Boolean includeSummary, String ask) { + // Generated convenience method for executeWithResponse + RequestOptions requestOptions = new RequestOptions(); + ExecuteRequest1 executeRequest1Obj = new ExecuteRequest1().setAsk(ask); + BinaryData executeRequest1 = BinaryData.fromObject(executeRequest1Obj); + if (conversationId != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Conversation-Id"), conversationId); + } + if (maxRetry != null) { + requestOptions.addQueryParam("maxRetry", String.valueOf(maxRetry), false); + } + if (includeSummary != null) { + requestOptions.addQueryParam("includeSummary", String.valueOf(includeSummary), false); + } + return executeWithResponse(acceptLanguage, executeRequest1, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(QueryResponse.class)); + } + + /** + * execute the query. + * + * @param acceptLanguage Accept-Language header. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return query Response Result on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono execute(String acceptLanguage) { + // Generated convenience method for executeWithResponse + RequestOptions requestOptions = new RequestOptions(); + ExecuteRequest1 executeRequest1Obj = new ExecuteRequest1(); + BinaryData executeRequest1 = BinaryData.fromObject(executeRequest1Obj); + return executeWithResponse(acceptLanguage, executeRequest1, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(QueryResponse.class)); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/QueryServiceQueryApiClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/QueryServiceQueryApiClient.java new file mode 100644 index 000000000000..10e0b1c4aa91 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/QueryServiceQueryApiClient.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.QueryServiceQueryApisImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.ExecuteRequest1; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.QueryResponse; + +/** + * Initializes a new instance of the synchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class) +public final class QueryServiceQueryApiClient { + @Generated + private final QueryServiceQueryApisImpl serviceClient; + + /** + * Initializes an instance of QueryServiceQueryApiClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + QueryServiceQueryApiClient(QueryServiceQueryApisImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * execute the query. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxRetryIntegerNomaxRetry
includeSummaryBooleanNoInclude summary in the response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Conversation-IdStringNoConversation-Id header
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ask: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     result: String (Optional)
+     *     summary: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param acceptLanguage Accept-Language header. + * @param executeRequest1 The executeRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return query Response Result along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response executeWithResponse(String acceptLanguage, BinaryData executeRequest1, + RequestOptions requestOptions) { + return this.serviceClient.executeWithResponse(acceptLanguage, executeRequest1, requestOptions); + } + + /** + * execute the query. + * + * @param acceptLanguage Accept-Language header. + * @param conversationId Conversation-Id header. + * @param maxRetry maxRetry. + * @param includeSummary Include summary in the response. + * @param ask Natural language query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return query Response Result. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public QueryResponse execute(String acceptLanguage, String conversationId, Integer maxRetry, Boolean includeSummary, + String ask) { + // Generated convenience method for executeWithResponse + RequestOptions requestOptions = new RequestOptions(); + ExecuteRequest1 executeRequest1Obj = new ExecuteRequest1().setAsk(ask); + BinaryData executeRequest1 = BinaryData.fromObject(executeRequest1Obj); + if (conversationId != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Conversation-Id"), conversationId); + } + if (maxRetry != null) { + requestOptions.addQueryParam("maxRetry", String.valueOf(maxRetry), false); + } + if (includeSummary != null) { + requestOptions.addQueryParam("includeSummary", String.valueOf(includeSummary), false); + } + return executeWithResponse(acceptLanguage, executeRequest1, requestOptions).getValue() + .toObject(QueryResponse.class); + } + + /** + * execute the query. + * + * @param acceptLanguage Accept-Language header. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return query Response Result. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public QueryResponse execute(String acceptLanguage) { + // Generated convenience method for executeWithResponse + RequestOptions requestOptions = new RequestOptions(); + ExecuteRequest1 executeRequest1Obj = new ExecuteRequest1(); + BinaryData executeRequest1 = BinaryData.fromObject(executeRequest1Obj); + return executeWithResponse(acceptLanguage, executeRequest1, requestOptions).getValue() + .toObject(QueryResponse.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ValidateQueryServiceValidateQueryApiAsyncClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ValidateQueryServiceValidateQueryApiAsyncClient.java new file mode 100644 index 000000000000..2dfca17eef7d --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ValidateQueryServiceValidateQueryApiAsyncClient.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.ValidateQueryServiceValidateQueryApisImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.ExecuteRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotTestCase; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestQuery; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestResponse; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ValidateTestSummary; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class, isAsync = true) +public final class ValidateQueryServiceValidateQueryApiAsyncClient { + @Generated + private final ValidateQueryServiceValidateQueryApisImpl serviceClient; + + /** + * Initializes an instance of ValidateQueryServiceValidateQueryApiAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ValidateQueryServiceValidateQueryApiAsyncClient(ValidateQueryServiceValidateQueryApisImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Validate a query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testName: String (Required)
+     *     testCases (Required): [
+     *          (Required){
+     *             naturalLanguage: String (Optional)
+     *             expectedQuery: String (Optional)
+     *             expectedEntities: String (Optional)
+     *         }
+     *     ]
+     *     runInConversationContext: boolean (Required)
+     *     conversationId: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Required)
+     *     testRunStatus: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param executeRequest The executeRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test response along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> executeWithResponse(BinaryData executeRequest, RequestOptions requestOptions) { + return this.serviceClient.executeWithResponseAsync(executeRequest, requestOptions); + } + + /** + * Get the details of a validate test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     validateTestId: String (Required)
+     *     fromDate: OffsetDateTime (Optional)
+     *     toDate: OffsetDateTime (Optional)
+     * }
+     * }
+     * 
+ * + * @param validateTestId The unique identifier of the test query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a validate test along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getValidateTestDetailsWithResponse(String validateTestId, + RequestOptions requestOptions) { + return this.serviceClient.getValidateTestDetailsWithResponseAsync(validateTestId, requestOptions); + } + + /** + * List validate test requests. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fromDateOffsetDateTimeNostart date
endDateOffsetDateTimeNoend date
testRunIdOffsetDateTimeNostart date
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Required)
+     *     createdTime: String (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ValidateTestSummary items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listValidateTestRequests(RequestOptions requestOptions) { + return this.serviceClient.listValidateTestRequestsAsync(requestOptions); + } + + /** + * Validate a query. + * + * @param testName The name of the test query. + * @param testCases The test cases for the query. + * @param runInConversationContext The run in conversation context. + * @param conversationId coversation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test response on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono execute(String testName, List testCases, + boolean runInConversationContext, String conversationId) { + // Generated convenience method for executeWithResponse + RequestOptions requestOptions = new RequestOptions(); + ExecuteRequest executeRequestObj + = new ExecuteRequest(testName, testCases, runInConversationContext).setConversationId(conversationId); + BinaryData executeRequest = BinaryData.fromObject(executeRequestObj); + return executeWithResponse(executeRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestResponse.class)); + } + + /** + * Validate a query. + * + * @param testName The name of the test query. + * @param testCases The test cases for the query. + * @param runInConversationContext The run in conversation context. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test response on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono execute(String testName, List testCases, + boolean runInConversationContext) { + // Generated convenience method for executeWithResponse + RequestOptions requestOptions = new RequestOptions(); + ExecuteRequest executeRequestObj = new ExecuteRequest(testName, testCases, runInConversationContext); + BinaryData executeRequest = BinaryData.fromObject(executeRequestObj); + return executeWithResponse(executeRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestResponse.class)); + } + + /** + * Get the details of a validate test. + * + * @param validateTestId The unique identifier of the test query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a validate test on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getValidateTestDetails(String validateTestId) { + // Generated convenience method for getValidateTestDetailsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getValidateTestDetailsWithResponse(validateTestId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestQuery.class)); + } + + /** + * List validate test requests. + * + * @param fromDate start date. + * @param endDate end date. + * @param testRunId start date. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ValidateTestSummary items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listValidateTestRequests(OffsetDateTime fromDate, OffsetDateTime endDate, + OffsetDateTime testRunId) { + // Generated convenience method for listValidateTestRequests + RequestOptions requestOptions = new RequestOptions(); + if (fromDate != null) { + requestOptions.addQueryParam("fromDate", String.valueOf(fromDate), false); + } + if (endDate != null) { + requestOptions.addQueryParam("endDate", String.valueOf(endDate), false); + } + if (testRunId != null) { + requestOptions.addQueryParam("testRunId", String.valueOf(testRunId), false); + } + PagedFlux pagedFluxResponse = listValidateTestRequests(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(ValidateTestSummary.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * List validate test requests. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ValidateTestSummary items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listValidateTestRequests() { + // Generated convenience method for listValidateTestRequests + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listValidateTestRequests(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(ValidateTestSummary.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ValidateQueryServiceValidateQueryApiClient.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ValidateQueryServiceValidateQueryApiClient.java new file mode 100644 index 000000000000..117dd67ae470 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ValidateQueryServiceValidateQueryApiClient.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.ValidateQueryServiceValidateQueryApisImpl; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.ExecuteRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotTestCase; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestQuery; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestResponse; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ValidateTestSummary; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Initializes a new instance of the synchronous CopilotServiceClient type. + */ +@ServiceClient(builder = CopilotServiceClientBuilder.class) +public final class ValidateQueryServiceValidateQueryApiClient { + @Generated + private final ValidateQueryServiceValidateQueryApisImpl serviceClient; + + /** + * Initializes an instance of ValidateQueryServiceValidateQueryApiClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ValidateQueryServiceValidateQueryApiClient(ValidateQueryServiceValidateQueryApisImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Validate a query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testName: String (Required)
+     *     testCases (Required): [
+     *          (Required){
+     *             naturalLanguage: String (Optional)
+     *             expectedQuery: String (Optional)
+     *             expectedEntities: String (Optional)
+     *         }
+     *     ]
+     *     runInConversationContext: boolean (Required)
+     *     conversationId: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Required)
+     *     testRunStatus: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param executeRequest The executeRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test response along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response executeWithResponse(BinaryData executeRequest, RequestOptions requestOptions) { + return this.serviceClient.executeWithResponse(executeRequest, requestOptions); + } + + /** + * Get the details of a validate test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     validateTestId: String (Required)
+     *     fromDate: OffsetDateTime (Optional)
+     *     toDate: OffsetDateTime (Optional)
+     * }
+     * }
+     * 
+ * + * @param validateTestId The unique identifier of the test query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a validate test along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getValidateTestDetailsWithResponse(String validateTestId, + RequestOptions requestOptions) { + return this.serviceClient.getValidateTestDetailsWithResponse(validateTestId, requestOptions); + } + + /** + * List validate test requests. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fromDateOffsetDateTimeNostart date
endDateOffsetDateTimeNoend date
testRunIdOffsetDateTimeNostart date
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Required)
+     *     createdTime: String (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ValidateTestSummary items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listValidateTestRequests(RequestOptions requestOptions) { + return this.serviceClient.listValidateTestRequests(requestOptions); + } + + /** + * Validate a query. + * + * @param testName The name of the test query. + * @param testCases The test cases for the query. + * @param runInConversationContext The run in conversation context. + * @param conversationId coversation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestResponse execute(String testName, List testCases, boolean runInConversationContext, + String conversationId) { + // Generated convenience method for executeWithResponse + RequestOptions requestOptions = new RequestOptions(); + ExecuteRequest executeRequestObj + = new ExecuteRequest(testName, testCases, runInConversationContext).setConversationId(conversationId); + BinaryData executeRequest = BinaryData.fromObject(executeRequestObj); + return executeWithResponse(executeRequest, requestOptions).getValue().toObject(TestResponse.class); + } + + /** + * Validate a query. + * + * @param testName The name of the test query. + * @param testCases The test cases for the query. + * @param runInConversationContext The run in conversation context. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestResponse execute(String testName, List testCases, boolean runInConversationContext) { + // Generated convenience method for executeWithResponse + RequestOptions requestOptions = new RequestOptions(); + ExecuteRequest executeRequestObj = new ExecuteRequest(testName, testCases, runInConversationContext); + BinaryData executeRequest = BinaryData.fromObject(executeRequestObj); + return executeWithResponse(executeRequest, requestOptions).getValue().toObject(TestResponse.class); + } + + /** + * Get the details of a validate test. + * + * @param validateTestId The unique identifier of the test query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a validate test. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestQuery getValidateTestDetails(String validateTestId) { + // Generated convenience method for getValidateTestDetailsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getValidateTestDetailsWithResponse(validateTestId, requestOptions).getValue().toObject(TestQuery.class); + } + + /** + * List validate test requests. + * + * @param fromDate start date. + * @param endDate end date. + * @param testRunId start date. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ValidateTestSummary items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listValidateTestRequests(OffsetDateTime fromDate, OffsetDateTime endDate, + OffsetDateTime testRunId) { + // Generated convenience method for listValidateTestRequests + RequestOptions requestOptions = new RequestOptions(); + if (fromDate != null) { + requestOptions.addQueryParam("fromDate", String.valueOf(fromDate), false); + } + if (endDate != null) { + requestOptions.addQueryParam("endDate", String.valueOf(endDate), false); + } + if (testRunId != null) { + requestOptions.addQueryParam("testRunId", String.valueOf(testRunId), false); + } + return serviceClient.listValidateTestRequests(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(ValidateTestSummary.class)); + } + + /** + * List validate test requests. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ValidateTestSummary items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listValidateTestRequests() { + // Generated convenience method for listValidateTestRequests + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listValidateTestRequests(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(ValidateTestSummary.class)); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/AliasDictionaryAliasesImpl.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/AliasDictionaryAliasesImpl.java new file mode 100644 index 000000000000..fd47f635e822 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/AliasDictionaryAliasesImpl.java @@ -0,0 +1,1219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncDefaultPollingStrategy; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceVersion; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AliasDictionaryAliases. + */ +public final class AliasDictionaryAliasesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final AliasDictionaryAliasesService service; + + /** + * The service client containing this operation class. + */ + private final CopilotServiceClientImpl client; + + /** + * Initializes an instance of AliasDictionaryAliasesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AliasDictionaryAliasesImpl(CopilotServiceClientImpl client) { + this.service = RestProxy.create(AliasDictionaryAliasesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public CopilotServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for CopilotServiceClientAliasDictionaryAliases to be used by the proxy + * service to perform REST calls. + */ + @Host("https://mds-{mdsUniqueId}.{location}.cloudapp.azure.com/") + @ServiceInterface(name = "CopilotServiceClient") + public interface AliasDictionaryAliasesService { + @Get("/copilot/aliases/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/copilot/aliases/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Post("/copilot/aliases") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> create(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + + @Post("/copilot/aliases") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createSync(@HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); + + @Put("/copilot/aliases/{id}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrReplace(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); + + @Put("/copilot/aliases/{id}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createOrReplaceSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); + + @Delete("/copilot/aliases/{id}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Delete("/copilot/aliases/{id}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteSync(@HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @QueryParam("api-version") String apiVersion, @PathParam("id") String id, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/copilot/aliases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> list(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/copilot/aliases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/copilot/aliases/{id}:activate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> activate(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData activateRequest, + RequestOptions requestOptions, Context context); + + @Post("/copilot/aliases/{id}:activate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response activateSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData activateRequest, + RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Get an alias by Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an alias by Id along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, accept, requestOptions, context)); + } + + /** + * Get an alias by Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an alias by Id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, accept, requestOptions, Context.NONE); + } + + /** + * Create an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, resource, requestOptions, context)); + } + + /** + * Create an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, resource, requestOptions, Context.NONE); + } + + /** + * Create an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateAsync(BinaryData resource, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), () -> this.createWithResponseAsync(resource, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Create an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreate(BinaryData resource, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.createWithResponse(resource, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Create an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateWithModelAsync(BinaryData resource, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), () -> this.createWithResponseAsync(resource, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Alias.class)); + } + + /** + * Create an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateWithModel(BinaryData resource, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.createWithResponse(resource, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Alias.class)); + } + + /** + * Update an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return this is the request model for Alias along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrReplaceWithResponseAsync(String id, BinaryData resource, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createOrReplace(this.client.getMdsUniqueId(), + this.client.getLocation(), this.client.getServiceVersion().getVersion(), id, contentType, accept, resource, + requestOptions, context)); + } + + /** + * Update an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return this is the request model for Alias along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrReplaceWithResponse(String id, BinaryData resource, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrReplaceSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, contentType, accept, resource, requestOptions, + Context.NONE); + } + + /** + * Update an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of this is the request model for Alias. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrReplaceAsync(String id, BinaryData resource, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createOrReplaceWithResponseAsync(id, resource, requestOptions), + new com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Update an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of this is the request model for Alias. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrReplace(String id, BinaryData resource, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createOrReplaceWithResponse(id, resource, requestOptions), + new com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Update an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of this is the request model for Alias. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrReplaceWithModelAsync(String id, BinaryData resource, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createOrReplaceWithResponseAsync(id, resource, requestOptions), + new com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Alias.class)); + } + + /** + * Update an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of this is the request model for Alias. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrReplaceWithModel(String id, BinaryData resource, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createOrReplaceWithResponse(id, resource, requestOptions), + new com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Alias.class)); + } + + /** + * Delete an alias. + * + * @param id Id for the alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.delete(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, accept, requestOptions, context)); + } + + /** + * Delete an alias. + * + * @param id Id for the alias. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, accept, requestOptions, Context.NONE); + } + + /** + * List all aliases. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Alias items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List all aliases. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Alias items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listSinglePageAsync(requestOptions), + nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * List all aliases. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Alias items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * List all aliases. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Alias items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listSinglePage(requestOptions), + nextLink -> listNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Deactivate an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param activateRequest The activateRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return this is the patch request to update the status of Alias along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> activateWithResponseAsync(String id, BinaryData activateRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.activate(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, contentType, accept, activateRequest, requestOptions, + context)); + } + + /** + * Deactivate an alias. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the alias. + * @param activateRequest The activateRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return this is the patch request to update the status of Alias along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response activateWithResponse(String id, BinaryData activateRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.activateSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, contentType, accept, activateRequest, requestOptions, + Context.NONE); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Alias items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getMdsUniqueId(), this.client.getLocation(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     aliases (Required): [
+     *         String (Required)
+     *     ]
+     *     isCustom: boolean (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Alias items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getMdsUniqueId(), + this.client.getLocation(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/CopilotServiceClientImpl.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/CopilotServiceClientImpl.java new file mode 100644 index 000000000000..e09f40c011d3 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/CopilotServiceClientImpl.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceVersion; + +/** + * Initializes a new instance of the CopilotServiceClient type. + */ +public final class CopilotServiceClientImpl { + /** + */ + private final String mdsUniqueId; + + /** + * Gets. + * + * @return the mdsUniqueId value. + */ + public String getMdsUniqueId() { + return this.mdsUniqueId; + } + + /** + */ + private final String location; + + /** + * Gets. + * + * @return the location value. + */ + public String getLocation() { + return this.location; + } + + /** + * Service version. + */ + private final CopilotServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public CopilotServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The QueryServiceQueryApisImpl object to access its operations. + */ + private final QueryServiceQueryApisImpl queryServiceQueryApis; + + /** + * Gets the QueryServiceQueryApisImpl object to access its operations. + * + * @return the QueryServiceQueryApisImpl object. + */ + public QueryServiceQueryApisImpl getQueryServiceQueryApis() { + return this.queryServiceQueryApis; + } + + /** + * The OperationStatusOperationProgressImpl object to access its operations. + */ + private final OperationStatusOperationProgressImpl operationStatusOperationProgress; + + /** + * Gets the OperationStatusOperationProgressImpl object to access its operations. + * + * @return the OperationStatusOperationProgressImpl object. + */ + public OperationStatusOperationProgressImpl getOperationStatusOperationProgress() { + return this.operationStatusOperationProgress; + } + + /** + * The InstructionsInstructionsImpl object to access its operations. + */ + private final InstructionsInstructionsImpl instructionsInstructions; + + /** + * Gets the InstructionsInstructionsImpl object to access its operations. + * + * @return the InstructionsInstructionsImpl object. + */ + public InstructionsInstructionsImpl getInstructionsInstructions() { + return this.instructionsInstructions; + } + + /** + * The ExampleQueryServiceExampleQueryOperationsImpl object to access its operations. + */ + private final ExampleQueryServiceExampleQueryOperationsImpl exampleQueryServiceExampleQueryOperations; + + /** + * Gets the ExampleQueryServiceExampleQueryOperationsImpl object to access its operations. + * + * @return the ExampleQueryServiceExampleQueryOperationsImpl object. + */ + public ExampleQueryServiceExampleQueryOperationsImpl getExampleQueryServiceExampleQueryOperations() { + return this.exampleQueryServiceExampleQueryOperations; + } + + /** + * The AliasDictionaryAliasesImpl object to access its operations. + */ + private final AliasDictionaryAliasesImpl aliasDictionaryAliases; + + /** + * Gets the AliasDictionaryAliasesImpl object to access its operations. + * + * @return the AliasDictionaryAliasesImpl object. + */ + public AliasDictionaryAliasesImpl getAliasDictionaryAliases() { + return this.aliasDictionaryAliases; + } + + /** + * The HealthServicesImpl object to access its operations. + */ + private final HealthServicesImpl healthServices; + + /** + * Gets the HealthServicesImpl object to access its operations. + * + * @return the HealthServicesImpl object. + */ + public HealthServicesImpl getHealthServices() { + return this.healthServices; + } + + /** + * The ValidateQueryServiceValidateQueryApisImpl object to access its operations. + */ + private final ValidateQueryServiceValidateQueryApisImpl validateQueryServiceValidateQueryApis; + + /** + * Gets the ValidateQueryServiceValidateQueryApisImpl object to access its operations. + * + * @return the ValidateQueryServiceValidateQueryApisImpl object. + */ + public ValidateQueryServiceValidateQueryApisImpl getValidateQueryServiceValidateQueryApis() { + return this.validateQueryServiceValidateQueryApis; + } + + /** + * The FeedbackServiceFeedbacksImpl object to access its operations. + */ + private final FeedbackServiceFeedbacksImpl feedbackServiceFeedbacks; + + /** + * Gets the FeedbackServiceFeedbacksImpl object to access its operations. + * + * @return the FeedbackServiceFeedbacksImpl object. + */ + public FeedbackServiceFeedbacksImpl getFeedbackServiceFeedbacks() { + return this.feedbackServiceFeedbacks; + } + + /** + * Initializes an instance of CopilotServiceClient client. + * + * @param mdsUniqueId + * @param location + * @param serviceVersion Service version. + */ + public CopilotServiceClientImpl(String mdsUniqueId, String location, CopilotServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), mdsUniqueId, location, serviceVersion); + } + + /** + * Initializes an instance of CopilotServiceClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param mdsUniqueId + * @param location + * @param serviceVersion Service version. + */ + public CopilotServiceClientImpl(HttpPipeline httpPipeline, String mdsUniqueId, String location, + CopilotServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), mdsUniqueId, location, serviceVersion); + } + + /** + * Initializes an instance of CopilotServiceClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param mdsUniqueId + * @param location + * @param serviceVersion Service version. + */ + public CopilotServiceClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String mdsUniqueId, + String location, CopilotServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.mdsUniqueId = mdsUniqueId; + this.location = location; + this.serviceVersion = serviceVersion; + this.queryServiceQueryApis = new QueryServiceQueryApisImpl(this); + this.operationStatusOperationProgress = new OperationStatusOperationProgressImpl(this); + this.instructionsInstructions = new InstructionsInstructionsImpl(this); + this.exampleQueryServiceExampleQueryOperations = new ExampleQueryServiceExampleQueryOperationsImpl(this); + this.aliasDictionaryAliases = new AliasDictionaryAliasesImpl(this); + this.healthServices = new HealthServicesImpl(this); + this.validateQueryServiceValidateQueryApis = new ValidateQueryServiceValidateQueryApisImpl(this); + this.feedbackServiceFeedbacks = new FeedbackServiceFeedbacksImpl(this); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/ExampleQueryServiceExampleQueryOperationsImpl.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/ExampleQueryServiceExampleQueryOperationsImpl.java new file mode 100644 index 000000000000..ff0ef5f0c16e --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/ExampleQueryServiceExampleQueryOperationsImpl.java @@ -0,0 +1,892 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceVersion; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExampleQueryServiceExampleQueryOperations. + */ +public final class ExampleQueryServiceExampleQueryOperationsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ExampleQueryServiceExampleQueryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final CopilotServiceClientImpl client; + + /** + * Initializes an instance of ExampleQueryServiceExampleQueryOperationsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExampleQueryServiceExampleQueryOperationsImpl(CopilotServiceClientImpl client) { + this.service = RestProxy.create(ExampleQueryServiceExampleQueryOperationsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public CopilotServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for CopilotServiceClientExampleQueryServiceExampleQueryOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("https://mds-{mdsUniqueId}.{location}.cloudapp.azure.com/") + @ServiceInterface(name = "CopilotServiceClient") + public interface ExampleQueryServiceExampleQueryOperationsService { + @Get("/copilot/exampleQuery/{exampleId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getExample(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("exampleId") String exampleId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/copilot/exampleQuery/{exampleId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getExampleSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("exampleId") String exampleId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/copilot/exampleQuery") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listAllExamples(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/copilot/exampleQuery") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listAllExamplesSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/copilot/exampleQuery/{exampleId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateExample(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("exampleId") String exampleId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, + RequestOptions requestOptions, Context context); + + @Patch("/copilot/exampleQuery/{exampleId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateExampleSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("exampleId") String exampleId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData resource, + RequestOptions requestOptions, Context context); + + @Delete("/copilot/exampleQuery/{exampleId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteExample(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("exampleId") String exampleId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/copilot/exampleQuery/{exampleId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteExampleSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("exampleId") String exampleId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/copilot/exampleQuery") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createExample(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + + @Post("/copilot/exampleQuery") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createExampleSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + + @Post("/copilot/exampleQuery/{exampleId}:linkInstruction") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> linkInstruction(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("exampleId") String exampleId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData linkInstructionRequest, + RequestOptions requestOptions, Context context); + + @Post("/copilot/exampleQuery/{exampleId}:linkInstruction") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response linkInstructionSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("exampleId") String exampleId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData linkInstructionRequest, + RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listAllExamplesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listAllExamplesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * get the example query. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the example query along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getExampleWithResponseAsync(String exampleId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getExample(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), exampleId, accept, requestOptions, context)); + } + + /** + * get the example query. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the example query along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExampleWithResponse(String exampleId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getExampleSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), exampleId, accept, requestOptions, Context.NONE); + } + + /** + * get all example queries. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
instructionIdStringNoInstruction id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all example queries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllExamplesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAllExamples(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * get all example queries. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
instructionIdStringNoInstruction id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all example queries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAllExamplesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listAllExamplesSinglePageAsync(requestOptions), + nextLink -> listAllExamplesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * get all example queries. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
instructionIdStringNoInstruction id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all example queries along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAllExamplesSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listAllExamplesSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * get all example queries. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
instructionIdStringNoInstruction id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all example queries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAllExamples(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listAllExamplesSinglePage(requestOptions), + nextLink -> listAllExamplesNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * update the example query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the example query resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateExampleWithResponseAsync(String exampleId, BinaryData resource, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateExample(this.client.getMdsUniqueId(), + this.client.getLocation(), this.client.getServiceVersion().getVersion(), exampleId, contentType, accept, + resource, requestOptions, context)); + } + + /** + * update the example query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the example query resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateExampleWithResponse(String exampleId, BinaryData resource, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return service.updateExampleSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), exampleId, contentType, accept, resource, requestOptions, + Context.NONE); + } + + /** + * delete the example query. + * + * @param exampleId The ID of the example query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteExampleWithResponseAsync(String exampleId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deleteExample(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), exampleId, accept, requestOptions, context)); + } + + /** + * delete the example query. + * + * @param exampleId The ID of the example query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteExampleWithResponse(String exampleId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteExampleSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), exampleId, accept, requestOptions, Context.NONE); + } + + /** + * create the example query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createExampleWithResponseAsync(BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createExample(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, resource, requestOptions, context)); + } + + /** + * create the example query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createExampleWithResponse(BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createExampleSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, resource, requestOptions, Context.NONE); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     linkedInstructions (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     linkedInstructions (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param linkInstructionRequest The linkInstructionRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the patch request for the example query along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> linkInstructionWithResponseAsync(String exampleId, + BinaryData linkInstructionRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.linkInstruction(this.client.getMdsUniqueId(), + this.client.getLocation(), this.client.getServiceVersion().getVersion(), exampleId, contentType, accept, + linkInstructionRequest, requestOptions, context)); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     linkedInstructions (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     linkedInstructions (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param exampleId The ID of the example query. + * @param linkInstructionRequest The linkInstructionRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the patch request for the example query along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response linkInstructionWithResponse(String exampleId, BinaryData linkInstructionRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.linkInstructionSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), exampleId, contentType, accept, linkInstructionRequest, + requestOptions, Context.NONE); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ExampleQueryRequest items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllExamplesNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAllExamplesNext(nextLink, this.client.getMdsUniqueId(), + this.client.getLocation(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     exampleId: String (Required)
+     *     userQuestion: String (Optional, Required on create)
+     *     linkedInstructions (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     sampleQuery (Optional, Required on create): {
+     *         language: String (Optional, Required on create)
+     *         query: String (Optional, Required on create)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ExampleQueryRequest items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAllExamplesNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listAllExamplesNextSync(nextLink, this.client.getMdsUniqueId(), + this.client.getLocation(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/FeedbackServiceFeedbacksImpl.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/FeedbackServiceFeedbacksImpl.java new file mode 100644 index 000000000000..341d56edc8e4 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/FeedbackServiceFeedbacksImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceVersion; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FeedbackServiceFeedbacks. + */ +public final class FeedbackServiceFeedbacksImpl { + /** + * The proxy service used to perform REST calls. + */ + private final FeedbackServiceFeedbacksService service; + + /** + * The service client containing this operation class. + */ + private final CopilotServiceClientImpl client; + + /** + * Initializes an instance of FeedbackServiceFeedbacksImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FeedbackServiceFeedbacksImpl(CopilotServiceClientImpl client) { + this.service = RestProxy.create(FeedbackServiceFeedbacksService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public CopilotServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for CopilotServiceClientFeedbackServiceFeedbacks to be used by the proxy + * service to perform REST calls. + */ + @Host("https://mds-{mdsUniqueId}.{location}.cloudapp.azure.com/") + @ServiceInterface(name = "CopilotServiceClient") + public interface FeedbackServiceFeedbacksService { + @Post("/copilot/feedback") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> submit(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + + @Post("/copilot/feedback") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response submitSync(@HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); + } + + /** + * Send feedback for a query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     operationId: String (Required)
+     *     conversationId: String (Required)
+     *     feedback: String(Neutral/ThumbUp/ThumbDown) (Required)
+     *     queryEndpoint: String(V3/Assistant) (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> submitWithResponseAsync(BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.submit(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, resource, requestOptions, context)); + } + + /** + * Send feedback for a query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     operationId: String (Required)
+     *     conversationId: String (Required)
+     *     feedback: String(Neutral/ThumbUp/ThumbDown) (Required)
+     *     queryEndpoint: String(V3/Assistant) (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response submitWithResponse(BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.submitSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, resource, requestOptions, Context.NONE); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/HealthServicesImpl.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/HealthServicesImpl.java new file mode 100644 index 000000000000..d8ea18bfc602 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/HealthServicesImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceVersion; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HealthServices. + */ +public final class HealthServicesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final HealthServicesService service; + + /** + * The service client containing this operation class. + */ + private final CopilotServiceClientImpl client; + + /** + * Initializes an instance of HealthServicesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HealthServicesImpl(CopilotServiceClientImpl client) { + this.service + = RestProxy.create(HealthServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public CopilotServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for CopilotServiceClientHealthServices to be used by the proxy service to + * perform REST calls. + */ + @Host("https://mds-{mdsUniqueId}.{location}.cloudapp.azure.com/") + @ServiceInterface(name = "CopilotServiceClient") + public interface HealthServicesService { + @Get("/copilot/health") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getHealthStatus(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/copilot/health") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getHealthStatusSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + } + + /** + * Get the health status of the service. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     message: String (Required)
+     *     operationStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     copilotSetupInfo (Required): {
+     *         createAzureDataExplorerFunctionJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInBuiltInstructionJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInbuiltExampleQueryJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInBuiltAliasJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerAssistantViewJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     }
+     *     errorMessage (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the health status of the service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getHealthStatusWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getHealthStatus(this.client.getMdsUniqueId(), + this.client.getLocation(), accept, requestOptions, context)); + } + + /** + * Get the health status of the service. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     message: String (Required)
+     *     operationStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     copilotSetupInfo (Required): {
+     *         createAzureDataExplorerFunctionJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInBuiltInstructionJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInbuiltExampleQueryJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerInBuiltAliasJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *         registerAssistantViewJobStatus: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     }
+     *     errorMessage (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the health status of the service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getHealthStatusWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getHealthStatusSync(this.client.getMdsUniqueId(), this.client.getLocation(), accept, + requestOptions, Context.NONE); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/InstructionsInstructionsImpl.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/InstructionsInstructionsImpl.java new file mode 100644 index 000000000000..767ac1ec35d4 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/InstructionsInstructionsImpl.java @@ -0,0 +1,2095 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncDefaultPollingStrategy; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceVersion; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in InstructionsInstructions. + */ +public final class InstructionsInstructionsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final InstructionsInstructionsService service; + + /** + * The service client containing this operation class. + */ + private final CopilotServiceClientImpl client; + + /** + * Initializes an instance of InstructionsInstructionsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InstructionsInstructionsImpl(CopilotServiceClientImpl client) { + this.service = RestProxy.create(InstructionsInstructionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public CopilotServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for CopilotServiceClientInstructionsInstructions to be used by the proxy + * service to perform REST calls. + */ + @Host("https://mds-{mdsUniqueId}.{location}.cloudapp.azure.com/") + @ServiceInterface(name = "CopilotServiceClient") + public interface InstructionsInstructionsService { + @Get("/copilot/instruction/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/copilot/instruction/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/copilot/instruction") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> list(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @QueryParam("showActive") boolean showActive, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/copilot/instruction") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @QueryParam("showActive") boolean showActive, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/copilot/instruction") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> create(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context); + + @Post("/copilot/instruction") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createSync(@HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); + + @Put("/copilot/instruction/{id}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrReplace(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); + + @Put("/copilot/instruction/{id}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createOrReplaceSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData resource, + RequestOptions requestOptions, Context context); + + @Delete("/copilot/instruction/{id}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Delete("/copilot/instruction/{id}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Post("/copilot/instruction/{id}:updateStatus") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateStatus(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateStatusRequest, + RequestOptions requestOptions, Context context); + + @Post("/copilot/instruction/{id}:updateStatus") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateStatusSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("id") String id, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateStatusRequest, + RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Gets single instruction. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return single instruction along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, accept, requestOptions, context)); + } + + /** + * Gets single instruction. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return single instruction along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, accept, requestOptions, Context.NONE); + } + + /** + * List Instruction resources. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param showActive The instruction status. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Instruction items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(boolean showActive, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), showActive, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List Instruction resources. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param showActive The instruction status. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Instruction items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(boolean showActive, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listSinglePageAsync(showActive, requestOptions), + nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * List Instruction resources. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param showActive The instruction status. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Instruction items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(boolean showActive, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), showActive, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * List Instruction resources. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param showActive The instruction status. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Instruction items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(boolean showActive, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listSinglePage(showActive, requestOptions), + nextLink -> listNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Create an instruction. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, resource, requestOptions, context)); + } + + /** + * Create an instruction. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(BinaryData resource, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, resource, requestOptions, Context.NONE); + } + + /** + * Create an instruction. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateAsync(BinaryData resource, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), () -> this.createWithResponseAsync(resource, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Create an instruction. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreate(BinaryData resource, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.createWithResponse(resource, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Create an instruction. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateWithModelAsync(BinaryData resource, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), () -> this.createWithResponseAsync(resource, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Instruction.class)); + } + + /** + * Create an instruction. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateWithModel(BinaryData resource, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.createWithResponse(resource, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Instruction.class)); + } + + /** + * update instructions. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrReplaceWithResponseAsync(String id, BinaryData resource, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createOrReplace(this.client.getMdsUniqueId(), + this.client.getLocation(), this.client.getServiceVersion().getVersion(), id, contentType, accept, resource, + requestOptions, context)); + } + + /** + * update instructions. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrReplaceWithResponse(String id, BinaryData resource, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrReplaceSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, contentType, accept, resource, requestOptions, + Context.NONE); + } + + /** + * update instructions. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrReplaceAsync(String id, BinaryData resource, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createOrReplaceWithResponseAsync(id, resource, requestOptions), + new com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * update instructions. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrReplace(String id, BinaryData resource, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createOrReplaceWithResponse(id, resource, requestOptions), + new com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * update instructions. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOrReplaceWithModelAsync(String id, + BinaryData resource, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createOrReplaceWithResponseAsync(id, resource, requestOptions), + new com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Instruction.class)); + } + + /** + * update instructions. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param resource The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOrReplaceWithModel(String id, BinaryData resource, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createOrReplaceWithResponse(id, resource, requestOptions), + new com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Instruction.class)); + } + + /** + * Delete instructions. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return provides status details for long running operations along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.delete(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, accept, requestOptions, context)); + } + + /** + * Delete instructions. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return provides status details for long running operations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, accept, requestOptions, Context.NONE); + } + + /** + * Delete instructions. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteAsync(String id, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), () -> this.deleteWithResponseAsync(id, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete instructions. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDelete(String id, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.deleteWithResponse(id, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete instructions. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteWithModelAsync(String id, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), () -> this.deleteWithResponseAsync(id, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete instructions. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteWithModel(String id, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.deleteWithResponse(id, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Void.class)); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Active/Inactive) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         status: String(Active/Inactive) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param updateStatusRequest The updateStatusRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return provides status details for long running operations along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateStatusWithResponseAsync(String id, BinaryData updateStatusRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateStatus(this.client.getMdsUniqueId(), + this.client.getLocation(), this.client.getServiceVersion().getVersion(), id, contentType, accept, + updateStatusRequest, requestOptions, context)); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Active/Inactive) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         status: String(Active/Inactive) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param updateStatusRequest The updateStatusRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return provides status details for long running operations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateStatusWithResponse(String id, BinaryData updateStatusRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateStatusSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), id, contentType, accept, updateStatusRequest, requestOptions, + Context.NONE); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Active/Inactive) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         status: String(Active/Inactive) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param updateStatusRequest The updateStatusRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateStatusAsync(String id, BinaryData updateStatusRequest, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.updateStatusWithResponseAsync(id, updateStatusRequest, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Active/Inactive) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         status: String(Active/Inactive) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param updateStatusRequest The updateStatusRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdateStatus(String id, BinaryData updateStatusRequest, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.updateStatusWithResponse(id, updateStatusRequest, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Active/Inactive) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         status: String(Active/Inactive) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param updateStatusRequest The updateStatusRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateStatusWithModelAsync(String id, + BinaryData updateStatusRequest, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.updateStatusWithResponseAsync(id, updateStatusRequest, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Void.class)); + } + + /** + * Update instruction status. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Active/Inactive) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         status: String(Active/Inactive) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param id Id for the instruction. + * @param updateStatusRequest The updateStatusRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdateStatusWithModel(String id, BinaryData updateStatusRequest, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.updateStatusWithResponse(id, updateStatusRequest, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationResultQuery.class), TypeReference.createInstance(Void.class)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Instruction items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getMdsUniqueId(), this.client.getLocation(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     instructionId: String (Required)
+     *     instructionVersion: String (Required)
+     *     status: String(Active/Inactive) (Required)
+     *     domain: String(MOM/SCM/DE) (Required)
+     *     subDomain: String(Production/Quality/Maintenance/Inventory/Downtime/Scrap/Mixed) (Required)
+     *     category: String(Transactional/Analytical/Trend/KPI) (Required)
+     *     language: String(EN) (Required)
+     *     retrieval (Required): {
+     *         subTopics (Required): [
+     *             String (Required)
+     *         ]
+     *         keywords (Required): [
+     *             String (Required)
+     *         ]
+     *         sampleQuestions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     relationships (Required): {
+     *         dependencies (Required): [
+     *             String (Required)
+     *         ]
+     *         exclusions (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     comment: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Instruction items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getMdsUniqueId(), + this.client.getLocation(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/JsonMergePatchHelper.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/JsonMergePatchHelper.java new file mode 100644 index 000000000000..e4f2fa6a8293 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/JsonMergePatchHelper.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.SampleQuery; + +/** + * This is the Helper class to enable json merge patch serialization for a model. + */ +public class JsonMergePatchHelper { + private static ExampleQueryRequestAccessor exampleQueryRequestAccessor; + + public interface ExampleQueryRequestAccessor { + ExampleQueryRequest prepareModelForJsonMergePatch(ExampleQueryRequest exampleQueryRequest, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(ExampleQueryRequest exampleQueryRequest); + } + + public static void setExampleQueryRequestAccessor(ExampleQueryRequestAccessor accessor) { + exampleQueryRequestAccessor = accessor; + } + + public static ExampleQueryRequestAccessor getExampleQueryRequestAccessor() { + return exampleQueryRequestAccessor; + } + + private static SampleQueryAccessor sampleQueryAccessor; + + public interface SampleQueryAccessor { + SampleQuery prepareModelForJsonMergePatch(SampleQuery sampleQuery, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(SampleQuery sampleQuery); + } + + public static void setSampleQueryAccessor(SampleQueryAccessor accessor) { + sampleQueryAccessor = accessor; + } + + public static SampleQueryAccessor getSampleQueryAccessor() { + return sampleQueryAccessor; + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/OperationLocationPollingStrategy.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/OperationLocationPollingStrategy.java new file mode 100644 index 000000000000..0783d3f67acd --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/OperationLocationPollingStrategy.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.exception.AzureException; +import com.azure.core.http.HttpHeader; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.OperationResourcePollingStrategy; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.PollingContext; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.serializer.JsonSerializerProviders; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +/** + * Implements an operation location polling strategy, from Operation-Location. + * + * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept + * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be + * kept + */ +public final class OperationLocationPollingStrategy extends OperationResourcePollingStrategy { + + private static final ClientLogger LOGGER = new ClientLogger(OperationLocationPollingStrategy.class); + + private final ObjectSerializer serializer; + private final String endpoint; + private final String propertyName; + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) { + this(pollingStrategyOptions, null); + } + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @param propertyName the name of the property to extract final result. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); + this.propertyName = propertyName; + this.endpoint = pollingStrategyOptions.getEndpoint(); + this.serializer = pollingStrategyOptions.getSerializer() != null + ? pollingStrategyOptions.getSerializer() + : JsonSerializerProviders.createInstance(true); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> onInitialResponse(Response response, PollingContext pollingContext, + TypeReference pollResponseType) { + // Response is Response + + HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER); + if (operationLocationHeader != null) { + pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(), + PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER)); + } + final String httpMethod = response.getRequest().getHttpMethod().name(); + pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod); + pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString()); + + if (response.getStatusCode() == 200 + || response.getStatusCode() == 201 + || response.getStatusCode() == 202 + || response.getStatusCode() == 204) { + final Duration retryAfter + = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now); + final Mono> pollResponseMono + = PollingUtils.deserializeResponse((BinaryData) response.getValue(), serializer, pollResponseType) + .onErrorResume(exception -> { + LOGGER.info("Failed to parse initial response."); + return Mono.empty(); + }) + .map(value -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, value, retryAfter)); + return pollResponseMono.switchIfEmpty( + Mono.fromSupplier(() -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, null, retryAfter))); + } else { + return Mono + .error( + new AzureException(String.format( + "Operation failed or cancelled with status code %d," + + ", '%s' header: %s, and response body: %s", + response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader, + response.getValue()))); + } + } + + /** + * {@inheritDoc} + */ + @Override + public Mono getResult(PollingContext pollingContext, TypeReference resultType) { + if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) { + return Mono.error(new AzureException("Long running operation failed.")); + } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) { + return Mono.error(new AzureException("Long running operation cancelled.")); + } + if (propertyName != null) { + // take the last poll response body from PollingContext, + // and de-serialize the property as final result + BinaryData latestResponseBody + = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY)); + return PollingUtils + .deserializeResponse(latestResponseBody, serializer, PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE) + .flatMap(value -> { + if (value.get(propertyName) != null) { + return BinaryData.fromObjectAsync(value.get(propertyName)) + .flatMap(result -> PollingUtils.deserializeResponse(result, serializer, resultType)); + } else { + return Mono.error(new AzureException("Cannot get final result")); + } + }) + .switchIfEmpty(Mono.error(new AzureException("Cannot get final result"))); + } else { + return super.getResult(pollingContext, resultType); + } + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/OperationStatusOperationProgressImpl.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/OperationStatusOperationProgressImpl.java new file mode 100644 index 000000000000..3ce4f07e7539 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/OperationStatusOperationProgressImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceVersion; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationStatusOperationProgress. + */ +public final class OperationStatusOperationProgressImpl { + /** + * The proxy service used to perform REST calls. + */ + private final OperationStatusOperationProgressService service; + + /** + * The service client containing this operation class. + */ + private final CopilotServiceClientImpl client; + + /** + * Initializes an instance of OperationStatusOperationProgressImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationStatusOperationProgressImpl(CopilotServiceClientImpl client) { + this.service = RestProxy.create(OperationStatusOperationProgressService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public CopilotServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for CopilotServiceClientOperationStatusOperationProgress to be used by + * the proxy service to perform REST calls. + */ + @Host("https://mds-{mdsUniqueId}.{location}.cloudapp.azure.com/") + @ServiceInterface(name = "CopilotServiceClient") + public interface OperationStatusOperationProgressService { + @Get("/copilot/operation/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOperationResult(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/copilot/operation/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getOperationResultSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + } + + /** + * Get operation progress. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     operationId: String (Required)
+     *     errorMessage (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param operationId The operation id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return operation progress along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationResultWithResponseAsync(String operationId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getOperationResult(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), operationId, accept, requestOptions, context)); + } + + /** + * Get operation progress. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(Accepted/InProgress/TransientFailure/Succeeded/Failed/Deleting/Canceled/Unknown/Skipped) (Required)
+     *     operationId: String (Required)
+     *     errorMessage (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param operationId The operation id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return operation progress along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationResultWithResponse(String operationId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getOperationResultSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), operationId, accept, requestOptions, Context.NONE); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/PollingUtils.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/PollingUtils.java new file mode 100644 index 000000000000..b39e3d9666ce --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/PollingUtils.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.util.BinaryData; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.DateTimeRfc1123; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.net.URI; +import java.net.URISyntaxException; +import java.time.DateTimeException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; +import java.util.Map; +import java.util.function.Function; +import java.util.function.Supplier; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +final class PollingUtils { + + public static final TypeReference> POST_POLL_RESULT_TYPE_REFERENCE + = new TypeReference>() { + }; + + public static final HttpHeaderName OPERATION_LOCATION_HEADER = HttpHeaderName.fromString("Operation-Location"); + + public static final String HTTP_METHOD = "httpMethod"; + public static final String REQUEST_URL = "requestURL"; + public static final String POLL_RESPONSE_BODY = "pollResponseBody"; + + private static final String FORWARD_SLASH = "/"; + + public static String getAbsolutePath(String path, String endpoint, ClientLogger logger) { + try { + URI uri = new URI(path); + if (!uri.isAbsolute()) { + if (CoreUtils.isNullOrEmpty(endpoint)) { + throw logger.logExceptionAsError(new IllegalArgumentException( + "Relative path requires endpoint to be non-null and non-empty to create an absolute path.")); + } + + if (endpoint.endsWith(FORWARD_SLASH) && path.startsWith(FORWARD_SLASH)) { + return endpoint + path.substring(1); + } else if (!endpoint.endsWith(FORWARD_SLASH) && !path.startsWith(FORWARD_SLASH)) { + return endpoint + FORWARD_SLASH + path; + } else { + return endpoint + path; + } + } + } catch (URISyntaxException ex) { + throw logger.logExceptionAsWarning(new IllegalArgumentException("'path' must be a valid URI.", ex)); + } + return path; + } + + public static T deserializeResponseSync(BinaryData binaryData, ObjectSerializer serializer, + TypeReference typeReference) { + T value; + if (binaryData == null) { + value = null; + } else if (typeReference.getJavaClass().isAssignableFrom(BinaryData.class)) { + // T is BinaryData + value = typeReference.getJavaClass().cast(binaryData.toReplayableBinaryData()); + } else { + value = binaryData.toObject(typeReference, serializer); + } + return value; + } + + @SuppressWarnings("unchecked") + public static Mono deserializeResponse(BinaryData binaryData, ObjectSerializer serializer, + TypeReference typeReference) { + Mono value; + if (binaryData == null) { + value = Mono.empty(); + } else if (typeReference.getJavaClass().isAssignableFrom(BinaryData.class)) { + // T is BinaryData + value = (Mono) binaryData.toReplayableBinaryDataAsync(); + } else { + value = binaryData.toObjectAsync(typeReference, serializer); + } + return value; + } + + private static final HttpHeaderName RETRY_AFTER_MS_HEADER = HttpHeaderName.fromString("retry-after-ms"); + private static final HttpHeaderName X_MS_RETRY_AFTER_MS_HEADER = HttpHeaderName.fromString("x-ms-retry-after-ms"); + + public static Duration getRetryAfterFromHeaders(HttpHeaders headers, Supplier nowSupplier) { + // Found 'x-ms-retry-after-ms' header, use a Duration of milliseconds based on the value. + Duration retryDelay = tryGetRetryDelay(headers, X_MS_RETRY_AFTER_MS_HEADER, s -> tryGetDelayMillis(s)); + if (retryDelay != null) { + return retryDelay; + } + + // Found 'retry-after-ms' header, use a Duration of milliseconds based on the value. + retryDelay = tryGetRetryDelay(headers, RETRY_AFTER_MS_HEADER, s -> tryGetDelayMillis(s)); + if (retryDelay != null) { + return retryDelay; + } + + // Found 'Retry-After' header. First, attempt to resolve it as a Duration of seconds. If that fails, then + // attempt to resolve it as an HTTP date (RFC1123). + retryDelay = tryGetRetryDelay(headers, HttpHeaderName.RETRY_AFTER, + headerValue -> tryParseLongOrDateTime(headerValue, nowSupplier)); + + // Either the retry delay will have been found or it'll be null, null indicates no retry after. + return retryDelay; + } + + private static Duration tryGetRetryDelay(HttpHeaders headers, HttpHeaderName headerName, + Function delayParser) { + String headerValue = headers.getValue(headerName); + + return CoreUtils.isNullOrEmpty(headerValue) ? null : delayParser.apply(headerValue); + } + + private static Duration tryParseLongOrDateTime(String value, Supplier nowSupplier) { + long delaySeconds; + try { + OffsetDateTime retryAfter = new DateTimeRfc1123(value).getDateTime(); + + delaySeconds = nowSupplier.get().until(retryAfter, ChronoUnit.SECONDS); + } catch (DateTimeException ex) { + delaySeconds = tryParseLong(value); + } + + return (delaySeconds >= 0) ? Duration.ofSeconds(delaySeconds) : null; + } + + private static long tryParseLong(String value) { + try { + return Long.parseLong(value); + } catch (NumberFormatException ex) { + return -1; + } + } + + private static Duration tryGetDelayMillis(String value) { + long delayMillis = tryParseLong(value); + return (delayMillis >= 0) ? Duration.ofMillis(delayMillis) : null; + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/QueryServiceQueryApisImpl.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/QueryServiceQueryApisImpl.java new file mode 100644 index 000000000000..9bc50813212b --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/QueryServiceQueryApisImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceVersion; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QueryServiceQueryApis. + */ +public final class QueryServiceQueryApisImpl { + /** + * The proxy service used to perform REST calls. + */ + private final QueryServiceQueryApisService service; + + /** + * The service client containing this operation class. + */ + private final CopilotServiceClientImpl client; + + /** + * Initializes an instance of QueryServiceQueryApisImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueryServiceQueryApisImpl(CopilotServiceClientImpl client) { + this.service = RestProxy.create(QueryServiceQueryApisService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public CopilotServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for CopilotServiceClientQueryServiceQueryApis to be used by the proxy + * service to perform REST calls. + */ + @Host("https://mds-{mdsUniqueId}.{location}.cloudapp.azure.com/") + @ServiceInterface(name = "CopilotServiceClient") + public interface QueryServiceQueryApisService { + @Post("/copilot/query:execute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> execute(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept-Language") String acceptLanguage, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData executeRequest1, + RequestOptions requestOptions, Context context); + + @Post("/copilot/query:execute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response executeSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept-Language") String acceptLanguage, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData executeRequest1, + RequestOptions requestOptions, Context context); + } + + /** + * execute the query. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxRetryIntegerNomaxRetry
includeSummaryBooleanNoInclude summary in the response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Conversation-IdStringNoConversation-Id header
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ask: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     result: String (Optional)
+     *     summary: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param acceptLanguage Accept-Language header. + * @param executeRequest1 The executeRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return query Response Result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> executeWithResponseAsync(String acceptLanguage, BinaryData executeRequest1, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.execute(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), acceptLanguage, contentType, accept, executeRequest1, + requestOptions, context)); + } + + /** + * execute the query. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxRetryIntegerNomaxRetry
includeSummaryBooleanNoInclude summary in the response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Conversation-IdStringNoConversation-Id header
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ask: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     result: String (Optional)
+     *     summary: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param acceptLanguage Accept-Language header. + * @param executeRequest1 The executeRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return query Response Result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response executeWithResponse(String acceptLanguage, BinaryData executeRequest1, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.executeSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), acceptLanguage, contentType, accept, executeRequest1, + requestOptions, Context.NONE); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/SyncOperationLocationPollingStrategy.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/SyncOperationLocationPollingStrategy.java new file mode 100644 index 000000000000..67b7d816928a --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/SyncOperationLocationPollingStrategy.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.exception.AzureException; +import com.azure.core.http.HttpHeader; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.PollingContext; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncOperationResourcePollingStrategy; +import com.azure.core.util.serializer.JsonSerializerProviders; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.io.UncheckedIOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Map; + +// DO NOT modify this helper class + +/** + * Implements a synchronous operation location polling strategy, from Operation-Location. + * + * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept + * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be + * kept + */ +public final class SyncOperationLocationPollingStrategy extends SyncOperationResourcePollingStrategy { + + private static final ClientLogger LOGGER = new ClientLogger(SyncOperationLocationPollingStrategy.class); + + private final ObjectSerializer serializer; + private final String endpoint; + private final String propertyName; + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) { + this(pollingStrategyOptions, null); + } + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @param propertyName the name of the property to extract final result. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); + this.propertyName = propertyName; + this.endpoint = pollingStrategyOptions.getEndpoint(); + this.serializer = pollingStrategyOptions.getSerializer() != null + ? pollingStrategyOptions.getSerializer() + : JsonSerializerProviders.createInstance(true); + } + + /** + * {@inheritDoc} + */ + @Override + public PollResponse onInitialResponse(Response response, PollingContext pollingContext, + TypeReference pollResponseType) { + // Response is Response + + HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER); + if (operationLocationHeader != null) { + pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(), + PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER)); + } + final String httpMethod = response.getRequest().getHttpMethod().name(); + pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod); + pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString()); + + if (response.getStatusCode() == 200 + || response.getStatusCode() == 201 + || response.getStatusCode() == 202 + || response.getStatusCode() == 204) { + final Duration retryAfter + = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now); + T initialResponseType = null; + try { + initialResponseType = PollingUtils.deserializeResponseSync((BinaryData) response.getValue(), serializer, + pollResponseType); + } catch (UncheckedIOException e) { + LOGGER.info("Failed to parse initial response."); + } + return new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, initialResponseType, retryAfter); + } + + throw LOGGER.logExceptionAsError(new AzureException( + String.format("Operation failed or cancelled with status code %d, '%s' header: %s, and response body: %s", + response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader, + response.getValue()))); + } + + /** + * {@inheritDoc} + */ + public U getResult(PollingContext pollingContext, TypeReference resultType) { + if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) { + throw LOGGER.logExceptionAsError(new AzureException("Long running operation failed.")); + } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) { + throw LOGGER.logExceptionAsError(new AzureException("Long running operation cancelled.")); + } + if (propertyName != null) { + // take the last poll response body from PollingContext, + // and de-serialize the property as final result + BinaryData latestResponseBody + = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY)); + Map pollResult = PollingUtils.deserializeResponseSync(latestResponseBody, serializer, + PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE); + if (pollResult != null && pollResult.get(propertyName) != null) { + return PollingUtils.deserializeResponseSync(BinaryData.fromObject(pollResult.get(propertyName)), + serializer, resultType); + } else { + throw LOGGER.logExceptionAsError(new AzureException("Cannot get final result")); + } + } else { + return super.getResult(pollingContext, resultType); + } + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/ValidateQueryServiceValidateQueryApisImpl.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/ValidateQueryServiceValidateQueryApisImpl.java new file mode 100644 index 000000000000..b699d62557cb --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/ValidateQueryServiceValidateQueryApisImpl.java @@ -0,0 +1,576 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceVersion; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ValidateQueryServiceValidateQueryApis. + */ +public final class ValidateQueryServiceValidateQueryApisImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ValidateQueryServiceValidateQueryApisService service; + + /** + * The service client containing this operation class. + */ + private final CopilotServiceClientImpl client; + + /** + * Initializes an instance of ValidateQueryServiceValidateQueryApisImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidateQueryServiceValidateQueryApisImpl(CopilotServiceClientImpl client) { + this.service = RestProxy.create(ValidateQueryServiceValidateQueryApisService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public CopilotServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for CopilotServiceClientValidateQueryServiceValidateQueryApis to be used + * by the proxy service to perform REST calls. + */ + @Host("https://mds-{mdsUniqueId}.{location}.cloudapp.azure.com/") + @ServiceInterface(name = "CopilotServiceClient") + public interface ValidateQueryServiceValidateQueryApisService { + @Post("/copilot/validate:execute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> execute(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData executeRequest, RequestOptions requestOptions, Context context); + + @Post("/copilot/validate:execute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response executeSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData executeRequest, RequestOptions requestOptions, Context context); + + @Get("/copilot/validate/{validateTestId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getValidateTestDetails(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("validateTestId") String validateTestId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/copilot/validate/{validateTestId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getValidateTestDetailsSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("validateTestId") String validateTestId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/copilot/validate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listValidateTestRequests(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/copilot/validate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listValidateTestRequestsSync(@HostParam("mdsUniqueId") String mdsUniqueId, + @HostParam("location") String location, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listValidateTestRequestsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listValidateTestRequestsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("mdsUniqueId") String mdsUniqueId, @HostParam("location") String location, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Validate a query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testName: String (Required)
+     *     testCases (Required): [
+     *          (Required){
+     *             naturalLanguage: String (Optional)
+     *             expectedQuery: String (Optional)
+     *             expectedEntities: String (Optional)
+     *         }
+     *     ]
+     *     runInConversationContext: boolean (Required)
+     *     conversationId: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Required)
+     *     testRunStatus: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param executeRequest The executeRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> executeWithResponseAsync(BinaryData executeRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.execute(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, executeRequest, requestOptions, + context)); + } + + /** + * Validate a query. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testName: String (Required)
+     *     testCases (Required): [
+     *          (Required){
+     *             naturalLanguage: String (Optional)
+     *             expectedQuery: String (Optional)
+     *             expectedEntities: String (Optional)
+     *         }
+     *     ]
+     *     runInConversationContext: boolean (Required)
+     *     conversationId: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Required)
+     *     testRunStatus: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param executeRequest The executeRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response executeWithResponse(BinaryData executeRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.executeSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), contentType, accept, executeRequest, requestOptions, + Context.NONE); + } + + /** + * Get the details of a validate test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     validateTestId: String (Required)
+     *     fromDate: OffsetDateTime (Optional)
+     *     toDate: OffsetDateTime (Optional)
+     * }
+     * }
+     * 
+ * + * @param validateTestId The unique identifier of the test query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a validate test along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getValidateTestDetailsWithResponseAsync(String validateTestId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getValidateTestDetails(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), validateTestId, accept, requestOptions, context)); + } + + /** + * Get the details of a validate test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     validateTestId: String (Required)
+     *     fromDate: OffsetDateTime (Optional)
+     *     toDate: OffsetDateTime (Optional)
+     * }
+     * }
+     * 
+ * + * @param validateTestId The unique identifier of the test query. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the details of a validate test along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getValidateTestDetailsWithResponse(String validateTestId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getValidateTestDetailsSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), validateTestId, accept, requestOptions, Context.NONE); + } + + /** + * List validate test requests. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fromDateOffsetDateTimeNostart date
endDateOffsetDateTimeNoend date
testRunIdOffsetDateTimeNostart date
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Required)
+     *     createdTime: String (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ValidateTestSummary items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listValidateTestRequestsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listValidateTestRequests(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List validate test requests. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fromDateOffsetDateTimeNostart date
endDateOffsetDateTimeNoend date
testRunIdOffsetDateTimeNostart date
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Required)
+     *     createdTime: String (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ValidateTestSummary items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listValidateTestRequestsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listValidateTestRequestsSinglePageAsync(requestOptions), + nextLink -> listValidateTestRequestsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * List validate test requests. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fromDateOffsetDateTimeNostart date
endDateOffsetDateTimeNoend date
testRunIdOffsetDateTimeNostart date
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Required)
+     *     createdTime: String (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ValidateTestSummary items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listValidateTestRequestsSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res + = service.listValidateTestRequestsSync(this.client.getMdsUniqueId(), this.client.getLocation(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * List validate test requests. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fromDateOffsetDateTimeNostart date
endDateOffsetDateTimeNoend date
testRunIdOffsetDateTimeNostart date
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Required)
+     *     createdTime: String (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ValidateTestSummary items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listValidateTestRequests(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listValidateTestRequestsSinglePage(requestOptions), + nextLink -> listValidateTestRequestsNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Required)
+     *     createdTime: String (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ValidateTestSummary items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listValidateTestRequestsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listValidateTestRequestsNext(nextLink, this.client.getMdsUniqueId(), + this.client.getLocation(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Required)
+     *     createdTime: String (Required)
+     *     createdBy: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ValidateTestSummary items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listValidateTestRequestsNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listValidateTestRequestsNextSync(nextLink, this.client.getMdsUniqueId(), + this.client.getLocation(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ActivateRequest.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ActivateRequest.java new file mode 100644 index 000000000000..29edbf3f3527 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ActivateRequest.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ActivateRequest model. + */ +@Immutable +public final class ActivateRequest implements JsonSerializable { + /* + * status of the alias + */ + @Generated + private final boolean enabled; + + /** + * Creates an instance of ActivateRequest class. + * + * @param enabled the enabled value to set. + */ + @Generated + public ActivateRequest(boolean enabled) { + this.enabled = enabled; + } + + /** + * Get the enabled property: status of the alias. + * + * @return the enabled value. + */ + @Generated + public boolean isEnabled() { + return this.enabled; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivateRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ActivateRequest. + */ + @Generated + public static ActivateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean enabled = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + enabled = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + return new ActivateRequest(enabled); + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ExecuteRequest.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ExecuteRequest.java new file mode 100644 index 000000000000..a705dafefe3b --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ExecuteRequest.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotTestCase; +import java.io.IOException; +import java.util.List; + +/** + * The ExecuteRequest model. + */ +@Fluent +public final class ExecuteRequest implements JsonSerializable { + /* + * The name of the test query. + */ + @Generated + private final String testName; + + /* + * The test cases for the query. + */ + @Generated + private final List testCases; + + /* + * The run in conversation context. + */ + @Generated + private final boolean runInConversationContext; + + /* + * coversation Id + */ + @Generated + private String conversationId; + + /** + * Creates an instance of ExecuteRequest class. + * + * @param testName the testName value to set. + * @param testCases the testCases value to set. + * @param runInConversationContext the runInConversationContext value to set. + */ + @Generated + public ExecuteRequest(String testName, List testCases, boolean runInConversationContext) { + this.testName = testName; + this.testCases = testCases; + this.runInConversationContext = runInConversationContext; + } + + /** + * Get the testName property: The name of the test query. + * + * @return the testName value. + */ + @Generated + public String getTestName() { + return this.testName; + } + + /** + * Get the testCases property: The test cases for the query. + * + * @return the testCases value. + */ + @Generated + public List getTestCases() { + return this.testCases; + } + + /** + * Get the runInConversationContext property: The run in conversation context. + * + * @return the runInConversationContext value. + */ + @Generated + public boolean isRunInConversationContext() { + return this.runInConversationContext; + } + + /** + * Get the conversationId property: coversation Id. + * + * @return the conversationId value. + */ + @Generated + public String getConversationId() { + return this.conversationId; + } + + /** + * Set the conversationId property: coversation Id. + * + * @param conversationId the conversationId value to set. + * @return the ExecuteRequest object itself. + */ + @Generated + public ExecuteRequest setConversationId(String conversationId) { + this.conversationId = conversationId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("testName", this.testName); + jsonWriter.writeArrayField("testCases", this.testCases, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("runInConversationContext", this.runInConversationContext); + jsonWriter.writeStringField("conversationId", this.conversationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExecuteRequest. + */ + @Generated + public static ExecuteRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String testName = null; + List testCases = null; + boolean runInConversationContext = false; + String conversationId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testName".equals(fieldName)) { + testName = reader.getString(); + } else if ("testCases".equals(fieldName)) { + testCases = reader.readArray(reader1 -> CopilotTestCase.fromJson(reader1)); + } else if ("runInConversationContext".equals(fieldName)) { + runInConversationContext = reader.getBoolean(); + } else if ("conversationId".equals(fieldName)) { + conversationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + ExecuteRequest deserializedExecuteRequest + = new ExecuteRequest(testName, testCases, runInConversationContext); + deserializedExecuteRequest.conversationId = conversationId; + + return deserializedExecuteRequest; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ExecuteRequest1.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ExecuteRequest1.java new file mode 100644 index 000000000000..a7ce82376516 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/ExecuteRequest1.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ExecuteRequest1 model. + */ +@Fluent +public final class ExecuteRequest1 implements JsonSerializable { + /* + * Natural language query + */ + @Generated + private String ask; + + /** + * Creates an instance of ExecuteRequest1 class. + */ + @Generated + public ExecuteRequest1() { + } + + /** + * Get the ask property: Natural language query. + * + * @return the ask value. + */ + @Generated + public String getAsk() { + return this.ask; + } + + /** + * Set the ask property: Natural language query. + * + * @param ask the ask value to set. + * @return the ExecuteRequest1 object itself. + */ + @Generated + public ExecuteRequest1 setAsk(String ask) { + this.ask = ask; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ask", this.ask); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteRequest1 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteRequest1 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExecuteRequest1. + */ + @Generated + public static ExecuteRequest1 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteRequest1 deserializedExecuteRequest1 = new ExecuteRequest1(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ask".equals(fieldName)) { + deserializedExecuteRequest1.ask = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteRequest1; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/LinkInstructionRequest.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/LinkInstructionRequest.java new file mode 100644 index 000000000000..c03f6675af93 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/LinkInstructionRequest.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The LinkInstructionRequest model. + */ +@Fluent +public final class LinkInstructionRequest implements JsonSerializable { + /* + * The linked instructions for the example query. + */ + @Generated + private List linkedInstructions; + + /** + * Creates an instance of LinkInstructionRequest class. + */ + @Generated + public LinkInstructionRequest() { + } + + /** + * Get the linkedInstructions property: The linked instructions for the example query. + * + * @return the linkedInstructions value. + */ + @Generated + public List getLinkedInstructions() { + return this.linkedInstructions; + } + + /** + * Set the linkedInstructions property: The linked instructions for the example query. + * + * @param linkedInstructions the linkedInstructions value to set. + * @return the LinkInstructionRequest object itself. + */ + @Generated + public LinkInstructionRequest setLinkedInstructions(List linkedInstructions) { + this.linkedInstructions = linkedInstructions; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("linkedInstructions", this.linkedInstructions, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinkInstructionRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinkInstructionRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LinkInstructionRequest. + */ + @Generated + public static LinkInstructionRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinkInstructionRequest deserializedLinkInstructionRequest = new LinkInstructionRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("linkedInstructions".equals(fieldName)) { + List linkedInstructions = reader.readArray(reader1 -> reader1.getString()); + deserializedLinkInstructionRequest.linkedInstructions = linkedInstructions; + } else { + reader.skipChildren(); + } + } + + return deserializedLinkInstructionRequest; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/UpdateStatusRequest.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/UpdateStatusRequest.java new file mode 100644 index 000000000000..2213e12215a5 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/UpdateStatusRequest.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionStatusEnum; +import java.io.IOException; + +/** + * The UpdateStatusRequest model. + */ +@Immutable +public final class UpdateStatusRequest implements JsonSerializable { + /* + * status of the instruction + */ + @Generated + private final InstructionStatusEnum status; + + /** + * Creates an instance of UpdateStatusRequest class. + * + * @param status the status value to set. + */ + @Generated + public UpdateStatusRequest(InstructionStatusEnum status) { + this.status = status; + } + + /** + * Get the status property: status of the instruction. + * + * @return the status value. + */ + @Generated + public InstructionStatusEnum getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateStatusRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateStatusRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateStatusRequest. + */ + @Generated + public static UpdateStatusRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstructionStatusEnum status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + status = InstructionStatusEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new UpdateStatusRequest(status); + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/package-info.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/package-info.java new file mode 100644 index 000000000000..9bc4d998c18c --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for CopilotService. + */ +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models; diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/package-info.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/package-info.java new file mode 100644 index 000000000000..e812211e331e --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/implementation/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for CopilotService. + */ +package com.azure.microsoft.industry.manufacturing.mds.copilot.implementation; diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ActivateAlias.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ActivateAlias.java new file mode 100644 index 000000000000..80dc55cae04f --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ActivateAlias.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * This is the patch request to update the status of Alias. + */ +@Immutable +public final class ActivateAlias implements JsonSerializable { + /* + * status of the alias + */ + @Generated + private final boolean enabled; + + /** + * Creates an instance of ActivateAlias class. + * + * @param enabled the enabled value to set. + */ + @Generated + private ActivateAlias(boolean enabled) { + this.enabled = enabled; + } + + /** + * Get the enabled property: status of the alias. + * + * @return the enabled value. + */ + @Generated + public boolean isEnabled() { + return this.enabled; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivateAlias from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivateAlias if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ActivateAlias. + */ + @Generated + public static ActivateAlias fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean enabled = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + enabled = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + return new ActivateAlias(enabled); + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Alias.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Alias.java new file mode 100644 index 000000000000..3d26f318e582 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Alias.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * This is the request model for Alias. + */ +@Immutable +public final class Alias implements JsonSerializable { + /* + * Id for the alias + */ + @Generated + private String id; + + /* + * Key for the alias + */ + @Generated + private final String name; + + /* + * List of aliases + */ + @Generated + private final List aliases; + + /* + * Indicates if the alias is enabled + */ + @Generated + private boolean isCustom; + + /* + * Indicates if the alias is enabled + */ + @Generated + private boolean enabled; + + /** + * Creates an instance of Alias class. + * + * @param name the name value to set. + * @param aliases the aliases value to set. + */ + @Generated + public Alias(String name, List aliases) { + this.name = name; + this.aliases = aliases; + } + + /** + * Get the id property: Id for the alias. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: Key for the alias. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the aliases property: List of aliases. + * + * @return the aliases value. + */ + @Generated + public List getAliases() { + return this.aliases; + } + + /** + * Get the isCustom property: Indicates if the alias is enabled. + * + * @return the isCustom value. + */ + @Generated + public boolean isCustom() { + return this.isCustom; + } + + /** + * Get the enabled property: Indicates if the alias is enabled. + * + * @return the enabled value. + */ + @Generated + public boolean isEnabled() { + return this.enabled; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("aliases", this.aliases, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Alias from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Alias if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Alias. + */ + @Generated + public static Alias fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + List aliases = null; + boolean isCustom = false; + boolean enabled = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("aliases".equals(fieldName)) { + aliases = reader.readArray(reader1 -> reader1.getString()); + } else if ("isCustom".equals(fieldName)) { + isCustom = reader.getBoolean(); + } else if ("enabled".equals(fieldName)) { + enabled = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + Alias deserializedAlias = new Alias(name, aliases); + deserializedAlias.id = id; + deserializedAlias.isCustom = isCustom; + deserializedAlias.enabled = enabled; + + return deserializedAlias; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotHealth.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotHealth.java new file mode 100644 index 000000000000..f2eb19aa265a --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotHealth.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Copilot Health Response. + */ +@Immutable +public final class CopilotHealth implements JsonSerializable { + /* + * The message. + */ + @Generated + private final String message; + + /* + * The operation status. + */ + @Generated + private final OperationStatusValue operationStatus; + + /* + * copilot setup info + */ + @Generated + private final CopilotSetupInfo copilotSetupInfo; + + /* + * The error message. + */ + @Generated + private final List errorMessage; + + /** + * Creates an instance of CopilotHealth class. + * + * @param message the message value to set. + * @param operationStatus the operationStatus value to set. + * @param copilotSetupInfo the copilotSetupInfo value to set. + * @param errorMessage the errorMessage value to set. + */ + @Generated + private CopilotHealth(String message, OperationStatusValue operationStatus, CopilotSetupInfo copilotSetupInfo, + List errorMessage) { + this.message = message; + this.operationStatus = operationStatus; + this.copilotSetupInfo = copilotSetupInfo; + this.errorMessage = errorMessage; + } + + /** + * Get the message property: The message. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the operationStatus property: The operation status. + * + * @return the operationStatus value. + */ + @Generated + public OperationStatusValue getOperationStatus() { + return this.operationStatus; + } + + /** + * Get the copilotSetupInfo property: copilot setup info. + * + * @return the copilotSetupInfo value. + */ + @Generated + public CopilotSetupInfo getCopilotSetupInfo() { + return this.copilotSetupInfo; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + @Generated + public List getErrorMessage() { + return this.errorMessage; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("operationStatus", + this.operationStatus == null ? null : this.operationStatus.toString()); + jsonWriter.writeJsonField("copilotSetupInfo", this.copilotSetupInfo); + jsonWriter.writeArrayField("errorMessage", this.errorMessage, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopilotHealth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopilotHealth if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CopilotHealth. + */ + @Generated + public static CopilotHealth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String message = null; + OperationStatusValue operationStatus = null; + CopilotSetupInfo copilotSetupInfo = null; + List errorMessage = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("message".equals(fieldName)) { + message = reader.getString(); + } else if ("operationStatus".equals(fieldName)) { + operationStatus = OperationStatusValue.fromString(reader.getString()); + } else if ("copilotSetupInfo".equals(fieldName)) { + copilotSetupInfo = CopilotSetupInfo.fromJson(reader); + } else if ("errorMessage".equals(fieldName)) { + errorMessage = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new CopilotHealth(message, operationStatus, copilotSetupInfo, errorMessage); + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotSetupInfo.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotSetupInfo.java new file mode 100644 index 000000000000..e563e80c1dbd --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotSetupInfo.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Copilot Setup Info. + */ +@Immutable +public final class CopilotSetupInfo implements JsonSerializable { + /* + * create ADX function job status + */ + @Generated + private final OperationStatusValue createAzureDataExplorerFunctionJobStatus; + + /* + * register in built instruction job status + */ + @Generated + private final OperationStatusValue registerInBuiltInstructionJobStatus; + + /* + * register in built example query job status + */ + @Generated + private final OperationStatusValue registerInbuiltExampleQueryJobStatus; + + /* + * register in built example query job status + */ + @Generated + private final OperationStatusValue registerInBuiltAliasJobStatus; + + /* + * register in built example query job status + */ + @Generated + private final OperationStatusValue registerAssistantViewJobStatus; + + /** + * Creates an instance of CopilotSetupInfo class. + * + * @param createAzureDataExplorerFunctionJobStatus the createAzureDataExplorerFunctionJobStatus value to set. + * @param registerInBuiltInstructionJobStatus the registerInBuiltInstructionJobStatus value to set. + * @param registerInbuiltExampleQueryJobStatus the registerInbuiltExampleQueryJobStatus value to set. + * @param registerInBuiltAliasJobStatus the registerInBuiltAliasJobStatus value to set. + * @param registerAssistantViewJobStatus the registerAssistantViewJobStatus value to set. + */ + @Generated + private CopilotSetupInfo(OperationStatusValue createAzureDataExplorerFunctionJobStatus, + OperationStatusValue registerInBuiltInstructionJobStatus, + OperationStatusValue registerInbuiltExampleQueryJobStatus, OperationStatusValue registerInBuiltAliasJobStatus, + OperationStatusValue registerAssistantViewJobStatus) { + this.createAzureDataExplorerFunctionJobStatus = createAzureDataExplorerFunctionJobStatus; + this.registerInBuiltInstructionJobStatus = registerInBuiltInstructionJobStatus; + this.registerInbuiltExampleQueryJobStatus = registerInbuiltExampleQueryJobStatus; + this.registerInBuiltAliasJobStatus = registerInBuiltAliasJobStatus; + this.registerAssistantViewJobStatus = registerAssistantViewJobStatus; + } + + /** + * Get the createAzureDataExplorerFunctionJobStatus property: create ADX function job status. + * + * @return the createAzureDataExplorerFunctionJobStatus value. + */ + @Generated + public OperationStatusValue getCreateAzureDataExplorerFunctionJobStatus() { + return this.createAzureDataExplorerFunctionJobStatus; + } + + /** + * Get the registerInBuiltInstructionJobStatus property: register in built instruction job status. + * + * @return the registerInBuiltInstructionJobStatus value. + */ + @Generated + public OperationStatusValue getRegisterInBuiltInstructionJobStatus() { + return this.registerInBuiltInstructionJobStatus; + } + + /** + * Get the registerInbuiltExampleQueryJobStatus property: register in built example query job status. + * + * @return the registerInbuiltExampleQueryJobStatus value. + */ + @Generated + public OperationStatusValue getRegisterInbuiltExampleQueryJobStatus() { + return this.registerInbuiltExampleQueryJobStatus; + } + + /** + * Get the registerInBuiltAliasJobStatus property: register in built example query job status. + * + * @return the registerInBuiltAliasJobStatus value. + */ + @Generated + public OperationStatusValue getRegisterInBuiltAliasJobStatus() { + return this.registerInBuiltAliasJobStatus; + } + + /** + * Get the registerAssistantViewJobStatus property: register in built example query job status. + * + * @return the registerAssistantViewJobStatus value. + */ + @Generated + public OperationStatusValue getRegisterAssistantViewJobStatus() { + return this.registerAssistantViewJobStatus; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createAzureDataExplorerFunctionJobStatus", + this.createAzureDataExplorerFunctionJobStatus == null + ? null + : this.createAzureDataExplorerFunctionJobStatus.toString()); + jsonWriter.writeStringField("registerInBuiltInstructionJobStatus", + this.registerInBuiltInstructionJobStatus == null + ? null + : this.registerInBuiltInstructionJobStatus.toString()); + jsonWriter.writeStringField("registerInbuiltExampleQueryJobStatus", + this.registerInbuiltExampleQueryJobStatus == null + ? null + : this.registerInbuiltExampleQueryJobStatus.toString()); + jsonWriter.writeStringField("registerInBuiltAliasJobStatus", + this.registerInBuiltAliasJobStatus == null ? null : this.registerInBuiltAliasJobStatus.toString()); + jsonWriter.writeStringField("registerAssistantViewJobStatus", + this.registerAssistantViewJobStatus == null ? null : this.registerAssistantViewJobStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopilotSetupInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopilotSetupInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CopilotSetupInfo. + */ + @Generated + public static CopilotSetupInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusValue createAzureDataExplorerFunctionJobStatus = null; + OperationStatusValue registerInBuiltInstructionJobStatus = null; + OperationStatusValue registerInbuiltExampleQueryJobStatus = null; + OperationStatusValue registerInBuiltAliasJobStatus = null; + OperationStatusValue registerAssistantViewJobStatus = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createAzureDataExplorerFunctionJobStatus".equals(fieldName)) { + createAzureDataExplorerFunctionJobStatus = OperationStatusValue.fromString(reader.getString()); + } else if ("registerInBuiltInstructionJobStatus".equals(fieldName)) { + registerInBuiltInstructionJobStatus = OperationStatusValue.fromString(reader.getString()); + } else if ("registerInbuiltExampleQueryJobStatus".equals(fieldName)) { + registerInbuiltExampleQueryJobStatus = OperationStatusValue.fromString(reader.getString()); + } else if ("registerInBuiltAliasJobStatus".equals(fieldName)) { + registerInBuiltAliasJobStatus = OperationStatusValue.fromString(reader.getString()); + } else if ("registerAssistantViewJobStatus".equals(fieldName)) { + registerAssistantViewJobStatus = OperationStatusValue.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new CopilotSetupInfo(createAzureDataExplorerFunctionJobStatus, registerInBuiltInstructionJobStatus, + registerInbuiltExampleQueryJobStatus, registerInBuiltAliasJobStatus, registerAssistantViewJobStatus); + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotTestCase.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotTestCase.java new file mode 100644 index 000000000000..b97a3b462864 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/CopilotTestCase.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Test Case for Test run. + */ +@Fluent +public final class CopilotTestCase implements JsonSerializable { + /* + * The natural language input for the test case. + */ + @Generated + private String naturalLanguage; + + /* + * The expected query for the test case. + */ + @Generated + private String expectedQuery; + + /* + * The expected entities for the test case. + */ + @Generated + private String expectedEntities; + + /** + * Creates an instance of CopilotTestCase class. + */ + @Generated + public CopilotTestCase() { + } + + /** + * Get the naturalLanguage property: The natural language input for the test case. + * + * @return the naturalLanguage value. + */ + @Generated + public String getNaturalLanguage() { + return this.naturalLanguage; + } + + /** + * Set the naturalLanguage property: The natural language input for the test case. + * + * @param naturalLanguage the naturalLanguage value to set. + * @return the CopilotTestCase object itself. + */ + @Generated + public CopilotTestCase setNaturalLanguage(String naturalLanguage) { + this.naturalLanguage = naturalLanguage; + return this; + } + + /** + * Get the expectedQuery property: The expected query for the test case. + * + * @return the expectedQuery value. + */ + @Generated + public String getExpectedQuery() { + return this.expectedQuery; + } + + /** + * Set the expectedQuery property: The expected query for the test case. + * + * @param expectedQuery the expectedQuery value to set. + * @return the CopilotTestCase object itself. + */ + @Generated + public CopilotTestCase setExpectedQuery(String expectedQuery) { + this.expectedQuery = expectedQuery; + return this; + } + + /** + * Get the expectedEntities property: The expected entities for the test case. + * + * @return the expectedEntities value. + */ + @Generated + public String getExpectedEntities() { + return this.expectedEntities; + } + + /** + * Set the expectedEntities property: The expected entities for the test case. + * + * @param expectedEntities the expectedEntities value to set. + * @return the CopilotTestCase object itself. + */ + @Generated + public CopilotTestCase setExpectedEntities(String expectedEntities) { + this.expectedEntities = expectedEntities; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("naturalLanguage", this.naturalLanguage); + jsonWriter.writeStringField("expectedQuery", this.expectedQuery); + jsonWriter.writeStringField("expectedEntities", this.expectedEntities); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopilotTestCase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopilotTestCase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CopilotTestCase. + */ + @Generated + public static CopilotTestCase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CopilotTestCase deserializedCopilotTestCase = new CopilotTestCase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("naturalLanguage".equals(fieldName)) { + deserializedCopilotTestCase.naturalLanguage = reader.getString(); + } else if ("expectedQuery".equals(fieldName)) { + deserializedCopilotTestCase.expectedQuery = reader.getString(); + } else if ("expectedEntities".equals(fieldName)) { + deserializedCopilotTestCase.expectedEntities = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCopilotTestCase; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ExampleQueryRequest.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ExampleQueryRequest.java new file mode 100644 index 000000000000..73fd9db53e71 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ExampleQueryRequest.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.JsonMergePatchHelper; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * The example query resource. + */ +@Fluent +public final class ExampleQueryRequest implements JsonSerializable { + /* + * The ID of the example query. + */ + @Generated + private String exampleId; + + /* + * The user question associated with the example. + */ + @Generated + private String userQuestion; + + /* + * The linked instructions for the example query. + */ + @Generated + private List linkedInstructions; + + /* + * The sample query for the example. + */ + @Generated + private SampleQuery sampleQuery; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setExampleQueryRequestAccessor(new JsonMergePatchHelper.ExampleQueryRequestAccessor() { + @Override + public ExampleQueryRequest prepareModelForJsonMergePatch(ExampleQueryRequest model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(ExampleQueryRequest model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of ExampleQueryRequest class. + */ + @Generated + public ExampleQueryRequest() { + } + + /** + * Get the exampleId property: The ID of the example query. + * + * @return the exampleId value. + */ + @Generated + public String getExampleId() { + return this.exampleId; + } + + /** + * Get the userQuestion property: The user question associated with the example. + * + * @return the userQuestion value. + */ + @Generated + public String getUserQuestion() { + return this.userQuestion; + } + + /** + * Set the userQuestion property: The user question associated with the example. + *

Required when create the resource.

+ * + * @param userQuestion the userQuestion value to set. + * @return the ExampleQueryRequest object itself. + */ + @Generated + public ExampleQueryRequest setUserQuestion(String userQuestion) { + this.userQuestion = userQuestion; + this.updatedProperties.add("userQuestion"); + return this; + } + + /** + * Get the linkedInstructions property: The linked instructions for the example query. + * + * @return the linkedInstructions value. + */ + @Generated + public List getLinkedInstructions() { + return this.linkedInstructions; + } + + /** + * Set the linkedInstructions property: The linked instructions for the example query. + *

Required when create the resource.

+ * + * @param linkedInstructions the linkedInstructions value to set. + * @return the ExampleQueryRequest object itself. + */ + @Generated + public ExampleQueryRequest setLinkedInstructions(List linkedInstructions) { + this.linkedInstructions = linkedInstructions; + this.updatedProperties.add("linkedInstructions"); + return this; + } + + /** + * Get the sampleQuery property: The sample query for the example. + * + * @return the sampleQuery value. + */ + @Generated + public SampleQuery getSampleQuery() { + return this.sampleQuery; + } + + /** + * Set the sampleQuery property: The sample query for the example. + *

Required when create the resource.

+ * + * @param sampleQuery the sampleQuery value to set. + * @return the ExampleQueryRequest object itself. + */ + @Generated + public ExampleQueryRequest setSampleQuery(SampleQuery sampleQuery) { + this.sampleQuery = sampleQuery; + this.updatedProperties.add("sampleQuery"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userQuestion", this.userQuestion); + jsonWriter.writeArrayField("linkedInstructions", this.linkedInstructions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sampleQuery", this.sampleQuery); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("userQuestion")) { + if (this.userQuestion == null) { + jsonWriter.writeNullField("userQuestion"); + } else { + jsonWriter.writeStringField("userQuestion", this.userQuestion); + } + } + if (updatedProperties.contains("linkedInstructions")) { + if (this.linkedInstructions == null) { + jsonWriter.writeNullField("linkedInstructions"); + } else { + jsonWriter.writeArrayField("linkedInstructions", this.linkedInstructions, + (writer, element) -> writer.writeString(element)); + } + } + if (updatedProperties.contains("sampleQuery")) { + if (this.sampleQuery == null) { + jsonWriter.writeNullField("sampleQuery"); + } else { + JsonMergePatchHelper.getSampleQueryAccessor().prepareModelForJsonMergePatch(this.sampleQuery, true); + jsonWriter.writeJsonField("sampleQuery", this.sampleQuery); + JsonMergePatchHelper.getSampleQueryAccessor().prepareModelForJsonMergePatch(this.sampleQuery, false); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExampleQueryRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExampleQueryRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExampleQueryRequest. + */ + @Generated + public static ExampleQueryRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExampleQueryRequest deserializedExampleQueryRequest = new ExampleQueryRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("exampleId".equals(fieldName)) { + deserializedExampleQueryRequest.exampleId = reader.getString(); + } else if ("userQuestion".equals(fieldName)) { + deserializedExampleQueryRequest.userQuestion = reader.getString(); + } else if ("linkedInstructions".equals(fieldName)) { + List linkedInstructions = reader.readArray(reader1 -> reader1.getString()); + deserializedExampleQueryRequest.linkedInstructions = linkedInstructions; + } else if ("sampleQuery".equals(fieldName)) { + deserializedExampleQueryRequest.sampleQuery = SampleQuery.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExampleQueryRequest; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/FeedbackCategory.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/FeedbackCategory.java new file mode 100644 index 000000000000..587cf78c43a3 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/FeedbackCategory.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Feedback category. + */ +public final class FeedbackCategory extends ExpandableStringEnum { + /** + * Neutral feedback. + */ + @Generated + public static final FeedbackCategory NEUTRAL = fromString("Neutral"); + + /** + * Positive feedback. + */ + @Generated + public static final FeedbackCategory THUMB_UP = fromString("ThumbUp"); + + /** + * Negative feedback. + */ + @Generated + public static final FeedbackCategory THUMB_DOWN = fromString("ThumbDown"); + + /** + * Creates a new instance of FeedbackCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FeedbackCategory() { + } + + /** + * Creates or finds a FeedbackCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeedbackCategory. + */ + @Generated + public static FeedbackCategory fromString(String name) { + return fromString(name, FeedbackCategory.class); + } + + /** + * Gets known FeedbackCategory values. + * + * @return known FeedbackCategory values. + */ + @Generated + public static Collection values() { + return values(FeedbackCategory.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/FeedbackRequest.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/FeedbackRequest.java new file mode 100644 index 000000000000..876c639d26c6 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/FeedbackRequest.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * feedbackRequest. + */ +@Immutable +public final class FeedbackRequest implements JsonSerializable { + /* + * The query id + */ + @Generated + private final String operationId; + + /* + * conversation id + */ + @Generated + private final String conversationId; + + /* + * The feedback + */ + @Generated + private FeedbackCategory feedback; + + /* + * QueryEndpoint + */ + @Generated + private final QueryEndpoint queryEndpoint; + + /** + * Creates an instance of FeedbackRequest class. + * + * @param operationId the operationId value to set. + * @param conversationId the conversationId value to set. + * @param queryEndpoint the queryEndpoint value to set. + */ + @Generated + public FeedbackRequest(String operationId, String conversationId, QueryEndpoint queryEndpoint) { + this.operationId = operationId; + this.conversationId = conversationId; + this.queryEndpoint = queryEndpoint; + } + + /** + * Get the operationId property: The query id. + * + * @return the operationId value. + */ + @Generated + public String getOperationId() { + return this.operationId; + } + + /** + * Get the conversationId property: conversation id. + * + * @return the conversationId value. + */ + @Generated + public String getConversationId() { + return this.conversationId; + } + + /** + * Get the feedback property: The feedback. + * + * @return the feedback value. + */ + @Generated + public FeedbackCategory getFeedback() { + return this.feedback; + } + + /** + * Get the queryEndpoint property: QueryEndpoint. + * + * @return the queryEndpoint value. + */ + @Generated + public QueryEndpoint getQueryEndpoint() { + return this.queryEndpoint; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("conversationId", this.conversationId); + jsonWriter.writeStringField("queryEndpoint", this.queryEndpoint == null ? null : this.queryEndpoint.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FeedbackRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FeedbackRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FeedbackRequest. + */ + @Generated + public static FeedbackRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String operationId = null; + String conversationId = null; + FeedbackCategory feedback = null; + QueryEndpoint queryEndpoint = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + operationId = reader.getString(); + } else if ("conversationId".equals(fieldName)) { + conversationId = reader.getString(); + } else if ("feedback".equals(fieldName)) { + feedback = FeedbackCategory.fromString(reader.getString()); + } else if ("queryEndpoint".equals(fieldName)) { + queryEndpoint = QueryEndpoint.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + FeedbackRequest deserializedFeedbackRequest + = new FeedbackRequest(operationId, conversationId, queryEndpoint); + deserializedFeedbackRequest.feedback = feedback; + + return deserializedFeedbackRequest; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/GetResponse.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/GetResponse.java new file mode 100644 index 000000000000..4aeea76f81cd --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/GetResponse.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The GetResponse model. + */ +@Immutable +public final class GetResponse implements JsonSerializable { + /* + * Id for the instruction + */ + @Generated + private String id; + + /* + * Status for the instruction + */ + @Generated + private InstructionStatusEnum status; + + /* + * Domain for the instruction + */ + @Generated + private InstrustionDomainEnum domain; + + /* + * Sub-domain for the instruction + */ + @Generated + private InstructionSubDomainEnum subDomain; + + /* + * Category for the instruction + */ + @Generated + private InstructionCategoryEnum category; + + /* + * The language of the instruction. + */ + @Generated + private final InstructionLanguageEnum language; + + /* + * The retrieval properties of the instruction. + */ + @Generated + private final RetrievalProperties retrieval; + + /* + * The relationships of the instruction. + */ + @Generated + private final Relationships relationships; + + /* + * The comment for the instruction. + */ + @Generated + private final String comment; + + /** + * Creates an instance of GetResponse class. + * + * @param language the language value to set. + * @param retrieval the retrieval value to set. + * @param relationships the relationships value to set. + * @param comment the comment value to set. + */ + @Generated + private GetResponse(InstructionLanguageEnum language, RetrievalProperties retrieval, Relationships relationships, + String comment) { + this.language = language; + this.retrieval = retrieval; + this.relationships = relationships; + this.comment = comment; + } + + /** + * Get the id property: Id for the instruction. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the status property: Status for the instruction. + * + * @return the status value. + */ + @Generated + public InstructionStatusEnum getStatus() { + return this.status; + } + + /** + * Get the domain property: Domain for the instruction. + * + * @return the domain value. + */ + @Generated + public InstrustionDomainEnum getDomain() { + return this.domain; + } + + /** + * Get the subDomain property: Sub-domain for the instruction. + * + * @return the subDomain value. + */ + @Generated + public InstructionSubDomainEnum getSubDomain() { + return this.subDomain; + } + + /** + * Get the category property: Category for the instruction. + * + * @return the category value. + */ + @Generated + public InstructionCategoryEnum getCategory() { + return this.category; + } + + /** + * Get the language property: The language of the instruction. + * + * @return the language value. + */ + @Generated + public InstructionLanguageEnum getLanguage() { + return this.language; + } + + /** + * Get the retrieval property: The retrieval properties of the instruction. + * + * @return the retrieval value. + */ + @Generated + public RetrievalProperties getRetrieval() { + return this.retrieval; + } + + /** + * Get the relationships property: The relationships of the instruction. + * + * @return the relationships value. + */ + @Generated + public Relationships getRelationships() { + return this.relationships; + } + + /** + * Get the comment property: The comment for the instruction. + * + * @return the comment value. + */ + @Generated + public String getComment() { + return this.comment; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("language", this.language == null ? null : this.language.toString()); + jsonWriter.writeJsonField("retrieval", this.retrieval); + jsonWriter.writeJsonField("relationships", this.relationships); + jsonWriter.writeStringField("comment", this.comment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GetResponse. + */ + @Generated + public static GetResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + InstructionStatusEnum status = null; + InstrustionDomainEnum domain = null; + InstructionSubDomainEnum subDomain = null; + InstructionCategoryEnum category = null; + InstructionLanguageEnum language = null; + RetrievalProperties retrieval = null; + Relationships relationships = null; + String comment = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = InstructionStatusEnum.fromString(reader.getString()); + } else if ("domain".equals(fieldName)) { + domain = InstrustionDomainEnum.fromString(reader.getString()); + } else if ("subDomain".equals(fieldName)) { + subDomain = InstructionSubDomainEnum.fromString(reader.getString()); + } else if ("category".equals(fieldName)) { + category = InstructionCategoryEnum.fromString(reader.getString()); + } else if ("language".equals(fieldName)) { + language = InstructionLanguageEnum.fromString(reader.getString()); + } else if ("retrieval".equals(fieldName)) { + retrieval = RetrievalProperties.fromJson(reader); + } else if ("relationships".equals(fieldName)) { + relationships = Relationships.fromJson(reader); + } else if ("comment".equals(fieldName)) { + comment = reader.getString(); + } else { + reader.skipChildren(); + } + } + GetResponse deserializedGetResponse = new GetResponse(language, retrieval, relationships, comment); + deserializedGetResponse.id = id; + deserializedGetResponse.status = status; + deserializedGetResponse.domain = domain; + deserializedGetResponse.subDomain = subDomain; + deserializedGetResponse.category = category; + + return deserializedGetResponse; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Instruction.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Instruction.java new file mode 100644 index 000000000000..92df42f3da36 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Instruction.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * This is the request model for Instruction. + */ +@Immutable +public final class Instruction implements JsonSerializable { + /* + * Id for the instruction + */ + @Generated + private String id; + + /* + * intruction Id for the instruction + */ + @Generated + private final String instructionId; + + /* + * Version for the instruction + */ + @Generated + private final String instructionVersion; + + /* + * Status for the instruction + */ + @Generated + private InstructionStatusEnum status; + + /* + * Domain for the instruction + */ + @Generated + private InstrustionDomainEnum domain; + + /* + * Sub-domain for the instruction + */ + @Generated + private InstructionSubDomainEnum subDomain; + + /* + * Category for the instruction + */ + @Generated + private InstructionCategoryEnum category; + + /* + * The language of the instruction. + */ + @Generated + private final InstructionLanguageEnum language; + + /* + * The retrieval properties of the instruction. + */ + @Generated + private final RetrievalProperties retrieval; + + /* + * The relationships of the instruction. + */ + @Generated + private final Relationships relationships; + + /* + * The comment for the instruction. + */ + @Generated + private final String comment; + + /** + * Creates an instance of Instruction class. + * + * @param instructionId the instructionId value to set. + * @param instructionVersion the instructionVersion value to set. + * @param language the language value to set. + * @param retrieval the retrieval value to set. + * @param relationships the relationships value to set. + * @param comment the comment value to set. + */ + @Generated + public Instruction(String instructionId, String instructionVersion, InstructionLanguageEnum language, + RetrievalProperties retrieval, Relationships relationships, String comment) { + this.instructionId = instructionId; + this.instructionVersion = instructionVersion; + this.language = language; + this.retrieval = retrieval; + this.relationships = relationships; + this.comment = comment; + } + + /** + * Get the id property: Id for the instruction. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the instructionId property: intruction Id for the instruction. + * + * @return the instructionId value. + */ + @Generated + public String getInstructionId() { + return this.instructionId; + } + + /** + * Get the instructionVersion property: Version for the instruction. + * + * @return the instructionVersion value. + */ + @Generated + public String getInstructionVersion() { + return this.instructionVersion; + } + + /** + * Get the status property: Status for the instruction. + * + * @return the status value. + */ + @Generated + public InstructionStatusEnum getStatus() { + return this.status; + } + + /** + * Get the domain property: Domain for the instruction. + * + * @return the domain value. + */ + @Generated + public InstrustionDomainEnum getDomain() { + return this.domain; + } + + /** + * Get the subDomain property: Sub-domain for the instruction. + * + * @return the subDomain value. + */ + @Generated + public InstructionSubDomainEnum getSubDomain() { + return this.subDomain; + } + + /** + * Get the category property: Category for the instruction. + * + * @return the category value. + */ + @Generated + public InstructionCategoryEnum getCategory() { + return this.category; + } + + /** + * Get the language property: The language of the instruction. + * + * @return the language value. + */ + @Generated + public InstructionLanguageEnum getLanguage() { + return this.language; + } + + /** + * Get the retrieval property: The retrieval properties of the instruction. + * + * @return the retrieval value. + */ + @Generated + public RetrievalProperties getRetrieval() { + return this.retrieval; + } + + /** + * Get the relationships property: The relationships of the instruction. + * + * @return the relationships value. + */ + @Generated + public Relationships getRelationships() { + return this.relationships; + } + + /** + * Get the comment property: The comment for the instruction. + * + * @return the comment value. + */ + @Generated + public String getComment() { + return this.comment; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("instructionId", this.instructionId); + jsonWriter.writeStringField("instructionVersion", this.instructionVersion); + jsonWriter.writeStringField("language", this.language == null ? null : this.language.toString()); + jsonWriter.writeJsonField("retrieval", this.retrieval); + jsonWriter.writeJsonField("relationships", this.relationships); + jsonWriter.writeStringField("comment", this.comment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Instruction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Instruction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Instruction. + */ + @Generated + public static Instruction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String instructionId = null; + String instructionVersion = null; + InstructionStatusEnum status = null; + InstrustionDomainEnum domain = null; + InstructionSubDomainEnum subDomain = null; + InstructionCategoryEnum category = null; + InstructionLanguageEnum language = null; + RetrievalProperties retrieval = null; + Relationships relationships = null; + String comment = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("instructionId".equals(fieldName)) { + instructionId = reader.getString(); + } else if ("instructionVersion".equals(fieldName)) { + instructionVersion = reader.getString(); + } else if ("status".equals(fieldName)) { + status = InstructionStatusEnum.fromString(reader.getString()); + } else if ("domain".equals(fieldName)) { + domain = InstrustionDomainEnum.fromString(reader.getString()); + } else if ("subDomain".equals(fieldName)) { + subDomain = InstructionSubDomainEnum.fromString(reader.getString()); + } else if ("category".equals(fieldName)) { + category = InstructionCategoryEnum.fromString(reader.getString()); + } else if ("language".equals(fieldName)) { + language = InstructionLanguageEnum.fromString(reader.getString()); + } else if ("retrieval".equals(fieldName)) { + retrieval = RetrievalProperties.fromJson(reader); + } else if ("relationships".equals(fieldName)) { + relationships = Relationships.fromJson(reader); + } else if ("comment".equals(fieldName)) { + comment = reader.getString(); + } else { + reader.skipChildren(); + } + } + Instruction deserializedInstruction + = new Instruction(instructionId, instructionVersion, language, retrieval, relationships, comment); + deserializedInstruction.id = id; + deserializedInstruction.status = status; + deserializedInstruction.domain = domain; + deserializedInstruction.subDomain = subDomain; + deserializedInstruction.category = category; + + return deserializedInstruction; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionCategoryEnum.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionCategoryEnum.java new file mode 100644 index 000000000000..bc4d45575769 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionCategoryEnum.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Instruction Category Enums. + */ +public final class InstructionCategoryEnum extends ExpandableStringEnum { + /** + * Transactional instruction category. + */ + @Generated + public static final InstructionCategoryEnum TRANSACTIONAL = fromString("Transactional"); + + /** + * Analytical instruction category. + */ + @Generated + public static final InstructionCategoryEnum ANALYTICAL = fromString("Analytical"); + + /** + * Trend instruction category. + */ + @Generated + public static final InstructionCategoryEnum TREND = fromString("Trend"); + + /** + * KPI instruction category. + */ + @Generated + public static final InstructionCategoryEnum KPI = fromString("KPI"); + + /** + * Creates a new instance of InstructionCategoryEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public InstructionCategoryEnum() { + } + + /** + * Creates or finds a InstructionCategoryEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstructionCategoryEnum. + */ + @Generated + public static InstructionCategoryEnum fromString(String name) { + return fromString(name, InstructionCategoryEnum.class); + } + + /** + * Gets known InstructionCategoryEnum values. + * + * @return known InstructionCategoryEnum values. + */ + @Generated + public static Collection values() { + return values(InstructionCategoryEnum.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionLanguageEnum.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionLanguageEnum.java new file mode 100644 index 000000000000..85aee2d13b8a --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionLanguageEnum.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Instruction Language Enums. + */ +public final class InstructionLanguageEnum extends ExpandableStringEnum { + /** + * English. + */ + @Generated + public static final InstructionLanguageEnum EN = fromString("EN"); + + /** + * Creates a new instance of InstructionLanguageEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public InstructionLanguageEnum() { + } + + /** + * Creates or finds a InstructionLanguageEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstructionLanguageEnum. + */ + @Generated + public static InstructionLanguageEnum fromString(String name) { + return fromString(name, InstructionLanguageEnum.class); + } + + /** + * Gets known InstructionLanguageEnum values. + * + * @return known InstructionLanguageEnum values. + */ + @Generated + public static Collection values() { + return values(InstructionLanguageEnum.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionStatusEnum.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionStatusEnum.java new file mode 100644 index 000000000000..bfa082c1b00c --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionStatusEnum.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Instruction Status Enums. + */ +public final class InstructionStatusEnum extends ExpandableStringEnum { + /** + * Instruction is active. + */ + @Generated + public static final InstructionStatusEnum ACTIVE = fromString("Active"); + + /** + * Instruction is inactive. + */ + @Generated + public static final InstructionStatusEnum INACTIVE = fromString("Inactive"); + + /** + * Creates a new instance of InstructionStatusEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public InstructionStatusEnum() { + } + + /** + * Creates or finds a InstructionStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstructionStatusEnum. + */ + @Generated + public static InstructionStatusEnum fromString(String name) { + return fromString(name, InstructionStatusEnum.class); + } + + /** + * Gets known InstructionStatusEnum values. + * + * @return known InstructionStatusEnum values. + */ + @Generated + public static Collection values() { + return values(InstructionStatusEnum.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionSubDomainEnum.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionSubDomainEnum.java new file mode 100644 index 000000000000..ec00a2845c9a --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstructionSubDomainEnum.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Instruction Sub Domain Enums. + */ +public final class InstructionSubDomainEnum extends ExpandableStringEnum { + /** + * Production sub-domain. + */ + @Generated + public static final InstructionSubDomainEnum PRODUCTION = fromString("Production"); + + /** + * Quality sub-domain. + */ + @Generated + public static final InstructionSubDomainEnum QUALITY = fromString("Quality"); + + /** + * Maintenance sub-domain. + */ + @Generated + public static final InstructionSubDomainEnum MAINTENANCE = fromString("Maintenance"); + + /** + * Inventory sub-domain. + */ + @Generated + public static final InstructionSubDomainEnum INVENTORY = fromString("Inventory"); + + /** + * Downtime sub-domain. + */ + @Generated + public static final InstructionSubDomainEnum DOWNTIME = fromString("Downtime"); + + /** + * Scrap sub-domain. + */ + @Generated + public static final InstructionSubDomainEnum SCRAP = fromString("Scrap"); + + /** + * Mixed sub-domain. + */ + @Generated + public static final InstructionSubDomainEnum MIXED = fromString("Mixed"); + + /** + * Creates a new instance of InstructionSubDomainEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public InstructionSubDomainEnum() { + } + + /** + * Creates or finds a InstructionSubDomainEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstructionSubDomainEnum. + */ + @Generated + public static InstructionSubDomainEnum fromString(String name) { + return fromString(name, InstructionSubDomainEnum.class); + } + + /** + * Gets known InstructionSubDomainEnum values. + * + * @return known InstructionSubDomainEnum values. + */ + @Generated + public static Collection values() { + return values(InstructionSubDomainEnum.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstrustionDomainEnum.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstrustionDomainEnum.java new file mode 100644 index 000000000000..fcbcc5e4967e --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/InstrustionDomainEnum.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Instruction Sub Domain Enums. + */ +public final class InstrustionDomainEnum extends ExpandableStringEnum { + /** + * Manufacturing Operations Management. + */ + @Generated + public static final InstrustionDomainEnum MOM = fromString("MOM"); + + /** + * Supply Chain Management. + */ + @Generated + public static final InstrustionDomainEnum SCM = fromString("SCM"); + + /** + * Digital Engineering. + */ + @Generated + public static final InstrustionDomainEnum DE = fromString("DE"); + + /** + * Creates a new instance of InstrustionDomainEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public InstrustionDomainEnum() { + } + + /** + * Creates or finds a InstrustionDomainEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstrustionDomainEnum. + */ + @Generated + public static InstrustionDomainEnum fromString(String name) { + return fromString(name, InstrustionDomainEnum.class); + } + + /** + * Gets known InstrustionDomainEnum values. + * + * @return known InstrustionDomainEnum values. + */ + @Generated + public static Collection values() { + return values(InstrustionDomainEnum.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/LinkInstructionRequest1.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/LinkInstructionRequest1.java new file mode 100644 index 000000000000..fd20b378e1ca --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/LinkInstructionRequest1.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The patch request for the example query. + */ +@Immutable +public final class LinkInstructionRequest1 implements JsonSerializable { + /* + * The linked instructions for the example query. + */ + @Generated + private List linkedInstructions; + + /** + * Creates an instance of LinkInstructionRequest1 class. + */ + @Generated + private LinkInstructionRequest1() { + } + + /** + * Get the linkedInstructions property: The linked instructions for the example query. + * + * @return the linkedInstructions value. + */ + @Generated + public List getLinkedInstructions() { + return this.linkedInstructions; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("linkedInstructions", this.linkedInstructions, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinkInstructionRequest1 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinkInstructionRequest1 if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LinkInstructionRequest1. + */ + @Generated + public static LinkInstructionRequest1 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinkInstructionRequest1 deserializedLinkInstructionRequest1 = new LinkInstructionRequest1(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("linkedInstructions".equals(fieldName)) { + List linkedInstructions = reader.readArray(reader1 -> reader1.getString()); + deserializedLinkInstructionRequest1.linkedInstructions = linkedInstructions; + } else { + reader.skipChildren(); + } + } + + return deserializedLinkInstructionRequest1; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/OperationResultQuery.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/OperationResultQuery.java new file mode 100644 index 000000000000..dc15fc662d80 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/OperationResultQuery.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Operation Response Model. + */ +@Immutable +public final class OperationResultQuery implements JsonSerializable { + /* + * The operation status. + */ + @Generated + private OperationStatusValue status; + + /* + * The operation id. + */ + @Generated + private String operationId; + + /* + * The error message. + */ + @Generated + private List errorMessage; + + /** + * Creates an instance of OperationResultQuery class. + */ + @Generated + private OperationResultQuery() { + } + + /** + * Get the status property: The operation status. + * + * @return the status value. + */ + @Generated + public OperationStatusValue getStatus() { + return this.status; + } + + /** + * Get the operationId property: The operation id. + * + * @return the operationId value. + */ + @Generated + public String getOperationId() { + return this.operationId; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + @Generated + public List getErrorMessage() { + return this.errorMessage; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationResultQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationResultQuery if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationResultQuery. + */ + @Generated + public static OperationResultQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationResultQuery deserializedOperationResultQuery = new OperationResultQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationResultQuery.status = OperationStatusValue.fromString(reader.getString()); + } else if ("operationId".equals(fieldName)) { + deserializedOperationResultQuery.operationId = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + List errorMessage = reader.readArray(reader1 -> reader1.getString()); + deserializedOperationResultQuery.errorMessage = errorMessage; + } else { + reader.skipChildren(); + } + } + + return deserializedOperationResultQuery; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/OperationStatusValue.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/OperationStatusValue.java new file mode 100644 index 000000000000..6d441a54a527 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/OperationStatusValue.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operation Status. + */ +public final class OperationStatusValue extends ExpandableStringEnum { + /** + * The operation is Accepted. + */ + @Generated + public static final OperationStatusValue ACCEPTED = fromString("Accepted"); + + /** + * The operation is InProgress. + */ + @Generated + public static final OperationStatusValue IN_PROGRESS = fromString("InProgress"); + + /** + * The operation is in a transient failure state. + */ + @Generated + public static final OperationStatusValue TRANSIENT_FAILURE = fromString("TransientFailure"); + + /** + * The operation is Succeeded. + */ + @Generated + public static final OperationStatusValue SUCCEEDED = fromString("Succeeded"); + + /** + * The operation is Failed. + */ + @Generated + public static final OperationStatusValue FAILED = fromString("Failed"); + + /** + * The operation is Canceling. + */ + @Generated + public static final OperationStatusValue DELETING = fromString("Deleting"); + + /** + * The operation is Canceled. + */ + @Generated + public static final OperationStatusValue CANCELED = fromString("Canceled"); + + /** + * The operation is in a permanent failure state. + */ + @Generated + public static final OperationStatusValue UNKNOWN = fromString("Unknown"); + + /** + * The operation is Skipped. + */ + @Generated + public static final OperationStatusValue SKIPPED = fromString("Skipped"); + + /** + * Creates a new instance of OperationStatusValue value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationStatusValue() { + } + + /** + * Creates or finds a OperationStatusValue from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationStatusValue. + */ + @Generated + public static OperationStatusValue fromString(String name) { + return fromString(name, OperationStatusValue.class); + } + + /** + * Gets known OperationStatusValue values. + * + * @return known OperationStatusValue values. + */ + @Generated + public static Collection values() { + return values(OperationStatusValue.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/QueryEndpoint.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/QueryEndpoint.java new file mode 100644 index 000000000000..88ccbffdac82 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/QueryEndpoint.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Query endpoint. + */ +public final class QueryEndpoint extends ExpandableStringEnum { + /** + * V3 endpoint. + */ + @Generated + public static final QueryEndpoint V3 = fromString("V3"); + + /** + * Assistant endpoint. + */ + @Generated + public static final QueryEndpoint ASSISTANT = fromString("Assistant"); + + /** + * Creates a new instance of QueryEndpoint value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public QueryEndpoint() { + } + + /** + * Creates or finds a QueryEndpoint from its string representation. + * + * @param name a name to look for. + * @return the corresponding QueryEndpoint. + */ + @Generated + public static QueryEndpoint fromString(String name) { + return fromString(name, QueryEndpoint.class); + } + + /** + * Gets known QueryEndpoint values. + * + * @return known QueryEndpoint values. + */ + @Generated + public static Collection values() { + return values(QueryEndpoint.class); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/QueryResponse.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/QueryResponse.java new file mode 100644 index 000000000000..6683efed9b02 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/QueryResponse.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Query Response Result. + */ +@Immutable +public final class QueryResponse implements JsonSerializable { + /* + * Resultant Query Query or Query query execution response (JArray string) + */ + @Generated + private String result; + + /* + * Summary of the Resultant Query Query or Query query execution response (JArray string) + */ + @Generated + private String summary; + + /** + * Creates an instance of QueryResponse class. + */ + @Generated + private QueryResponse() { + } + + /** + * Get the result property: Resultant Query Query or Query query execution response (JArray string). + * + * @return the result value. + */ + @Generated + public String getResult() { + return this.result; + } + + /** + * Get the summary property: Summary of the Resultant Query Query or Query query execution response (JArray string). + * + * @return the summary value. + */ + @Generated + public String getSummary() { + return this.summary; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("result", this.result); + jsonWriter.writeStringField("summary", this.summary); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryResponse. + */ + @Generated + public static QueryResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryResponse deserializedQueryResponse = new QueryResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("result".equals(fieldName)) { + deserializedQueryResponse.result = reader.getString(); + } else if ("summary".equals(fieldName)) { + deserializedQueryResponse.summary = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQueryResponse; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Relationships.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Relationships.java new file mode 100644 index 000000000000..dffdfe0f5661 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/Relationships.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Relationships. + */ +@Immutable +public final class Relationships implements JsonSerializable { + /* + * List of dependent instructions + */ + @Generated + private final List dependencies; + + /* + * List of InstructionIds to be excluded + */ + @Generated + private final List exclusions; + + /** + * Creates an instance of Relationships class. + * + * @param dependencies the dependencies value to set. + * @param exclusions the exclusions value to set. + */ + @Generated + public Relationships(List dependencies, List exclusions) { + this.dependencies = dependencies; + this.exclusions = exclusions; + } + + /** + * Get the dependencies property: List of dependent instructions. + * + * @return the dependencies value. + */ + @Generated + public List getDependencies() { + return this.dependencies; + } + + /** + * Get the exclusions property: List of InstructionIds to be excluded. + * + * @return the exclusions value. + */ + @Generated + public List getExclusions() { + return this.exclusions; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dependencies", this.dependencies, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("exclusions", this.exclusions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Relationships from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Relationships if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Relationships. + */ + @Generated + public static Relationships fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List dependencies = null; + List exclusions = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dependencies".equals(fieldName)) { + dependencies = reader.readArray(reader1 -> reader1.getString()); + } else if ("exclusions".equals(fieldName)) { + exclusions = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new Relationships(dependencies, exclusions); + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/RetrievalProperties.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/RetrievalProperties.java new file mode 100644 index 000000000000..b57f47a22a56 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/RetrievalProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The retrieval properties of the instruction. + */ +@Immutable +public final class RetrievalProperties implements JsonSerializable { + /* + * The sub-topics related to the instruction. + */ + @Generated + private final List subTopics; + + /* + * The keywords associated with the instruction. + */ + @Generated + private final List keywords; + + /* + * The sample questions for the instruction. + */ + @Generated + private final List sampleQuestions; + + /** + * Creates an instance of RetrievalProperties class. + * + * @param subTopics the subTopics value to set. + * @param keywords the keywords value to set. + * @param sampleQuestions the sampleQuestions value to set. + */ + @Generated + public RetrievalProperties(List subTopics, List keywords, List sampleQuestions) { + this.subTopics = subTopics; + this.keywords = keywords; + this.sampleQuestions = sampleQuestions; + } + + /** + * Get the subTopics property: The sub-topics related to the instruction. + * + * @return the subTopics value. + */ + @Generated + public List getSubTopics() { + return this.subTopics; + } + + /** + * Get the keywords property: The keywords associated with the instruction. + * + * @return the keywords value. + */ + @Generated + public List getKeywords() { + return this.keywords; + } + + /** + * Get the sampleQuestions property: The sample questions for the instruction. + * + * @return the sampleQuestions value. + */ + @Generated + public List getSampleQuestions() { + return this.sampleQuestions; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("subTopics", this.subTopics, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("keywords", this.keywords, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sampleQuestions", this.sampleQuestions, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RetrievalProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RetrievalProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RetrievalProperties. + */ + @Generated + public static RetrievalProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List subTopics = null; + List keywords = null; + List sampleQuestions = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subTopics".equals(fieldName)) { + subTopics = reader.readArray(reader1 -> reader1.getString()); + } else if ("keywords".equals(fieldName)) { + keywords = reader.readArray(reader1 -> reader1.getString()); + } else if ("sampleQuestions".equals(fieldName)) { + sampleQuestions = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new RetrievalProperties(subTopics, keywords, sampleQuestions); + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/SampleQuery.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/SampleQuery.java new file mode 100644 index 000000000000..8bd525926d9c --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/SampleQuery.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.JsonMergePatchHelper; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * The sample query resource. + */ +@Fluent +public final class SampleQuery implements JsonSerializable { + /* + * The query language. + */ + @Generated + private String language; + + /* + * The query string. + */ + @Generated + private String query; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setSampleQueryAccessor(new JsonMergePatchHelper.SampleQueryAccessor() { + @Override + public SampleQuery prepareModelForJsonMergePatch(SampleQuery model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(SampleQuery model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of SampleQuery class. + */ + @Generated + public SampleQuery() { + } + + /** + * Get the language property: The query language. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Set the language property: The query language. + *

Required when create the resource.

+ * + * @param language the language value to set. + * @return the SampleQuery object itself. + */ + @Generated + public SampleQuery setLanguage(String language) { + this.language = language; + this.updatedProperties.add("language"); + return this; + } + + /** + * Get the query property: The query string. + * + * @return the query value. + */ + @Generated + public String getQuery() { + return this.query; + } + + /** + * Set the query property: The query string. + *

Required when create the resource.

+ * + * @param query the query value to set. + * @return the SampleQuery object itself. + */ + @Generated + public SampleQuery setQuery(String query) { + this.query = query; + this.updatedProperties.add("query"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("query", this.query); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("language")) { + if (this.language == null) { + jsonWriter.writeNullField("language"); + } else { + jsonWriter.writeStringField("language", this.language); + } + } + if (updatedProperties.contains("query")) { + if (this.query == null) { + jsonWriter.writeNullField("query"); + } else { + jsonWriter.writeStringField("query", this.query); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SampleQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SampleQuery if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SampleQuery. + */ + @Generated + public static SampleQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SampleQuery deserializedSampleQuery = new SampleQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("language".equals(fieldName)) { + deserializedSampleQuery.language = reader.getString(); + } else if ("query".equals(fieldName)) { + deserializedSampleQuery.query = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSampleQuery; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/TestQuery.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/TestQuery.java new file mode 100644 index 000000000000..5668b490d20a --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/TestQuery.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Test Query. + */ +@Immutable +public final class TestQuery implements JsonSerializable { + /* + * The unique identifier of the test query. + */ + @Generated + private String validateTestId; + + /* + * start date of test run + */ + @Generated + private OffsetDateTime fromDate; + + /* + * end date of test run + */ + @Generated + private OffsetDateTime toDate; + + /** + * Creates an instance of TestQuery class. + */ + @Generated + private TestQuery() { + } + + /** + * Get the validateTestId property: The unique identifier of the test query. + * + * @return the validateTestId value. + */ + @Generated + public String getValidateTestId() { + return this.validateTestId; + } + + /** + * Get the fromDate property: start date of test run. + * + * @return the fromDate value. + */ + @Generated + public OffsetDateTime getFromDate() { + return this.fromDate; + } + + /** + * Get the toDate property: end date of test run. + * + * @return the toDate value. + */ + @Generated + public OffsetDateTime getToDate() { + return this.toDate; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fromDate", + this.fromDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.fromDate)); + jsonWriter.writeStringField("toDate", + this.toDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.toDate)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestQuery if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestQuery. + */ + @Generated + public static TestQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestQuery deserializedTestQuery = new TestQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("validateTestId".equals(fieldName)) { + deserializedTestQuery.validateTestId = reader.getString(); + } else if ("fromDate".equals(fieldName)) { + deserializedTestQuery.fromDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("toDate".equals(fieldName)) { + deserializedTestQuery.toDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTestQuery; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/TestResponse.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/TestResponse.java new file mode 100644 index 000000000000..6aa616e5933d --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/TestResponse.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * test response. + */ +@Immutable +public final class TestResponse implements JsonSerializable { + /* + * Test Run Id + */ + @Generated + private final String testRunId; + + /* + * Test Run Status + */ + @Generated + private final String testRunStatus; + + /* + * creation date + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * created by + */ + @Generated + private final String createdBy; + + /** + * Creates an instance of TestResponse class. + * + * @param testRunId the testRunId value to set. + * @param testRunStatus the testRunStatus value to set. + * @param createdDateTime the createdDateTime value to set. + * @param createdBy the createdBy value to set. + */ + @Generated + private TestResponse(String testRunId, String testRunStatus, OffsetDateTime createdDateTime, String createdBy) { + this.testRunId = testRunId; + this.testRunStatus = testRunStatus; + this.createdDateTime = createdDateTime; + this.createdBy = createdBy; + } + + /** + * Get the testRunId property: Test Run Id. + * + * @return the testRunId value. + */ + @Generated + public String getTestRunId() { + return this.testRunId; + } + + /** + * Get the testRunStatus property: Test Run Status. + * + * @return the testRunStatus value. + */ + @Generated + public String getTestRunStatus() { + return this.testRunStatus; + } + + /** + * Get the createdDateTime property: creation date. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: created by. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("testRunId", this.testRunId); + jsonWriter.writeStringField("testRunStatus", this.testRunStatus); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("createdBy", this.createdBy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestResponse. + */ + @Generated + public static TestResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String testRunId = null; + String testRunStatus = null; + OffsetDateTime createdDateTime = null; + String createdBy = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testRunId".equals(fieldName)) { + testRunId = reader.getString(); + } else if ("testRunStatus".equals(fieldName)) { + testRunStatus = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + createdBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TestResponse(testRunId, testRunStatus, createdDateTime, createdBy); + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ValidateTestSummary.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ValidateTestSummary.java new file mode 100644 index 000000000000..25f7575a6982 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/ValidateTestSummary.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Validate Test Response. + */ +@Immutable +public final class ValidateTestSummary implements JsonSerializable { + /* + * The unique identifier of the test. + */ + @Generated + private String testId; + + /* + * The time when the test was created. + */ + @Generated + private final String createdTime; + + /* + * The user who created the test. + */ + @Generated + private final String createdBy; + + /** + * Creates an instance of ValidateTestSummary class. + * + * @param createdTime the createdTime value to set. + * @param createdBy the createdBy value to set. + */ + @Generated + private ValidateTestSummary(String createdTime, String createdBy) { + this.createdTime = createdTime; + this.createdBy = createdBy; + } + + /** + * Get the testId property: The unique identifier of the test. + * + * @return the testId value. + */ + @Generated + public String getTestId() { + return this.testId; + } + + /** + * Get the createdTime property: The time when the test was created. + * + * @return the createdTime value. + */ + @Generated + public String getCreatedTime() { + return this.createdTime; + } + + /** + * Get the createdBy property: The user who created the test. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdTime", this.createdTime); + jsonWriter.writeStringField("createdBy", this.createdBy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateTestSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateTestSummary if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidateTestSummary. + */ + @Generated + public static ValidateTestSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String testId = null; + String createdTime = null; + String createdBy = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testId".equals(fieldName)) { + testId = reader.getString(); + } else if ("createdTime".equals(fieldName)) { + createdTime = reader.getString(); + } else if ("createdBy".equals(fieldName)) { + createdBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + ValidateTestSummary deserializedValidateTestSummary = new ValidateTestSummary(createdTime, createdBy); + deserializedValidateTestSummary.testId = testId; + + return deserializedValidateTestSummary; + }); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/package-info.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/package-info.java new file mode 100644 index 000000000000..6ab98acbb94f --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for CopilotService. + */ +package com.azure.microsoft.industry.manufacturing.mds.copilot.models; diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/package-info.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/package-info.java new file mode 100644 index 000000000000..5fc095a69df4 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/com/azure/microsoft/industry/manufacturing/mds/copilot/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for CopilotService. + */ +package com.azure.microsoft.industry.manufacturing.mds.copilot; diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/module-info.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/module-info.java new file mode 100644 index 000000000000..78552387f5c8 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/java/module-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.microsoft.industry.manufacturing.mds.copilot { + requires transitive com.azure.core; + + exports com.azure.microsoft.industry.manufacturing.mds.copilot; + exports com.azure.microsoft.industry.manufacturing.mds.copilot.models; + + opens com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models to com.azure.core; + opens com.azure.microsoft.industry.manufacturing.mds.copilot.models to com.azure.core; +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/resources/META-INF/azure-microsoft-industry-manufacturing-mds-copilot_apiview_properties.json b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/resources/META-INF/azure-microsoft-industry-manufacturing-mds-copilot_apiview_properties.json new file mode 100644 index 000000000000..80a29b387065 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/resources/META-INF/azure-microsoft-industry-manufacturing-mds-copilot_apiview_properties.json @@ -0,0 +1,145 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient": "MdsSolution.CopilotService.AliasDictionary.Aliases", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.activate": "MdsSolution.CopilotService.AliasDictionary.Aliases.activate", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.activateWithResponse": "MdsSolution.CopilotService.AliasDictionary.Aliases.activate", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.beginCreate": "MdsSolution.CopilotService.AliasDictionary.Aliases.create", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.beginCreateOrReplace": "MdsSolution.CopilotService.AliasDictionary.Aliases.createOrReplace", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.beginCreateOrReplaceWithModel": "MdsSolution.CopilotService.AliasDictionary.Aliases.createOrReplace", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.beginCreateWithModel": "MdsSolution.CopilotService.AliasDictionary.Aliases.create", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.delete": "MdsSolution.CopilotService.AliasDictionary.Aliases.delete", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.deleteWithResponse": "MdsSolution.CopilotService.AliasDictionary.Aliases.delete", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.get": "MdsSolution.CopilotService.AliasDictionary.Aliases.get", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.getWithResponse": "MdsSolution.CopilotService.AliasDictionary.Aliases.get", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesAsyncClient.list": "MdsSolution.CopilotService.AliasDictionary.Aliases.list", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient": "MdsSolution.CopilotService.AliasDictionary.Aliases", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.activate": "MdsSolution.CopilotService.AliasDictionary.Aliases.activate", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.activateWithResponse": "MdsSolution.CopilotService.AliasDictionary.Aliases.activate", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.beginCreate": "MdsSolution.CopilotService.AliasDictionary.Aliases.create", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.beginCreateOrReplace": "MdsSolution.CopilotService.AliasDictionary.Aliases.createOrReplace", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.beginCreateOrReplaceWithModel": "MdsSolution.CopilotService.AliasDictionary.Aliases.createOrReplace", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.beginCreateWithModel": "MdsSolution.CopilotService.AliasDictionary.Aliases.create", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.delete": "MdsSolution.CopilotService.AliasDictionary.Aliases.delete", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.deleteWithResponse": "MdsSolution.CopilotService.AliasDictionary.Aliases.delete", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.get": "MdsSolution.CopilotService.AliasDictionary.Aliases.get", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.getWithResponse": "MdsSolution.CopilotService.AliasDictionary.Aliases.get", + "com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient.list": "MdsSolution.CopilotService.AliasDictionary.Aliases.list", + "com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder": "MdsSolution.CopilotService", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.createExample": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.createExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.createExampleWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.createExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.deleteExample": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.deleteExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.deleteExampleWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.deleteExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.getExample": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.getExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.getExampleWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.getExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.linkInstruction": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.linkInstruction", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.linkInstructionWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.linkInstruction", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.listAllExamples": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.listAllExamples", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.updateExample": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.updateExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsAsyncClient.updateExampleWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.updateExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.createExample": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.createExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.createExampleWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.createExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.deleteExample": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.deleteExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.deleteExampleWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.deleteExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.getExample": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.getExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.getExampleWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.getExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.linkInstruction": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.linkInstruction", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.linkInstructionWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.linkInstruction", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.listAllExamples": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.listAllExamples", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.updateExample": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.updateExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient.updateExampleWithResponse": "MdsSolution.CopilotService.ExampleQueryService.ExampleQueryOperations.updateExample", + "com.azure.microsoft.industry.manufacturing.mds.copilot.FeedbackServiceFeedbackAsyncClient": "MdsSolution.CopilotService.FeedbackService.Feedback", + "com.azure.microsoft.industry.manufacturing.mds.copilot.FeedbackServiceFeedbackAsyncClient.submit": "MdsSolution.CopilotService.FeedbackService.Feedback.submit", + "com.azure.microsoft.industry.manufacturing.mds.copilot.FeedbackServiceFeedbackAsyncClient.submitWithResponse": "MdsSolution.CopilotService.FeedbackService.Feedback.submit", + "com.azure.microsoft.industry.manufacturing.mds.copilot.FeedbackServiceFeedbackClient": "MdsSolution.CopilotService.FeedbackService.Feedback", + "com.azure.microsoft.industry.manufacturing.mds.copilot.FeedbackServiceFeedbackClient.submit": "MdsSolution.CopilotService.FeedbackService.Feedback.submit", + "com.azure.microsoft.industry.manufacturing.mds.copilot.FeedbackServiceFeedbackClient.submitWithResponse": "MdsSolution.CopilotService.FeedbackService.Feedback.submit", + "com.azure.microsoft.industry.manufacturing.mds.copilot.HealthServiceAsyncClient": "MdsSolution.CopilotService.HealthService", + "com.azure.microsoft.industry.manufacturing.mds.copilot.HealthServiceAsyncClient.getHealthStatus": "MdsSolution.CopilotService.HealthService.getHealthStatus", + "com.azure.microsoft.industry.manufacturing.mds.copilot.HealthServiceAsyncClient.getHealthStatusWithResponse": "MdsSolution.CopilotService.HealthService.getHealthStatus", + "com.azure.microsoft.industry.manufacturing.mds.copilot.HealthServiceClient": "MdsSolution.CopilotService.HealthService", + "com.azure.microsoft.industry.manufacturing.mds.copilot.HealthServiceClient.getHealthStatus": "MdsSolution.CopilotService.HealthService.getHealthStatus", + "com.azure.microsoft.industry.manufacturing.mds.copilot.HealthServiceClient.getHealthStatusWithResponse": "MdsSolution.CopilotService.HealthService.getHealthStatus", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient": "MdsSolution.CopilotService.Instructions.Instructions", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.beginCreate": "MdsSolution.CopilotService.Instructions.Instructions.create", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.beginCreateOrReplace": "MdsSolution.CopilotService.Instructions.Instructions.createOrReplace", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.beginCreateOrReplaceWithModel": "MdsSolution.CopilotService.Instructions.Instructions.createOrReplace", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.beginCreateWithModel": "MdsSolution.CopilotService.Instructions.Instructions.create", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.beginDelete": "MdsSolution.CopilotService.Instructions.Instructions.delete", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.beginDeleteWithModel": "MdsSolution.CopilotService.Instructions.Instructions.delete", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.beginUpdateStatus": "MdsSolution.CopilotService.Instructions.Instructions.updateStatus", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.beginUpdateStatusWithModel": "MdsSolution.CopilotService.Instructions.Instructions.updateStatus", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.get": "MdsSolution.CopilotService.Instructions.Instructions.get", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.getWithResponse": "MdsSolution.CopilotService.Instructions.Instructions.get", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsAsyncClient.list": "MdsSolution.CopilotService.Instructions.Instructions.list", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient": "MdsSolution.CopilotService.Instructions.Instructions", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.beginCreate": "MdsSolution.CopilotService.Instructions.Instructions.create", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.beginCreateOrReplace": "MdsSolution.CopilotService.Instructions.Instructions.createOrReplace", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.beginCreateOrReplaceWithModel": "MdsSolution.CopilotService.Instructions.Instructions.createOrReplace", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.beginCreateWithModel": "MdsSolution.CopilotService.Instructions.Instructions.create", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.beginDelete": "MdsSolution.CopilotService.Instructions.Instructions.delete", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.beginDeleteWithModel": "MdsSolution.CopilotService.Instructions.Instructions.delete", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.beginUpdateStatus": "MdsSolution.CopilotService.Instructions.Instructions.updateStatus", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.beginUpdateStatusWithModel": "MdsSolution.CopilotService.Instructions.Instructions.updateStatus", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.get": "MdsSolution.CopilotService.Instructions.Instructions.get", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.getWithResponse": "MdsSolution.CopilotService.Instructions.Instructions.get", + "com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient.list": "MdsSolution.CopilotService.Instructions.Instructions.list", + "com.azure.microsoft.industry.manufacturing.mds.copilot.OperationStatusOperationProgressAsyncClient": "MdsSolution.CopilotService.OperationStatus.OperationProgress", + "com.azure.microsoft.industry.manufacturing.mds.copilot.OperationStatusOperationProgressAsyncClient.getOperationResult": "MdsSolution.CopilotService.OperationStatus.OperationProgress.getOperationResult", + "com.azure.microsoft.industry.manufacturing.mds.copilot.OperationStatusOperationProgressAsyncClient.getOperationResultWithResponse": "MdsSolution.CopilotService.OperationStatus.OperationProgress.getOperationResult", + "com.azure.microsoft.industry.manufacturing.mds.copilot.OperationStatusOperationProgressClient": "MdsSolution.CopilotService.OperationStatus.OperationProgress", + "com.azure.microsoft.industry.manufacturing.mds.copilot.OperationStatusOperationProgressClient.getOperationResult": "MdsSolution.CopilotService.OperationStatus.OperationProgress.getOperationResult", + "com.azure.microsoft.industry.manufacturing.mds.copilot.OperationStatusOperationProgressClient.getOperationResultWithResponse": "MdsSolution.CopilotService.OperationStatus.OperationProgress.getOperationResult", + "com.azure.microsoft.industry.manufacturing.mds.copilot.QueryServiceQueryApiAsyncClient": "MdsSolution.CopilotService.QueryService.QueryApi", + "com.azure.microsoft.industry.manufacturing.mds.copilot.QueryServiceQueryApiAsyncClient.execute": "MdsSolution.CopilotService.QueryService.QueryApi.execute", + "com.azure.microsoft.industry.manufacturing.mds.copilot.QueryServiceQueryApiAsyncClient.executeWithResponse": "MdsSolution.CopilotService.QueryService.QueryApi.execute", + "com.azure.microsoft.industry.manufacturing.mds.copilot.QueryServiceQueryApiClient": "MdsSolution.CopilotService.QueryService.QueryApi", + "com.azure.microsoft.industry.manufacturing.mds.copilot.QueryServiceQueryApiClient.execute": "MdsSolution.CopilotService.QueryService.QueryApi.execute", + "com.azure.microsoft.industry.manufacturing.mds.copilot.QueryServiceQueryApiClient.executeWithResponse": "MdsSolution.CopilotService.QueryService.QueryApi.execute", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiAsyncClient": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiAsyncClient.execute": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.execute", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiAsyncClient.executeWithResponse": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.execute", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiAsyncClient.getValidateTestDetails": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.getValidateTestDetails", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiAsyncClient.getValidateTestDetailsWithResponse": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.getValidateTestDetails", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiAsyncClient.listValidateTestRequests": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.listValidateTestRequests", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient.execute": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.execute", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient.executeWithResponse": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.execute", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient.getValidateTestDetails": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.getValidateTestDetails", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient.getValidateTestDetailsWithResponse": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.getValidateTestDetails", + "com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient.listValidateTestRequests": "MdsSolution.CopilotService.ValidateQueryService.ValidateQueryApi.listValidateTestRequests", + "com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.ActivateRequest": "MdsSolution.CopilotService.AliasDictionary.activate.Request.anonymous", + "com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.ExecuteRequest": "MdsSolution.CopilotService.ValidateQueryService.execute.Request.anonymous", + "com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.ExecuteRequest1": "MdsSolution.CopilotService.QueryService.execute.Request.anonymous", + "com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.LinkInstructionRequest": "MdsSolution.CopilotService.ExampleQueryService.linkInstruction.Request.anonymous", + "com.azure.microsoft.industry.manufacturing.mds.copilot.implementation.models.UpdateStatusRequest": "MdsSolution.CopilotService.Instructions.updateStatus.Request.anonymous", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.ActivateAlias": "MdsSolution.CopilotService.AliasDictionary.Models.ActivateAlias", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias": "MdsSolution.CopilotService.AliasDictionary.Models.Alias", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotHealth": "MdsSolution.CopilotService.Health.Models.CopilotHealth", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotSetupInfo": "MdsSolution.CopilotService.Health.Models.CopilotSetupInfo", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotTestCase": "MdsSolution.CopilotService.ValidateQuery.Models.CopilotTestCase", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest": "MdsSolution.CopilotService.ExampleQuery.Models.ExampleQueryRequest", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.FeedbackCategory": "MdsSolution.CopilotService.Feedback.Models.FeedbackCategory", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.FeedbackRequest": "MdsSolution.CopilotService.Feedback.Models.FeedbackRequest", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.GetResponse": "MdsSolution.CopilotService.Instructions.get.Response.anonymous", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction": "MdsSolution.CopilotService.Instructions.Models.Instruction", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionCategoryEnum": "MdsSolution.CopilotService.Instructions.Models.InstructionCategoryEnum", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionLanguageEnum": "MdsSolution.CopilotService.Instructions.Models.InstructionLanguageEnum", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionStatusEnum": "MdsSolution.CopilotService.Instructions.Models.InstructionStatusEnum", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionSubDomainEnum": "MdsSolution.CopilotService.Instructions.Models.InstructionSubDomainEnum", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstrustionDomainEnum": "MdsSolution.CopilotService.Instructions.Models.InstrustionDomainEnum", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.LinkInstructionRequest1": "MdsSolution.CopilotService.ExampleQuery.Models.LinkInstructionRequest", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery": "MdsSolution.CopilotService.Operation.Models.OperationResultQuery", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationStatusValue": "MdsSolution.CopilotService.Common.Models.OperationStatusValue", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.QueryEndpoint": "MdsSolution.CopilotService.Feedback.Models.QueryEndpoint", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.QueryResponse": "MdsSolution.CopilotService.QueryService.QueryModels.QueryResponse", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.Relationships": "MdsSolution.CopilotService.Instructions.Models.Relationships", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.RetrievalProperties": "MdsSolution.CopilotService.Instructions.Models.RetrievalProperties", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.SampleQuery": "MdsSolution.CopilotService.ExampleQuery.Models.SampleQuery", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestQuery": "MdsSolution.CopilotService.ValidateQuery.Models.TestQuery", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestResponse": "MdsSolution.CopilotService.ValidateQuery.Models.TestResponse", + "com.azure.microsoft.industry.manufacturing.mds.copilot.models.ValidateTestSummary": "MdsSolution.CopilotService.ValidateQuery.Models.ValidateTestSummary" + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/resources/azure-microsoft-industry-manufacturing-mds-copilot.properties b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/resources/azure-microsoft-industry-manufacturing-mds-copilot.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/main/resources/azure-microsoft-industry-manufacturing-mds-copilot.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ReadmeSamples.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ReadmeSamples.java new file mode 100644 index 000000000000..8308c03e0903 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/ReadmeSamples.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.microsoft.industry.manufacturing.mds.copilot.readme + // END: com.azure.microsoft.industry.manufacturing.mds.copilot.readme + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesActivateMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesActivateMaximumSet.java new file mode 100644 index 000000000000..b6cf06ad0b1c --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesActivateMaximumSet.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ActivateAlias; + +public class AliasesActivateMaximumSet { + public static void main(String[] args) { + AliasDictionaryAliasesClient aliasDictionaryAliasesClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildAliasDictionaryAliasesClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasesactivate.aliasesactivatemaximumset + ActivateAlias response = aliasDictionaryAliasesClient.activate("rpzhsxpgbijywrrlx", true); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasesactivate.aliasesactivatemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateMaximumSet.java new file mode 100644 index 000000000000..caa22e5a6b90 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateMaximumSet.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.core.util.polling.SyncPoller; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import java.util.Arrays; + +public class AliasesCreateMaximumSet { + public static void main(String[] args) { + AliasDictionaryAliasesClient aliasDictionaryAliasesClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildAliasDictionaryAliasesClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasescreate.aliasescreatemaximumset + SyncPoller response = aliasDictionaryAliasesClient + .beginCreate(new Alias("xpbwiyrrbwwlqwahiqo", Arrays.asList("nxypvhvckkxstt"))); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasescreate.aliasescreatemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateOrReplaceMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateOrReplaceMaximumSet.java new file mode 100644 index 000000000000..782e6afc2ee6 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateOrReplaceMaximumSet.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.core.util.polling.SyncPoller; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import java.util.Arrays; + +public class AliasesCreateOrReplaceMaximumSet { + public static void main(String[] args) { + AliasDictionaryAliasesClient aliasDictionaryAliasesClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildAliasDictionaryAliasesClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasescreateorreplace.aliasescreateorreplacemaximumset + SyncPoller response = aliasDictionaryAliasesClient.beginCreateOrReplace( + "gbkagebdunmzrjlvqxunphsc", new Alias("xpbwiyrrbwwlqwahiqo", Arrays.asList("nxypvhvckkxstt"))); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasescreateorreplace.aliasescreateorreplacemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesDeleteMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesDeleteMaximumSet.java new file mode 100644 index 000000000000..e34ae143dfed --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesDeleteMaximumSet.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; + +public class AliasesDeleteMaximumSet { + public static void main(String[] args) { + AliasDictionaryAliasesClient aliasDictionaryAliasesClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildAliasDictionaryAliasesClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasesdelete.aliasesdeletemaximumset + aliasDictionaryAliasesClient.delete("czfoociaadizldwkqezgbiu"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasesdelete.aliasesdeletemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesGetMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesGetMaximumSet.java new file mode 100644 index 000000000000..ce95b0f7a070 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesGetMaximumSet.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; + +public class AliasesGetMaximumSet { + public static void main(String[] args) { + AliasDictionaryAliasesClient aliasDictionaryAliasesClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildAliasDictionaryAliasesClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasesget.aliasesgetmaximumset + Alias response = aliasDictionaryAliasesClient.get("kovknnsxgbsywutttkkxqchwravj"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliasesget.aliasesgetmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesListMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesListMaximumSet.java new file mode 100644 index 000000000000..be92bc25e63b --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesListMaximumSet.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; + +public class AliasesListMaximumSet { + public static void main(String[] args) { + AliasDictionaryAliasesClient aliasDictionaryAliasesClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildAliasDictionaryAliasesClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliaseslist.aliaseslistmaximumset + PagedIterable response = aliasDictionaryAliasesClient.list(); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.aliasdictionaryaliaseslist.aliaseslistmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsCreateExampleMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsCreateExampleMaximumSet.java new file mode 100644 index 000000000000..db43d1a796a5 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsCreateExampleMaximumSet.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.SampleQuery; +import java.util.Arrays; + +public class ExampleQueryOperationsCreateExampleMaximumSet { + public static void main(String[] args) { + ExampleQueryServiceExampleQueryOperationsClient exampleQueryServiceExampleQueryOperationsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildExampleQueryServiceExampleQueryOperationsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationscreateexample.examplequeryoperationscreateexamplemaximumset + exampleQueryServiceExampleQueryOperationsClient + .createExample(new ExampleQueryRequest().setUserQuestion("tjgtbxqerknztcwauanxmmphqzs") + .setLinkedInstructions(Arrays.asList("dfutbgdqreo")) + .setSampleQuery(new SampleQuery().setLanguage("tqmlay").setQuery("yjpei"))); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationscreateexample.examplequeryoperationscreateexamplemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsDeleteExampleMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsDeleteExampleMaximumSet.java new file mode 100644 index 000000000000..c43fba7f0906 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsDeleteExampleMaximumSet.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient; + +public class ExampleQueryOperationsDeleteExampleMaximumSet { + public static void main(String[] args) { + ExampleQueryServiceExampleQueryOperationsClient exampleQueryServiceExampleQueryOperationsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildExampleQueryServiceExampleQueryOperationsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationsdeleteexample.examplequeryoperationsdeleteexamplemaximumset + exampleQueryServiceExampleQueryOperationsClient.deleteExample("xwmaetuo"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationsdeleteexample.examplequeryoperationsdeleteexamplemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsGetExampleMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsGetExampleMaximumSet.java new file mode 100644 index 000000000000..e8cccf7720c5 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsGetExampleMaximumSet.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; + +public class ExampleQueryOperationsGetExampleMaximumSet { + public static void main(String[] args) { + ExampleQueryServiceExampleQueryOperationsClient exampleQueryServiceExampleQueryOperationsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildExampleQueryServiceExampleQueryOperationsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationsgetexample.examplequeryoperationsgetexamplemaximumset + ExampleQueryRequest response = exampleQueryServiceExampleQueryOperationsClient.getExample("wtziixiixuncz"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationsgetexample.examplequeryoperationsgetexamplemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsLinkInstructionMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsLinkInstructionMaximumSet.java new file mode 100644 index 000000000000..0c25b599835b --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsLinkInstructionMaximumSet.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.LinkInstructionRequest1; +import java.util.Arrays; + +public class ExampleQueryOperationsLinkInstructionMaximumSet { + public static void main(String[] args) { + ExampleQueryServiceExampleQueryOperationsClient exampleQueryServiceExampleQueryOperationsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildExampleQueryServiceExampleQueryOperationsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationslinkinstruction.examplequeryoperationslinkinstructionmaximumset + LinkInstructionRequest1 response = exampleQueryServiceExampleQueryOperationsClient.linkInstruction("wwk", + Arrays.asList("bnyveykehndaxjtavuac")); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationslinkinstruction.examplequeryoperationslinkinstructionmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsListAllExamplesMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsListAllExamplesMaximumSet.java new file mode 100644 index 000000000000..a3e6dccb852f --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsListAllExamplesMaximumSet.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; + +public class ExampleQueryOperationsListAllExamplesMaximumSet { + public static void main(String[] args) { + ExampleQueryServiceExampleQueryOperationsClient exampleQueryServiceExampleQueryOperationsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildExampleQueryServiceExampleQueryOperationsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationslistallexamples.examplequeryoperationslistallexamplesmaximumset + PagedIterable response + = exampleQueryServiceExampleQueryOperationsClient.listAllExamples("lpr"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationslistallexamples.examplequeryoperationslistallexamplesmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsUpdateExampleMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsUpdateExampleMaximumSet.java new file mode 100644 index 000000000000..b808035914ca --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsUpdateExampleMaximumSet.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.SampleQuery; +import java.util.Arrays; + +public class ExampleQueryOperationsUpdateExampleMaximumSet { + public static void main(String[] args) { + ExampleQueryServiceExampleQueryOperationsClient exampleQueryServiceExampleQueryOperationsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildExampleQueryServiceExampleQueryOperationsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationsupdateexample.examplequeryoperationsupdateexamplemaximumset + ExampleQueryRequest response = exampleQueryServiceExampleQueryOperationsClient.updateExample("rsedkhrqvgiqz", + new ExampleQueryRequest().setUserQuestion("nj") + .setLinkedInstructions(Arrays.asList("qvjmxhbnhjjuxunapx")) + .setSampleQuery( + new SampleQuery().setLanguage("hnurkqeqfmfmjfnc").setQuery("amwxibfyjlzcrekrrcgfzohg"))); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.examplequeryserviceexamplequeryoperationsupdateexample.examplequeryoperationsupdateexamplemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/FeedbackSubmitMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/FeedbackSubmitMaximumSet.java new file mode 100644 index 000000000000..6d53ed9dce1a --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/FeedbackSubmitMaximumSet.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.FeedbackServiceFeedbackClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.FeedbackRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.QueryEndpoint; + +public class FeedbackSubmitMaximumSet { + public static void main(String[] args) { + FeedbackServiceFeedbackClient feedbackServiceFeedbackClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildFeedbackServiceFeedbackClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.feedbackservicefeedbacksubmit.feedbacksubmitmaximumset + feedbackServiceFeedbackClient + .submit(new FeedbackRequest("ppbhtmt", "scjuamqtfsifzektpsfimdcaev", QueryEndpoint.V3)); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.feedbackservicefeedbacksubmit.feedbacksubmitmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/HealthServiceGetHealthStatusMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/HealthServiceGetHealthStatusMaximumSet.java new file mode 100644 index 000000000000..51e7477170ee --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/HealthServiceGetHealthStatusMaximumSet.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.HealthServiceClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotHealth; + +public class HealthServiceGetHealthStatusMaximumSet { + public static void main(String[] args) { + HealthServiceClient healthServiceClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildHealthServiceClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.healthservicegethealthstatus.healthservicegethealthstatusmaximumset + CopilotHealth response = healthServiceClient.getHealthStatus(); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.healthservicegethealthstatus.healthservicegethealthstatusmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateMaximumSet.java new file mode 100644 index 000000000000..b6a97a1b9486 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateMaximumSet.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.core.util.polling.SyncPoller; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionLanguageEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Relationships; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.RetrievalProperties; +import java.util.Arrays; + +public class InstructionsCreateMaximumSet { + public static void main(String[] args) { + InstructionsInstructionsClient instructionsInstructionsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildInstructionsInstructionsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionscreate.instructionscreatemaximumset + SyncPoller response = instructionsInstructionsClient + .beginCreate(new Instruction("lc", "oqjnitfdopnmf", InstructionLanguageEnum.EN, + new RetrievalProperties(Arrays.asList("ncjziatzbkn"), Arrays.asList("xwbkjrwd"), + Arrays.asList("qmrgzdtouhonzzqjhlunvcmamwyqin")), + new Relationships(Arrays.asList("wkcw"), Arrays.asList("wlur")), "xnuhpjbdmvieaglvhmbylmqtgl")); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionscreate.instructionscreatemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateOrReplaceMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateOrReplaceMaximumSet.java new file mode 100644 index 000000000000..4d434ed35259 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateOrReplaceMaximumSet.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.core.util.polling.SyncPoller; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionLanguageEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Relationships; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.RetrievalProperties; +import java.util.Arrays; + +public class InstructionsCreateOrReplaceMaximumSet { + public static void main(String[] args) { + InstructionsInstructionsClient instructionsInstructionsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildInstructionsInstructionsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionscreateorreplace.instructionscreateorreplacemaximumset + SyncPoller response + = instructionsInstructionsClient.beginCreateOrReplace("gvkwsyskqknrjpqs", + new Instruction("lc", "oqjnitfdopnmf", InstructionLanguageEnum.EN, + new RetrievalProperties(Arrays.asList("ncjziatzbkn"), Arrays.asList("xwbkjrwd"), + Arrays.asList("qmrgzdtouhonzzqjhlunvcmamwyqin")), + new Relationships(Arrays.asList("wkcw"), Arrays.asList("wlur")), "xnuhpjbdmvieaglvhmbylmqtgl")); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionscreateorreplace.instructionscreateorreplacemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsDeleteMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsDeleteMaximumSet.java new file mode 100644 index 000000000000..77832e7a9a32 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsDeleteMaximumSet.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.core.util.polling.SyncPoller; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; + +public class InstructionsDeleteMaximumSet { + public static void main(String[] args) { + InstructionsInstructionsClient instructionsInstructionsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildInstructionsInstructionsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionsdelete.instructionsdeletemaximumset + SyncPoller response = instructionsInstructionsClient.beginDelete("sygusbiitwercnq"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionsdelete.instructionsdeletemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsGetMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsGetMaximumSet.java new file mode 100644 index 000000000000..12fb321c04ec --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsGetMaximumSet.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.GetResponse; + +public class InstructionsGetMaximumSet { + public static void main(String[] args) { + InstructionsInstructionsClient instructionsInstructionsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildInstructionsInstructionsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionsget.instructionsgetmaximumset + GetResponse response = instructionsInstructionsClient.get("djmqm"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionsget.instructionsgetmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsListMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsListMaximumSet.java new file mode 100644 index 000000000000..e66a16a5203b --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsListMaximumSet.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction; + +public class InstructionsListMaximumSet { + public static void main(String[] args) { + InstructionsInstructionsClient instructionsInstructionsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildInstructionsInstructionsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionslist.instructionslistmaximumset + PagedIterable response = instructionsInstructionsClient.list(true); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionslist.instructionslistmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsUpdateStatusMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsUpdateStatusMaximumSet.java new file mode 100644 index 000000000000..94d037a170db --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsUpdateStatusMaximumSet.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.core.util.polling.SyncPoller; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionStatusEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; + +public class InstructionsUpdateStatusMaximumSet { + public static void main(String[] args) { + InstructionsInstructionsClient instructionsInstructionsClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildInstructionsInstructionsClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionsupdatestatus.instructionsupdatestatusmaximumset + SyncPoller response = instructionsInstructionsClient + .beginUpdateStatus("azcfnkannptughhrqeopugllqn", InstructionStatusEnum.ACTIVE); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.instructionsinstructionsupdatestatus.instructionsupdatestatusmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/OperationProgressGetOperationResultMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/OperationProgressGetOperationResultMaximumSet.java new file mode 100644 index 000000000000..4f6b76e8926e --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/OperationProgressGetOperationResultMaximumSet.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.OperationStatusOperationProgressClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; + +public class OperationProgressGetOperationResultMaximumSet { + public static void main(String[] args) { + OperationStatusOperationProgressClient operationStatusOperationProgressClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildOperationStatusOperationProgressClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.operationstatusoperationprogressgetoperationresult.operationprogressgetoperationresultmaximumset + OperationResultQuery response = operationStatusOperationProgressClient.getOperationResult("ikljjxttqwhlt"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.operationstatusoperationprogressgetoperationresult.operationprogressgetoperationresultmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/QueryApiExecuteMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/QueryApiExecuteMaximumSet.java new file mode 100644 index 000000000000..32195bae7c0a --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/QueryApiExecuteMaximumSet.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.QueryServiceQueryApiClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.QueryResponse; + +public class QueryApiExecuteMaximumSet { + public static void main(String[] args) { + QueryServiceQueryApiClient queryServiceQueryApiClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildQueryServiceQueryApiClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.queryservicequeryapiexecute.queryapiexecutemaximumset + QueryResponse response + = queryServiceQueryApiClient.execute("ttfmksnwnnqhwitiaxpcksrgaitr", "kbllsekovcrcdhc", 5, true, "co"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.queryservicequeryapiexecute.queryapiexecutemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiExecuteMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiExecuteMaximumSet.java new file mode 100644 index 000000000000..7c26e0e535cc --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiExecuteMaximumSet.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotTestCase; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestResponse; +import java.util.Arrays; + +public class ValidateQueryApiExecuteMaximumSet { + public static void main(String[] args) { + ValidateQueryServiceValidateQueryApiClient validateQueryServiceValidateQueryApiClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildValidateQueryServiceValidateQueryApiClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.validatequeryservicevalidatequeryapiexecute.validatequeryapiexecutemaximumset + TestResponse response = validateQueryServiceValidateQueryApiClient.execute("mhlbvjcsrcwlo", + Arrays.asList(new CopilotTestCase().setNaturalLanguage("lpkzqzihkdcmicxuihtomcbrl") + .setExpectedQuery("garwdnlw") + .setExpectedEntities("rvdsluyfbplkdnh")), + true, "iezruve"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.validatequeryservicevalidatequeryapiexecute.validatequeryapiexecutemaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiGetValidateTestDetailsMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiGetValidateTestDetailsMaximumSet.java new file mode 100644 index 000000000000..0d502287a596 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiGetValidateTestDetailsMaximumSet.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestQuery; + +public class ValidateQueryApiGetValidateTestDetailsMaximumSet { + public static void main(String[] args) { + ValidateQueryServiceValidateQueryApiClient validateQueryServiceValidateQueryApiClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildValidateQueryServiceValidateQueryApiClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.validatequeryservicevalidatequeryapigetvalidatetestdetails.validatequeryapigetvalidatetestdetailsmaximumset + TestQuery response = validateQueryServiceValidateQueryApiClient.getValidateTestDetails("arqsqvt"); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.validatequeryservicevalidatequeryapigetvalidatetestdetails.validatequeryapigetvalidatetestdetailsmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiListValidateTestRequestsMaximumSet.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiListValidateTestRequestsMaximumSet.java new file mode 100644 index 000000000000..6a16b525a19f --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/samples/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiListValidateTestRequestsMaximumSet.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ValidateTestSummary; +import java.time.OffsetDateTime; + +public class ValidateQueryApiListValidateTestRequestsMaximumSet { + public static void main(String[] args) { + ValidateQueryServiceValidateQueryApiClient validateQueryServiceValidateQueryApiClient + = new CopilotServiceClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID")) + .location("mds.azure.com") + .buildValidateQueryServiceValidateQueryApiClient(); + // BEGIN:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.validatequeryservicevalidatequeryapilistvalidatetestrequests.validatequeryapilistvalidatetestrequestsmaximumset + PagedIterable response = validateQueryServiceValidateQueryApiClient + .listValidateTestRequests(OffsetDateTime.parse("2025-03-05T16:09:52.814Z"), + OffsetDateTime.parse("2025-03-05T16:09:52.815Z"), OffsetDateTime.parse("2025-03-05T16:09:52.815Z")); + // END:com.azure.microsoft.industry.manufacturing.mds.copilot.generated.validatequeryservicevalidatequeryapilistvalidatetestrequests.validatequeryapilistvalidatetestrequestsmaximumset + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesActivateMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesActivateMaximumSetTests.java new file mode 100644 index 000000000000..0c81560ed092 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesActivateMaximumSetTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ActivateAlias; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class AliasesActivateMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testAliasesActivateMaximumSetTests() { + // method invocation + ActivateAlias response = aliasDictionaryAliasesClient.activate("rpzhsxpgbijywrrlx", true); + + // response assertion + Assertions.assertNotNull(response); + // verify property "enabled" + Assertions.assertEquals(true, response.isEnabled()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateMaximumSetTests.java new file mode 100644 index 000000000000..ea7996bcc225 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateMaximumSetTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class AliasesCreateMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testAliasesCreateMaximumSetTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(aliasDictionaryAliasesClient + .beginCreate(new Alias("xpbwiyrrbwwlqwahiqo", Arrays.asList("nxypvhvckkxstt")))); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateOrReplaceMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateOrReplaceMaximumSetTests.java new file mode 100644 index 000000000000..3d24bf147178 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesCreateOrReplaceMaximumSetTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class AliasesCreateOrReplaceMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testAliasesCreateOrReplaceMaximumSetTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(aliasDictionaryAliasesClient.beginCreateOrReplace( + "gbkagebdunmzrjlvqxunphsc", new Alias("xpbwiyrrbwwlqwahiqo", Arrays.asList("nxypvhvckkxstt")))); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesDeleteMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesDeleteMaximumSetTests.java new file mode 100644 index 000000000000..e35bd856aa51 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesDeleteMaximumSetTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class AliasesDeleteMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testAliasesDeleteMaximumSetTests() { + // method invocation + aliasDictionaryAliasesClient.delete("czfoociaadizldwkqezgbiu"); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesGetMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesGetMaximumSetTests.java new file mode 100644 index 000000000000..08b7cfe35b84 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesGetMaximumSetTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class AliasesGetMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testAliasesGetMaximumSetTests() { + // method invocation + Alias response = aliasDictionaryAliasesClient.get("kovknnsxgbsywutttkkxqchwravj"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "id" + Assertions.assertEquals("p", response.getId()); + // verify property "name" + Assertions.assertEquals("xpbwiyrrbwwlqwahiqo", response.getName()); + // verify property "aliases" + List responseAliases = response.getAliases(); + Assertions.assertEquals("nxypvhvckkxstt", responseAliases.iterator().next()); + // verify property "isCustom" + Assertions.assertEquals(true, response.isCustom()); + // verify property "enabled" + Assertions.assertEquals(true, response.isEnabled()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesListMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesListMaximumSetTests.java new file mode 100644 index 000000000000..c0d84111bfd2 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/AliasesListMaximumSetTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Alias; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class AliasesListMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testAliasesListMaximumSetTests() { + // method invocation + PagedIterable response = aliasDictionaryAliasesClient.list(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Alias firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "id" + Assertions.assertEquals("p", firstItem.getId()); + // verify property "name" + Assertions.assertEquals("xpbwiyrrbwwlqwahiqo", firstItem.getName()); + // verify property "aliases" + List firstItemAliases = firstItem.getAliases(); + Assertions.assertEquals("nxypvhvckkxstt", firstItemAliases.iterator().next()); + // verify property "isCustom" + Assertions.assertEquals(true, firstItem.isCustom()); + // verify property "enabled" + Assertions.assertEquals(true, firstItem.isEnabled()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/CopilotServiceClientTestBase.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/CopilotServiceClientTestBase.java new file mode 100644 index 000000000000..77dde403cbf0 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/CopilotServiceClientTestBase.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.AliasDictionaryAliasesClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.CopilotServiceClientBuilder; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ExampleQueryServiceExampleQueryOperationsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.FeedbackServiceFeedbackClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.HealthServiceClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.InstructionsInstructionsClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.OperationStatusOperationProgressClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.QueryServiceQueryApiClient; +import com.azure.microsoft.industry.manufacturing.mds.copilot.ValidateQueryServiceValidateQueryApiClient; + +class CopilotServiceClientTestBase extends TestProxyTestBase { + protected QueryServiceQueryApiClient queryServiceQueryApiClient; + + protected OperationStatusOperationProgressClient operationStatusOperationProgressClient; + + protected InstructionsInstructionsClient instructionsInstructionsClient; + + protected ExampleQueryServiceExampleQueryOperationsClient exampleQueryServiceExampleQueryOperationsClient; + + protected AliasDictionaryAliasesClient aliasDictionaryAliasesClient; + + protected HealthServiceClient healthServiceClient; + + protected ValidateQueryServiceValidateQueryApiClient validateQueryServiceValidateQueryApiClient; + + protected FeedbackServiceFeedbackClient feedbackServiceFeedbackClient; + + @Override + protected void beforeTest() { + CopilotServiceClientBuilder queryServiceQueryApiClientbuilder = new CopilotServiceClientBuilder() + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID", "mdsuniqueid")) + .location(Configuration.getGlobalConfiguration().get("LOCATION", "mds.azure.com")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + queryServiceQueryApiClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + queryServiceQueryApiClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + queryServiceQueryApiClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + queryServiceQueryApiClient = queryServiceQueryApiClientbuilder.buildQueryServiceQueryApiClient(); + + CopilotServiceClientBuilder operationStatusOperationProgressClientbuilder = new CopilotServiceClientBuilder() + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID", "mdsuniqueid")) + .location(Configuration.getGlobalConfiguration().get("LOCATION", "mds.azure.com")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + operationStatusOperationProgressClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + operationStatusOperationProgressClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + operationStatusOperationProgressClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + operationStatusOperationProgressClient + = operationStatusOperationProgressClientbuilder.buildOperationStatusOperationProgressClient(); + + CopilotServiceClientBuilder instructionsInstructionsClientbuilder = new CopilotServiceClientBuilder() + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID", "mdsuniqueid")) + .location(Configuration.getGlobalConfiguration().get("LOCATION", "mds.azure.com")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + instructionsInstructionsClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + instructionsInstructionsClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + instructionsInstructionsClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + instructionsInstructionsClient = instructionsInstructionsClientbuilder.buildInstructionsInstructionsClient(); + + CopilotServiceClientBuilder exampleQueryServiceExampleQueryOperationsClientbuilder + = new CopilotServiceClientBuilder() + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID", "mdsuniqueid")) + .location(Configuration.getGlobalConfiguration().get("LOCATION", "mds.azure.com")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + exampleQueryServiceExampleQueryOperationsClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + exampleQueryServiceExampleQueryOperationsClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + exampleQueryServiceExampleQueryOperationsClientbuilder + .credential(new DefaultAzureCredentialBuilder().build()); + } + exampleQueryServiceExampleQueryOperationsClient = exampleQueryServiceExampleQueryOperationsClientbuilder + .buildExampleQueryServiceExampleQueryOperationsClient(); + + CopilotServiceClientBuilder aliasDictionaryAliasesClientbuilder = new CopilotServiceClientBuilder() + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID", "mdsuniqueid")) + .location(Configuration.getGlobalConfiguration().get("LOCATION", "mds.azure.com")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + aliasDictionaryAliasesClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + aliasDictionaryAliasesClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + aliasDictionaryAliasesClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + aliasDictionaryAliasesClient = aliasDictionaryAliasesClientbuilder.buildAliasDictionaryAliasesClient(); + + CopilotServiceClientBuilder healthServiceClientbuilder = new CopilotServiceClientBuilder() + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID", "mdsuniqueid")) + .location(Configuration.getGlobalConfiguration().get("LOCATION", "mds.azure.com")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + healthServiceClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + healthServiceClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + healthServiceClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + healthServiceClient = healthServiceClientbuilder.buildHealthServiceClient(); + + CopilotServiceClientBuilder validateQueryServiceValidateQueryApiClientbuilder + = new CopilotServiceClientBuilder() + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID", "mdsuniqueid")) + .location(Configuration.getGlobalConfiguration().get("LOCATION", "mds.azure.com")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + validateQueryServiceValidateQueryApiClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + validateQueryServiceValidateQueryApiClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + validateQueryServiceValidateQueryApiClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + validateQueryServiceValidateQueryApiClient + = validateQueryServiceValidateQueryApiClientbuilder.buildValidateQueryServiceValidateQueryApiClient(); + + CopilotServiceClientBuilder feedbackServiceFeedbackClientbuilder = new CopilotServiceClientBuilder() + .mdsUniqueId(Configuration.getGlobalConfiguration().get("MDSUNIQUEID", "mdsuniqueid")) + .location(Configuration.getGlobalConfiguration().get("LOCATION", "mds.azure.com")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + feedbackServiceFeedbackClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + feedbackServiceFeedbackClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + feedbackServiceFeedbackClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + feedbackServiceFeedbackClient = feedbackServiceFeedbackClientbuilder.buildFeedbackServiceFeedbackClient(); + + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsCreateExampleMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsCreateExampleMaximumSetTests.java new file mode 100644 index 000000000000..07ca46aaf2cd --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsCreateExampleMaximumSetTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.SampleQuery; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ExampleQueryOperationsCreateExampleMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testExampleQueryOperationsCreateExampleMaximumSetTests() { + // method invocation + exampleQueryServiceExampleQueryOperationsClient + .createExample(new ExampleQueryRequest().setUserQuestion("tjgtbxqerknztcwauanxmmphqzs") + .setLinkedInstructions(Arrays.asList("dfutbgdqreo")) + .setSampleQuery(new SampleQuery().setLanguage("tqmlay").setQuery("yjpei"))); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsDeleteExampleMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsDeleteExampleMaximumSetTests.java new file mode 100644 index 000000000000..1244789eed79 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsDeleteExampleMaximumSetTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ExampleQueryOperationsDeleteExampleMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testExampleQueryOperationsDeleteExampleMaximumSetTests() { + // method invocation + exampleQueryServiceExampleQueryOperationsClient.deleteExample("xwmaetuo"); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsGetExampleMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsGetExampleMaximumSetTests.java new file mode 100644 index 000000000000..d13369c1af0d --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsGetExampleMaximumSetTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.SampleQuery; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ExampleQueryOperationsGetExampleMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testExampleQueryOperationsGetExampleMaximumSetTests() { + // method invocation + ExampleQueryRequest response = exampleQueryServiceExampleQueryOperationsClient.getExample("wtziixiixuncz"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "exampleId" + Assertions.assertEquals("inurzewkwrzgypxwazfgchrezmzump", response.getExampleId()); + // verify property "userQuestion" + Assertions.assertEquals("tjgtbxqerknztcwauanxmmphqzs", response.getUserQuestion()); + // verify property "linkedInstructions" + List responseLinkedInstructions = response.getLinkedInstructions(); + Assertions.assertEquals("dfutbgdqreo", responseLinkedInstructions.iterator().next()); + // verify property "sampleQuery" + SampleQuery responseSampleQuery = response.getSampleQuery(); + Assertions.assertNotNull(responseSampleQuery); + Assertions.assertEquals("tqmlay", responseSampleQuery.getLanguage()); + Assertions.assertEquals("yjpei", responseSampleQuery.getQuery()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsLinkInstructionMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsLinkInstructionMaximumSetTests.java new file mode 100644 index 000000000000..dd4bb2c4d53e --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsLinkInstructionMaximumSetTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.LinkInstructionRequest1; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ExampleQueryOperationsLinkInstructionMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testExampleQueryOperationsLinkInstructionMaximumSetTests() { + // method invocation + LinkInstructionRequest1 response = exampleQueryServiceExampleQueryOperationsClient.linkInstruction("wwk", + Arrays.asList("bnyveykehndaxjtavuac")); + + // response assertion + Assertions.assertNotNull(response); + // verify property "linkedInstructions" + List responseLinkedInstructions = response.getLinkedInstructions(); + Assertions.assertEquals("bnyveykehndaxjtavuac", responseLinkedInstructions.iterator().next()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsListAllExamplesMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsListAllExamplesMaximumSetTests.java new file mode 100644 index 000000000000..7d0cf8b5c581 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsListAllExamplesMaximumSetTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.SampleQuery; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ExampleQueryOperationsListAllExamplesMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testExampleQueryOperationsListAllExamplesMaximumSetTests() { + // method invocation + PagedIterable response + = exampleQueryServiceExampleQueryOperationsClient.listAllExamples("lpr"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + ExampleQueryRequest firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "exampleId" + Assertions.assertEquals("inurzewkwrzgypxwazfgchrezmzump", firstItem.getExampleId()); + // verify property "userQuestion" + Assertions.assertEquals("tjgtbxqerknztcwauanxmmphqzs", firstItem.getUserQuestion()); + // verify property "linkedInstructions" + List firstItemLinkedInstructions = firstItem.getLinkedInstructions(); + Assertions.assertEquals("dfutbgdqreo", firstItemLinkedInstructions.iterator().next()); + // verify property "sampleQuery" + SampleQuery firstItemSampleQuery = firstItem.getSampleQuery(); + Assertions.assertNotNull(firstItemSampleQuery); + Assertions.assertEquals("tqmlay", firstItemSampleQuery.getLanguage()); + Assertions.assertEquals("yjpei", firstItemSampleQuery.getQuery()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsUpdateExampleMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsUpdateExampleMaximumSetTests.java new file mode 100644 index 000000000000..8625bd9c9de6 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ExampleQueryOperationsUpdateExampleMaximumSetTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ExampleQueryRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.SampleQuery; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ExampleQueryOperationsUpdateExampleMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testExampleQueryOperationsUpdateExampleMaximumSetTests() { + // method invocation + ExampleQueryRequest response = exampleQueryServiceExampleQueryOperationsClient.updateExample("rsedkhrqvgiqz", + new ExampleQueryRequest().setUserQuestion("nj") + .setLinkedInstructions(Arrays.asList("qvjmxhbnhjjuxunapx")) + .setSampleQuery( + new SampleQuery().setLanguage("hnurkqeqfmfmjfnc").setQuery("amwxibfyjlzcrekrrcgfzohg"))); + + // response assertion + Assertions.assertNotNull(response); + // verify property "exampleId" + Assertions.assertEquals("inurzewkwrzgypxwazfgchrezmzump", response.getExampleId()); + // verify property "userQuestion" + Assertions.assertEquals("tjgtbxqerknztcwauanxmmphqzs", response.getUserQuestion()); + // verify property "linkedInstructions" + List responseLinkedInstructions = response.getLinkedInstructions(); + Assertions.assertEquals("dfutbgdqreo", responseLinkedInstructions.iterator().next()); + // verify property "sampleQuery" + SampleQuery responseSampleQuery = response.getSampleQuery(); + Assertions.assertNotNull(responseSampleQuery); + Assertions.assertEquals("tqmlay", responseSampleQuery.getLanguage()); + Assertions.assertEquals("yjpei", responseSampleQuery.getQuery()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/FeedbackSubmitMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/FeedbackSubmitMaximumSetTests.java new file mode 100644 index 000000000000..7750bbb4016d --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/FeedbackSubmitMaximumSetTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.FeedbackRequest; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.QueryEndpoint; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class FeedbackSubmitMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testFeedbackSubmitMaximumSetTests() { + // method invocation + feedbackServiceFeedbackClient + .submit(new FeedbackRequest("ppbhtmt", "scjuamqtfsifzektpsfimdcaev", QueryEndpoint.V3)); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/HealthServiceGetHealthStatusMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/HealthServiceGetHealthStatusMaximumSetTests.java new file mode 100644 index 000000000000..44e75d60805c --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/HealthServiceGetHealthStatusMaximumSetTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotHealth; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotSetupInfo; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationStatusValue; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class HealthServiceGetHealthStatusMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testHealthServiceGetHealthStatusMaximumSetTests() { + // method invocation + CopilotHealth response = healthServiceClient.getHealthStatus(); + + // response assertion + Assertions.assertNotNull(response); + // verify property "message" + Assertions.assertEquals("wezblzyxv", response.getMessage()); + // verify property "operationStatus" + Assertions.assertEquals(OperationStatusValue.ACCEPTED, response.getOperationStatus()); + // verify property "copilotSetupInfo" + CopilotSetupInfo responseCopilotSetupInfo = response.getCopilotSetupInfo(); + Assertions.assertNotNull(responseCopilotSetupInfo); + Assertions.assertEquals(OperationStatusValue.ACCEPTED, + responseCopilotSetupInfo.getCreateAzureDataExplorerFunctionJobStatus()); + Assertions.assertEquals(OperationStatusValue.ACCEPTED, + responseCopilotSetupInfo.getRegisterInBuiltInstructionJobStatus()); + Assertions.assertEquals(OperationStatusValue.ACCEPTED, + responseCopilotSetupInfo.getRegisterInbuiltExampleQueryJobStatus()); + Assertions.assertEquals(OperationStatusValue.ACCEPTED, + responseCopilotSetupInfo.getRegisterInBuiltAliasJobStatus()); + Assertions.assertEquals(OperationStatusValue.ACCEPTED, + responseCopilotSetupInfo.getRegisterAssistantViewJobStatus()); + // verify property "errorMessage" + List responseErrorMessage = response.getErrorMessage(); + Assertions.assertEquals("cytqovkrquyyxpdiwjmvyhrrlqzv", responseErrorMessage.iterator().next()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateMaximumSetTests.java new file mode 100644 index 000000000000..c668ffff0585 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateMaximumSetTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionLanguageEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Relationships; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.RetrievalProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class InstructionsCreateMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testInstructionsCreateMaximumSetTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(instructionsInstructionsClient + .beginCreate(new Instruction("lc", "oqjnitfdopnmf", InstructionLanguageEnum.EN, + new RetrievalProperties(Arrays.asList("ncjziatzbkn"), Arrays.asList("xwbkjrwd"), + Arrays.asList("qmrgzdtouhonzzqjhlunvcmamwyqin")), + new Relationships(Arrays.asList("wkcw"), Arrays.asList("wlur")), "xnuhpjbdmvieaglvhmbylmqtgl"))); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateOrReplaceMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateOrReplaceMaximumSetTests.java new file mode 100644 index 000000000000..bef88399e713 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsCreateOrReplaceMaximumSetTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionLanguageEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Relationships; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.RetrievalProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class InstructionsCreateOrReplaceMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testInstructionsCreateOrReplaceMaximumSetTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(instructionsInstructionsClient.beginCreateOrReplace("gvkwsyskqknrjpqs", + new Instruction("lc", "oqjnitfdopnmf", InstructionLanguageEnum.EN, + new RetrievalProperties(Arrays.asList("ncjziatzbkn"), Arrays.asList("xwbkjrwd"), + Arrays.asList("qmrgzdtouhonzzqjhlunvcmamwyqin")), + new Relationships(Arrays.asList("wkcw"), Arrays.asList("wlur")), "xnuhpjbdmvieaglvhmbylmqtgl"))); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsDeleteMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsDeleteMaximumSetTests.java new file mode 100644 index 000000000000..9dfa2c113127 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsDeleteMaximumSetTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class InstructionsDeleteMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testInstructionsDeleteMaximumSetTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(instructionsInstructionsClient.beginDelete("sygusbiitwercnq")); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsGetMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsGetMaximumSetTests.java new file mode 100644 index 000000000000..c069bc8ce529 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsGetMaximumSetTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.GetResponse; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionCategoryEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionLanguageEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionStatusEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionSubDomainEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstrustionDomainEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Relationships; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.RetrievalProperties; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class InstructionsGetMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testInstructionsGetMaximumSetTests() { + // method invocation + GetResponse response = instructionsInstructionsClient.get("djmqm"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "id" + Assertions.assertEquals("tyrmwcqkhcsqwl", response.getId()); + // verify property "status" + Assertions.assertEquals(InstructionStatusEnum.ACTIVE, response.getStatus()); + // verify property "domain" + Assertions.assertEquals(InstrustionDomainEnum.MOM, response.getDomain()); + // verify property "subDomain" + Assertions.assertEquals(InstructionSubDomainEnum.PRODUCTION, response.getSubDomain()); + // verify property "category" + Assertions.assertEquals(InstructionCategoryEnum.TRANSACTIONAL, response.getCategory()); + // verify property "language" + Assertions.assertEquals(InstructionLanguageEnum.EN, response.getLanguage()); + // verify property "retrieval" + RetrievalProperties responseRetrieval = response.getRetrieval(); + Assertions.assertNotNull(responseRetrieval); + List responseRetrievalSubTopics = responseRetrieval.getSubTopics(); + Assertions.assertEquals("ncjziatzbkn", responseRetrievalSubTopics.iterator().next()); + List responseRetrievalKeywords = responseRetrieval.getKeywords(); + Assertions.assertEquals("xwbkjrwd", responseRetrievalKeywords.iterator().next()); + List responseRetrievalSampleQuestions = responseRetrieval.getSampleQuestions(); + Assertions.assertEquals("qmrgzdtouhonzzqjhlunvcmamwyqin", responseRetrievalSampleQuestions.iterator().next()); + // verify property "relationships" + Relationships responseRelationships = response.getRelationships(); + Assertions.assertNotNull(responseRelationships); + List responseRelationshipsDependencies = responseRelationships.getDependencies(); + Assertions.assertEquals("wkcw", responseRelationshipsDependencies.iterator().next()); + List responseRelationshipsExclusions = responseRelationships.getExclusions(); + Assertions.assertEquals("wlur", responseRelationshipsExclusions.iterator().next()); + // verify property "comment" + Assertions.assertEquals("xnuhpjbdmvieaglvhmbylmqtgl", response.getComment()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsListMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsListMaximumSetTests.java new file mode 100644 index 000000000000..a74c99641c91 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsListMaximumSetTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Instruction; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionCategoryEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionLanguageEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionStatusEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionSubDomainEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstrustionDomainEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.Relationships; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.RetrievalProperties; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class InstructionsListMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testInstructionsListMaximumSetTests() { + // method invocation + PagedIterable response = instructionsInstructionsClient.list(true); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Instruction firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "id" + Assertions.assertEquals("tyrmwcqkhcsqwl", firstItem.getId()); + // verify property "status" + Assertions.assertEquals(InstructionStatusEnum.ACTIVE, firstItem.getStatus()); + // verify property "domain" + Assertions.assertEquals(InstrustionDomainEnum.MOM, firstItem.getDomain()); + // verify property "subDomain" + Assertions.assertEquals(InstructionSubDomainEnum.PRODUCTION, firstItem.getSubDomain()); + // verify property "category" + Assertions.assertEquals(InstructionCategoryEnum.TRANSACTIONAL, firstItem.getCategory()); + // verify property "language" + Assertions.assertEquals(InstructionLanguageEnum.EN, firstItem.getLanguage()); + // verify property "retrieval" + RetrievalProperties firstItemRetrieval = firstItem.getRetrieval(); + Assertions.assertNotNull(firstItemRetrieval); + List firstItemRetrievalSubTopics = firstItemRetrieval.getSubTopics(); + Assertions.assertEquals("ncjziatzbkn", firstItemRetrievalSubTopics.iterator().next()); + List firstItemRetrievalKeywords = firstItemRetrieval.getKeywords(); + Assertions.assertEquals("xwbkjrwd", firstItemRetrievalKeywords.iterator().next()); + List firstItemRetrievalSampleQuestions = firstItemRetrieval.getSampleQuestions(); + Assertions.assertEquals("qmrgzdtouhonzzqjhlunvcmamwyqin", firstItemRetrievalSampleQuestions.iterator().next()); + // verify property "relationships" + Relationships firstItemRelationships = firstItem.getRelationships(); + Assertions.assertNotNull(firstItemRelationships); + List firstItemRelationshipsDependencies = firstItemRelationships.getDependencies(); + Assertions.assertEquals("wkcw", firstItemRelationshipsDependencies.iterator().next()); + List firstItemRelationshipsExclusions = firstItemRelationships.getExclusions(); + Assertions.assertEquals("wlur", firstItemRelationshipsExclusions.iterator().next()); + // verify property "comment" + Assertions.assertEquals("xnuhpjbdmvieaglvhmbylmqtgl", firstItem.getComment()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsUpdateStatusMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsUpdateStatusMaximumSetTests.java new file mode 100644 index 000000000000..d8850940969c --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/InstructionsUpdateStatusMaximumSetTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.InstructionStatusEnum; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class InstructionsUpdateStatusMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testInstructionsUpdateStatusMaximumSetTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(instructionsInstructionsClient + .beginUpdateStatus("azcfnkannptughhrqeopugllqn", InstructionStatusEnum.ACTIVE)); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/OperationProgressGetOperationResultMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/OperationProgressGetOperationResultMaximumSetTests.java new file mode 100644 index 000000000000..29573cca735b --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/OperationProgressGetOperationResultMaximumSetTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationResultQuery; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.OperationStatusValue; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class OperationProgressGetOperationResultMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testOperationProgressGetOperationResultMaximumSetTests() { + // method invocation + OperationResultQuery response = operationStatusOperationProgressClient.getOperationResult("ikljjxttqwhlt"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "status" + Assertions.assertEquals(OperationStatusValue.ACCEPTED, response.getStatus()); + // verify property "operationId" + Assertions.assertEquals("hsgnmfxkaaibmskoeindsqh", response.getOperationId()); + // verify property "errorMessage" + List responseErrorMessage = response.getErrorMessage(); + Assertions.assertEquals("okassangavsxyxwmjndzore", responseErrorMessage.iterator().next()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/QueryApiExecuteMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/QueryApiExecuteMaximumSetTests.java new file mode 100644 index 000000000000..d6a1e151be65 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/QueryApiExecuteMaximumSetTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.QueryResponse; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class QueryApiExecuteMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testQueryApiExecuteMaximumSetTests() { + // method invocation + QueryResponse response + = queryServiceQueryApiClient.execute("ttfmksnwnnqhwitiaxpcksrgaitr", "kbllsekovcrcdhc", 5, true, "co"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "result" + Assertions.assertEquals("blgoetxiztaxcdpchkpyzkootok", response.getResult()); + // verify property "summary" + Assertions.assertEquals("txznfigwmcl", response.getSummary()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiExecuteMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiExecuteMaximumSetTests.java new file mode 100644 index 000000000000..08ccd92f885b --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiExecuteMaximumSetTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.CopilotTestCase; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestResponse; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ValidateQueryApiExecuteMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testValidateQueryApiExecuteMaximumSetTests() { + // method invocation + TestResponse response = validateQueryServiceValidateQueryApiClient.execute("mhlbvjcsrcwlo", + Arrays.asList(new CopilotTestCase().setNaturalLanguage("lpkzqzihkdcmicxuihtomcbrl") + .setExpectedQuery("garwdnlw") + .setExpectedEntities("rvdsluyfbplkdnh")), + true, "iezruve"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "testRunId" + Assertions.assertEquals("vqjladfyawwt", response.getTestRunId()); + // verify property "testRunStatus" + Assertions.assertEquals("vkpaekrc", response.getTestRunStatus()); + // verify property "createdDateTime" + Assertions.assertNotNull(response.getCreatedDateTime()); + // verify property "createdBy" + Assertions.assertEquals("vdsumnxvlxwudyol", response.getCreatedBy()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiGetValidateTestDetailsMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiGetValidateTestDetailsMaximumSetTests.java new file mode 100644 index 000000000000..a11aed39c171 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiGetValidateTestDetailsMaximumSetTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.TestQuery; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ValidateQueryApiGetValidateTestDetailsMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testValidateQueryApiGetValidateTestDetailsMaximumSetTests() { + // method invocation + TestQuery response = validateQueryServiceValidateQueryApiClient.getValidateTestDetails("arqsqvt"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "validateTestId" + Assertions.assertEquals("sg", response.getValidateTestId()); + // verify property "fromDate" + Assertions.assertNotNull(response.getFromDate()); + // verify property "toDate" + Assertions.assertNotNull(response.getToDate()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiListValidateTestRequestsMaximumSetTests.java b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiListValidateTestRequestsMaximumSetTests.java new file mode 100644 index 000000000000..edcab5115551 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/src/test/java/com/azure/microsoft/industry/manufacturing/mds/copilot/generated/ValidateQueryApiListValidateTestRequestsMaximumSetTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.microsoft.industry.manufacturing.mds.copilot.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.microsoft.industry.manufacturing.mds.copilot.models.ValidateTestSummary; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ValidateQueryApiListValidateTestRequestsMaximumSetTests extends CopilotServiceClientTestBase { + @Test + @Disabled + public void testValidateQueryApiListValidateTestRequestsMaximumSetTests() { + // method invocation + PagedIterable response = validateQueryServiceValidateQueryApiClient + .listValidateTestRequests(OffsetDateTime.parse("2025-03-05T16:09:52.814Z"), + OffsetDateTime.parse("2025-03-05T16:09:52.815Z"), OffsetDateTime.parse("2025-03-05T16:09:52.815Z")); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + ValidateTestSummary firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "testId" + Assertions.assertEquals("knnuotarjkfducjnbqwfhtfil", firstItem.getTestId()); + // verify property "createdTime" + Assertions.assertEquals("wjufnc", firstItem.getCreatedTime()); + // verify property "createdBy" + Assertions.assertEquals("cbjttdmspungyjk", firstItem.getCreatedBy()); + } +} diff --git a/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/tsp-location.yaml b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/tsp-location.yaml new file mode 100644 index 000000000000..d9c3a729b2f8 --- /dev/null +++ b/sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/manufacturingdatasolution/ManufacturingDataSolution.Copilot +commit: c1c587905ac5f8e57f80b7d9fb1f90a660736fd0 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/manufacturingdatasolution/ci.yml b/sdk/manufacturingdatasolution/ci.yml new file mode 100644 index 000000000000..e2726dea8e9a --- /dev/null +++ b/sdk/manufacturingdatasolution/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/manufacturingdatasolution/ci.yml + - sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/ + exclude: + - sdk/manufacturingdatasolution/pom.xml + - sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/manufacturingdatasolution/ci.yml + - sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/ + exclude: + - sdk/manufacturingdatasolution/pom.xml + - sdk/manufacturingdatasolution/azure-microsoft-industry-manufacturing-mds-copilot/pom.xml + +parameters: + - name: release_azuremicrosoftindustrymanufacturingmdscopilot + displayName: azure-microsoft-industry-manufacturing-mds-copilot + type: boolean + default: true + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: manufacturingdatasolution + Artifacts: + - name: azure-microsoft-industry-manufacturing-mds-copilot + groupId: com.azure + safeName: azuremicrosoftindustrymanufacturingmdscopilot + releaseInBatch: ${{ parameters.release_azuremicrosoftindustrymanufacturingmdscopilot }} diff --git a/sdk/manufacturingdatasolution/pom.xml b/sdk/manufacturingdatasolution/pom.xml new file mode 100644 index 000000000000..cdf9c4c6a4b8 --- /dev/null +++ b/sdk/manufacturingdatasolution/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-manufacturingdatasolution-service + pom + 1.0.0 + + + azure-microsoft-industry-manufacturing-mds-copilot + +