From 4508caed4ea9aed2ee10054168eba8ad4530c422 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Mon, 19 Oct 2026 06:19:12 +0000 Subject: [PATCH 1/2] Configurations: 'specification/azure-native-integrations/resource-manager/Kore.AgentPlatform/AgentPlatform/tspconfig.yaml', and CommitSHA: '41f831e9ce23a30c9edad54fffe8d29c7b0a6987' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6972204 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 18 + .../README.md | 112 ++ .../SAMPLE.md | 662 +++++++++ .../pom.xml | 84 ++ .../koreaiartemis/KoreAIArtemisManager.java | 340 +++++ .../fluent/KoreAIArtemisManagementClient.java | 76 + .../fluent/OperationsClient.java | 40 + .../fluent/OrganizationsClient.java | 336 +++++ .../fluent/SaaSOperationGroupsClient.java | 70 + .../fluent/WorkspacesClient.java | 344 +++++ .../models/ListWorkspacesResponseInner.java | 79 + .../fluent/models/OperationInner.java | 150 ++ .../models/OrganizationResourceInner.java | 185 +++ .../SaaSResourceDetailsResponseInner.java | 146 ++ .../fluent/models/WorkspaceDetailInner.java | 211 +++ .../WorkspaceLinkedSaaSListResponseInner.java | 81 ++ .../fluent/models/WorkspaceResourceInner.java | 168 +++ .../fluent/models/package-info.java | 19 + .../koreaiartemis/fluent/package-info.java | 19 + .../KoreAIArtemisManagementClientBuilder.java | 138 ++ .../KoreAIArtemisManagementClientImpl.java | 356 +++++ .../ListWorkspacesResponseImpl.java | 40 + .../implementation/OperationImpl.java | 51 + .../implementation/OperationsClientImpl.java | 242 ++++ .../implementation/OperationsImpl.java | 45 + .../OrganizationResourceImpl.java | 194 +++ .../OrganizationsClientImpl.java | 1285 +++++++++++++++++ .../implementation/OrganizationsImpl.java | 162 +++ .../implementation/ResourceManagerUtils.java | 195 +++ .../SaaSOperationGroupsClientImpl.java | 233 +++ .../SaaSOperationGroupsImpl.java | 53 + .../SaaSResourceDetailsResponseImpl.java | 49 + .../implementation/WorkspaceDetailImpl.java | 71 + .../WorkspaceLinkedSaaSListResponseImpl.java | 40 + .../implementation/WorkspaceResourceImpl.java | 160 ++ .../implementation/WorkspacesClientImpl.java | 1212 ++++++++++++++++ .../implementation/WorkspacesImpl.java | 207 +++ .../models/OperationListResult.java | 96 ++ .../OrganizationResourceListResult.java | 97 ++ .../models/WorkspaceResourceListResult.java | 96 ++ .../implementation/package-info.java | 19 + .../koreaiartemis/models/ActionType.java | 46 + .../models/ActivateSaaSParameterRequest.java | 114 ++ .../koreaiartemis/models/CompanyDetails.java | 225 +++ .../models/DefaultWorkspaceProperties.java | 152 ++ .../models/DiscoveredWorkspace.java | 215 +++ .../models/ListWorkspacesResponse.java | 27 + .../models/MarketplaceDetails.java | 159 ++ .../models/MarketplaceSubscriptionStatus.java | 61 + .../koreaiartemis/models/OfferDetails.java | 226 +++ .../koreaiartemis/models/Operation.java | 58 + .../models/OperationDisplay.java | 128 ++ .../koreaiartemis/models/Operations.java | 35 + .../models/OrganizationPartnerProperties.java | 199 +++ .../OrganizationPartnerPropertiesUpdate.java | 143 ++ .../models/OrganizationProperties.java | 208 +++ .../models/OrganizationPropertiesUpdate.java | 142 ++ .../models/OrganizationResource.java | 294 ++++ .../models/OrganizationResourceUpdate.java | 115 ++ .../koreaiartemis/models/Organizations.java | 204 +++ .../koreaiartemis/models/Origin.java | 57 + .../koreaiartemis/models/Product.java | 51 + .../models/ResourceProvisioningState.java | 56 + .../models/SaaSOperationGroups.java | 35 + .../models/SaaSResourceDetailsResponse.java | 56 + .../models/SingleSignOnProperties.java | 148 ++ .../models/SingleSignOnStates.java | 56 + .../models/SingleSignOnType.java | 51 + .../koreaiartemis/models/UserDetails.java | 256 ++++ .../koreaiartemis/models/WorkspaceDetail.java | 79 + .../WorkspaceDetailPartnerProperties.java | 148 ++ .../models/WorkspaceLifecycleStatus.java | 56 + .../models/WorkspaceLinkedSaaSItem.java | 93 ++ .../WorkspaceLinkedSaaSListResponse.java | 27 + .../models/WorkspaceMarketplaceDetails.java | 195 +++ .../models/WorkspaceMarketplaceStatus.java | 61 + .../models/WorkspacePartnerProperties.java | 130 ++ .../models/WorkspaceProject.java | 201 +++ .../models/WorkspaceProjectStatus.java | 61 + .../models/WorkspaceProperties.java | 201 +++ .../models/WorkspaceResource.java | 255 ++++ .../models/WorkspaceSaaSData.java | 91 ++ .../koreaiartemis/models/Workspaces.java | 234 +++ .../koreaiartemis/models/package-info.java | 19 + .../koreaiartemis/package-info.java | 19 + .../src/main/java/module-info.java | 16 + ...esourcemanager-koreaiartemis_metadata.json | 1 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...e-resourcemanager-koreaiartemis.properties | 1 + .../generated/OperationsListSamples.java | 48 + .../generated/OrganizationsCreateSamples.java | 120 ++ .../generated/OrganizationsDeleteSamples.java | 35 + ...rganizationsGetByResourceGroupSamples.java | 37 + ...ganizationsListByResourceGroupSamples.java | 36 + .../generated/OrganizationsListSamples.java | 36 + .../OrganizationsListWorkspacesSamples.java | 24 + .../generated/OrganizationsUpdateSamples.java | 71 + ...OperationGroupActivateResourceSamples.java | 27 + .../WorkspacesCreateOrUpdateSamples.java | 43 + .../generated/WorkspacesDeleteSamples.java | 22 + .../WorkspacesGetDetailsSamples.java | 23 + .../generated/WorkspacesGetSamples.java | 37 + .../generated/WorkspacesLinkSaaSSamples.java | 30 + .../WorkspacesListByOrganizationSamples.java | 36 + .../WorkspacesListLinkedSaaSSamples.java | 23 + .../ActivateSaaSParameterRequestTests.java | 28 + .../generated/CompanyDetailsTests.java | 41 + .../DefaultWorkspacePropertiesTests.java | 66 + .../generated/DiscoveredWorkspaceTests.java | 36 + .../ListWorkspacesResponseInnerTests.java | 39 + .../generated/MarketplaceDetailsTests.java | 48 + .../generated/OfferDetailsTests.java | 41 + .../generated/OperationDisplayTests.java | 17 + .../generated/OperationInnerTests.java | 17 + .../generated/OperationListResultTests.java | 19 + .../generated/OperationsListMockTests.java | 36 + .../OrganizationPartnerPropertiesTests.java | 88 ++ ...anizationPartnerPropertiesUpdateTests.java | 32 + .../OrganizationPropertiesTests.java | 151 ++ .../OrganizationPropertiesUpdateTests.java | 75 + .../OrganizationResourceInnerTests.java | 170 +++ .../OrganizationResourceListResultTests.java | 61 + .../OrganizationResourceUpdateTests.java | 94 ++ .../OrganizationsCreateMockTests.java | 127 ++ ...tByResourceGroupWithResponseMockTests.java | 76 + ...nizationsListByResourceGroupMockTests.java | 85 ++ .../generated/OrganizationsListMockTests.java | 82 ++ ...nsListWorkspacesWithResponseMockTests.java | 54 + ...rationGroupsActivateResourceMockTests.java | 39 + ...SaaSResourceDetailsResponseInnerTests.java | 19 + .../SingleSignOnPropertiesTests.java | 25 + .../generated/UserDetailsTests.java | 44 + .../generated/WorkspaceDetailInnerTests.java | 49 + ...WorkspaceDetailPartnerPropertiesTests.java | 32 + .../WorkspaceLinkedSaaSItemTests.java | 20 + ...spaceLinkedSaaSListResponseInnerTests.java | 20 + .../WorkspaceMarketplaceDetailsTests.java | 27 + .../WorkspacePartnerPropertiesTests.java | 28 + .../generated/WorkspaceProjectTests.java | 28 + .../generated/WorkspacePropertiesTests.java | 85 ++ .../WorkspaceResourceInnerTests.java | 74 + .../WorkspaceResourceListResultTests.java | 31 + .../generated/WorkspaceSaaSDataTests.java | 28 + .../WorkspacesCreateOrUpdateMockTests.java | 93 ++ ...spacesGetDetailsWithResponseMockTests.java | 68 + .../WorkspacesGetWithResponseMockTests.java | 52 + ...WorkspacesListByOrganizationMockTests.java | 58 + ...esListLinkedSaaSWithResponseMockTests.java | 40 + .../tsp-location.yaml | 4 + sdk/koreaiartemis/ci.yml | 46 + sdk/koreaiartemis/pom.xml | 15 + 154 files changed, 16646 insertions(+) create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/CHANGELOG.md create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/README.md create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/SAMPLE.md create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/KoreAIArtemisManager.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/KoreAIArtemisManagementClient.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OperationsClient.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OrganizationsClient.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/SaaSOperationGroupsClient.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/WorkspacesClient.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/ListWorkspacesResponseInner.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OperationInner.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OrganizationResourceInner.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/SaaSResourceDetailsResponseInner.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceDetailInner.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceLinkedSaaSListResponseInner.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceResourceInner.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/package-info.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/package-info.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientBuilder.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ListWorkspacesResponseImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsClientImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationResourceImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsClientImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ResourceManagerUtils.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsClientImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSResourceDetailsResponseImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceDetailImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceLinkedSaaSListResponseImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceResourceImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesClientImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesImpl.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OperationListResult.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OrganizationResourceListResult.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/WorkspaceResourceListResult.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/package-info.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActionType.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActivateSaaSParameterRequest.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/CompanyDetails.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/DefaultWorkspaceProperties.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/DiscoveredWorkspace.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ListWorkspacesResponse.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceDetails.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceSubscriptionStatus.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OfferDetails.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operation.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OperationDisplay.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operations.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerProperties.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerPropertiesUpdate.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationProperties.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPropertiesUpdate.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResource.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResourceUpdate.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Organizations.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Origin.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Product.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ResourceProvisioningState.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSOperationGroups.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSResourceDetailsResponse.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnProperties.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnStates.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnType.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/UserDetails.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetail.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetailPartnerProperties.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLifecycleStatus.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSItem.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSListResponse.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceDetails.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceStatus.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspacePartnerProperties.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProject.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProjectStatus.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProperties.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceResource.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceSaaSData.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Workspaces.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/package-info.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/package-info.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/module-info.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/azure-resourcemanager-koreaiartemis_metadata.json create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-koreaiartemis/proxy-config.json create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-koreaiartemis/reflect-config.json create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/azure-resourcemanager-koreaiartemis.properties create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OperationsListSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsCreateSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsDeleteSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsGetByResourceGroupSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListByResourceGroupSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListWorkspacesSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsUpdateSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSOperationGroupActivateResourceSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesCreateOrUpdateSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesDeleteSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetDetailsSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesLinkSaaSSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListByOrganizationSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListLinkedSaaSSamples.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/ActivateSaaSParameterRequestTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/CompanyDetailsTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/DefaultWorkspacePropertiesTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/DiscoveredWorkspaceTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/ListWorkspacesResponseInnerTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/MarketplaceDetailsTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OfferDetailsTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationDisplayTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationInnerTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationListResultTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationsListMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPartnerPropertiesTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPartnerPropertiesUpdateTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPropertiesTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPropertiesUpdateTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceInnerTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceListResultTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceUpdateTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsCreateMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListByResourceGroupMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListWorkspacesWithResponseMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSOperationGroupsActivateResourceMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSResourceDetailsResponseInnerTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SingleSignOnPropertiesTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/UserDetailsTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceDetailInnerTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceDetailPartnerPropertiesTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceLinkedSaaSItemTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceLinkedSaaSListResponseInnerTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceMarketplaceDetailsTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacePartnerPropertiesTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceProjectTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacePropertiesTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceResourceInnerTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceResourceListResultTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceSaaSDataTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesCreateOrUpdateMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetDetailsWithResponseMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetWithResponseMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListByOrganizationMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListLinkedSaaSWithResponseMockTests.java create mode 100644 sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/tsp-location.yaml create mode 100644 sdk/koreaiartemis/ci.yml create mode 100644 sdk/koreaiartemis/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 7301a126c2246..e7e7287ed2cc7 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -525,6 +525,7 @@ com.azure.resourcemanager:azure-resourcemanager-resources-deployments;1.0.0;1.1. com.azure.resourcemanager:azure-resourcemanager-resources-policy;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-resources-templatespecs;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-compute-workloadmanager;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-koreaiartemis;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.2;2.0.0-beta.2 diff --git a/pom.xml b/pom.xml index c813074b64d5d..2afe9d65610f0 100644 --- a/pom.xml +++ b/pom.xml @@ -148,6 +148,7 @@ sdk/iotoperations sdk/keyvault sdk/keyvault-v2 + sdk/koreaiartemis sdk/kubernetesconfiguration sdk/kusto sdk/labservices diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/CHANGELOG.md b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/CHANGELOG.md new file mode 100644 index 0000000000000..9d095013d74bf --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/CHANGELOG.md @@ -0,0 +1,18 @@ +# Release History + +## 1.0.0-beta.1 (2026-10-19) + +- Azure Resource Manager Kore AI Artemis client library for Java. This package contains Microsoft Azure SDK for Kore AI Artemis Management SDK. Kore.AgentPlatform Resource Provider for managing Kore AI Agent Platform +Organizations and their Workspaces. + +Organizations are top-level tracked ARM resources. Each Organization is +provisioned together with a default Workspace. Additional Workspaces are +managed as a child proxy resource type under the Organization using the +standard ARM verbs (PUT / DELETE / GET / LIST) on the workspace URL. + +Service-to-service authentication between Liftr and Kore uses federated +Microsoft Entra credentials and is enforced at the runtime layer +(not on the ARM surface). Package api-version 2026-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-koreaiartemis Java SDK. diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/README.md b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/README.md new file mode 100644 index 0000000000000..3f178991f33ba --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/README.md @@ -0,0 +1,112 @@ +# Azure Resource Manager Kore AI Artemis client library for Java + +Azure Resource Manager Kore AI Artemis client library for Java. + +This package contains Microsoft Azure SDK for Kore AI Artemis Management SDK. Kore.AgentPlatform Resource Provider for managing Kore AI Agent Platform +Organizations and their Workspaces. + +Organizations are top-level tracked ARM resources. Each Organization is +provisioned together with a default Workspace. Additional Workspaces are +managed as a child proxy resource type under the Organization using the +standard ARM verbs (PUT / DELETE / GET / LIST) on the workspace URL. + +Service-to-service authentication between Liftr and Kore uses federated +Microsoft Entra credentials and is enforced at the runtime layer +(not on the ARM surface). Package api-version 2026-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## 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.resourcemanager:azure-resourcemanager-koreaiartemis;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-koreaiartemis + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +KoreAIArtemisManager manager = KoreAIArtemisManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[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 +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/SAMPLE.md b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/SAMPLE.md new file mode 100644 index 0000000000000..21e8c4315287e --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/SAMPLE.md @@ -0,0 +1,662 @@ +# Code snippets and samples + + +## Operations + +- [List](#operations_list) + +## Organizations + +- [Create](#organizations_create) +- [Delete](#organizations_delete) +- [GetByResourceGroup](#organizations_getbyresourcegroup) +- [List](#organizations_list) +- [ListByResourceGroup](#organizations_listbyresourcegroup) +- [ListWorkspaces](#organizations_listworkspaces) +- [Update](#organizations_update) + +## SaaSOperationGroup + +- [ActivateResource](#saasoperationgroup_activateresource) + +## Workspaces + +- [CreateOrUpdate](#workspaces_createorupdate) +- [Delete](#workspaces_delete) +- [Get](#workspaces_get) +- [GetDetails](#workspaces_getdetails) +- [LinkSaaS](#workspaces_linksaas) +- [ListByOrganization](#workspaces_listbyorganization) +- [ListLinkedSaaS](#workspaces_listlinkedsaas) +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + operationsListMinimumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void operationsList(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + operationsListMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_Create + +```java +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import com.azure.resourcemanager.koreaiartemis.models.DefaultWorkspaceProperties; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationProperties; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Organizations Create. + */ +public final class OrganizationsCreateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Create_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsCreateMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .define("contoso-org") + .withRegion("eastus2euap") + .withExistingResourceGroup("contoso-rg") + .withTags(mapOf("environment", "production")) + .withProperties(new OrganizationProperties().withPartnerProperties(new OrganizationPartnerProperties() + .withOrganizationName("Contoso AI Platform") + .withBillingEmail("billing@contoso.com") + .withOwnerEmail("admin@contoso.com") + .withDefaultWorkspace(new DefaultWorkspaceProperties().withName("my first workspace") + .withProduct(Product.AIFORWORK) + .withMarketplaceDetails(Arrays.asList(new MarketplaceDetails().withSubscriptionId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas") + .withOfferDetails(new OfferDetails().withPublisherId("kore-ai") + .withOfferId("kore-ai-platform") + .withPlanId("business-monthly") + .withPlanName("Business Monthly") + .withTermUnit("P1M") + .withTermId("1m")))))) + .withUser(new UserDetails().withFirstName("Jane") + .withLastName("Doe") + .withEmailAddress("jane.doe@contoso.com") + .withUpn("jane.doe@contoso.onmicrosoft.com") + .withPhoneNumber("+1-425-555-0100") + .withAlternateEmail("jane.alternate@contoso.com") + .withAddress("1 Microsoft Way, Redmond, WA 98052")) + .withCompanyDetails(new CompanyDetails().withCompanyName("Contoso Ltd.") + .withOfficeAddress("1 Microsoft Way, Redmond, WA 98052") + .withCountry("US") + .withDomain("contoso.com") + .withBusinessType("Technology") + .withNumberOfEmployees(500))) + .create(); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Create.json + */ + /** + * Sample code: Organizations_Create. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsCreate(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .define("contoso-org") + .withRegion("eastus2euap") + .withExistingResourceGroup("contoso-rg") + .withTags(mapOf("environment", "production")) + .withProperties(new OrganizationProperties().withPartnerProperties(new OrganizationPartnerProperties() + .withOrganizationName("Contoso AI Platform") + .withBillingEmail("billing@contoso.com") + .withOwnerEmail("admin@contoso.com") + .withDefaultWorkspace(new DefaultWorkspaceProperties().withName("my first workspace") + .withProduct(Product.AIFORWORK) + .withMarketplaceDetails(Arrays.asList(new MarketplaceDetails().withSubscriptionId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas") + .withOfferDetails(new OfferDetails().withPublisherId("kore-ai") + .withOfferId("kore-ai-platform") + .withPlanId("business-monthly") + .withPlanName("Business Monthly") + .withTermUnit("P1M") + .withTermId("1m")))))) + .withUser(new UserDetails().withFirstName("Jane") + .withLastName("Doe") + .withEmailAddress("jane.doe@contoso.com") + .withUpn("jane.doe@contoso.onmicrosoft.com") + .withPhoneNumber("+1-425-555-0100")) + .withCompanyDetails(new CompanyDetails().withCompanyName("Contoso Ltd.") + .withCountry("US") + .withDomain("contoso.com") + .withBusinessType("Technology") + .withNumberOfEmployees(500))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Organizations_Delete + +```java +/** + * Samples for Organizations Delete. + */ +public final class OrganizationsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Delete.json + */ + /** + * Sample code: Organizations_Delete. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsDelete(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().delete("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Delete_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsDeleteMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().delete("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_GetByResourceGroup + +```java +/** + * Samples for Organizations GetByResourceGroup. + */ +public final class OrganizationsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Get.json + */ + /** + * Sample code: Organizations_Get. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsGet(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .getByResourceGroupWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Get_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsGetMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .getByResourceGroupWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_List + +```java +/** + * Samples for Organizations List. + */ +public final class OrganizationsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListBySubscription.json + */ + /** + * Sample code: Organizations_ListBySubscription. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsListBySubscription(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_ListByResourceGroup + +```java +/** + * Samples for Organizations ListByResourceGroup. + */ +public final class OrganizationsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().listByResourceGroup("contoso-rg", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListByResourceGroup.json + */ + /** + * Sample code: Organizations_ListByResourceGroup. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsListByResourceGroup(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().listByResourceGroup("contoso-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_ListWorkspaces + +```java +/** + * Samples for Organizations ListWorkspaces. + */ +public final class OrganizationsListWorkspacesSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListWorkspaces.json + */ + /** + * Sample code: Organizations_ListWorkspaces. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsListWorkspaces(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .listWorkspacesWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_Update + +```java +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerPropertiesUpdate; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPropertiesUpdate; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResource; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; + +/** + * Samples for Organizations Update. + */ +public final class OrganizationsUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Update.json + */ + /** + * Sample code: Organizations_Update. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsUpdate(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + OrganizationResource resource = manager.organizations() + .getByResourceGroupWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new OrganizationPropertiesUpdate().withPartnerProperties( + new OrganizationPartnerPropertiesUpdate().withOrganizationName("Contoso AI Platform (Updated)") + .withBillingEmail("new-billing@contoso.com") + .withOwnerEmail("admin@contoso.com"))) + .apply(); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Update_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsUpdateMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + OrganizationResource resource = manager.organizations() + .getByResourceGroupWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new OrganizationPropertiesUpdate() + .withPartnerProperties( + new OrganizationPartnerPropertiesUpdate().withOrganizationName("Contoso AI Platform (Updated)") + .withBillingEmail("new-billing@contoso.com") + .withOwnerEmail("admin@contoso.com")) + .withUser(new UserDetails().withFirstName("Jane") + .withLastName("Doe") + .withEmailAddress("jane.alternate@contoso.com") + .withUpn("jane.doe@contoso.onmicrosoft.com") + .withPhoneNumber("+1-425-555-0100") + .withAlternateEmail("jane.alternate@contoso.com") + .withAddress("1 Microsoft Way, Redmond, WA 98052")) + .withCompanyDetails(new CompanyDetails().withCompanyName("Contoso Ltd.") + .withOfficeAddress("1 Microsoft Way, Redmond, WA 98052") + .withCountry("US") + .withDomain("contoso.com") + .withBusinessType("Technology") + .withNumberOfEmployees(28))) + .apply(); + } +} +``` + +### SaaSOperationGroup_ActivateResource + +```java +import com.azure.resourcemanager.koreaiartemis.models.ActivateSaaSParameterRequest; + +/** + * Samples for SaaSOperationGroup ActivateResource. + */ +public final class SaaSOperationGroupActivateResourceSamples { + /* + * x-ms-original-file: 2026-07-01-preview/SaaSOperationGroup_ActivateResource.json + */ + /** + * Sample code: SaaSOperationGroup_ActivateResource. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + saaSOperationGroupActivateResource(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.saaSOperationGroups() + .activateResource(new ActivateSaaSParameterRequest().withSaasGuid("12345678-1234-1234-1234-123456789012") + .withPublisherId("kore-ai"), com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_CreateOrUpdate + +```java +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspacePartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProperties; +import java.util.Arrays; + +/** + * Samples for Workspaces CreateOrUpdate. + */ +public final class WorkspacesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_CreateOrUpdate.json + */ + /** + * Sample code: Workspaces_CreateOrUpdate. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesCreateOrUpdate(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .define("contoso-prod") + .withExistingOrganization("contoso-rg", "contoso-org") + .withProperties(new WorkspaceProperties().withProduct(Product.AIFORWORK) + .withMarketplaceDetails(Arrays.asList(new MarketplaceDetails().withSubscriptionId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas") + .withOfferDetails(new OfferDetails().withPublisherId("kore-ai") + .withOfferId("kore-ai-platform") + .withPlanId("business-monthly") + .withPlanName("Business Monthly") + .withTermUnit("P1M") + .withTermId("1m")))) + .withPartnerProperties(new WorkspacePartnerProperties().withName("Contoso Production") + .withOwnerEmail("owner@contoso.com"))) + .create(); + } +} +``` + +### Workspaces_Delete + +```java +/** + * Samples for Workspaces Delete. + */ +public final class WorkspacesDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_Delete.json + */ + /** + * Sample code: Workspaces_Delete. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesDelete(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces().delete("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_Get + +```java +/** + * Samples for Workspaces Get. + */ +public final class WorkspacesGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_Get.json + */ + /** + * Sample code: Workspaces_Get. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesGet(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .getWithResponse("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Workspaces_Get_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + workspacesGetMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .getWithResponse("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_GetDetails + +```java +/** + * Samples for Workspaces GetDetails. + */ +public final class WorkspacesGetDetailsSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_GetDetails.json + */ + /** + * Sample code: Workspaces_GetDetails. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesGetDetails(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .getDetailsWithResponse("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_LinkSaaS + +```java +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceSaaSData; +import java.util.Arrays; + +/** + * Samples for Workspaces LinkSaaS. + */ +public final class WorkspacesLinkSaaSSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_LinkSaaS.json + */ + /** + * Sample code: Workspaces_LinkSaaS. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesLinkSaaS(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .linkSaaS("contoso-rg", "contoso-org", "contoso-prod", + new WorkspaceSaaSData().withSaaSResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas-1", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas-2")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_ListByOrganization + +```java +/** + * Samples for Workspaces ListByOrganization. + */ +public final class WorkspacesListByOrganizationSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_ListByOrganization.json + */ + /** + * Sample code: Workspaces_ListByOrganization. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + workspacesListByOrganization(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces().listByOrganization("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_ListByOrganization_MaximumSet_Gen.json + */ + /** + * Sample code: Workspaces_ListByOrganization_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesListByOrganizationMaximumSetGen( + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces().listByOrganization("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_ListLinkedSaaS + +```java +/** + * Samples for Workspaces ListLinkedSaaS. + */ +public final class WorkspacesListLinkedSaaSSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_ListLinkedSaaS.json + */ + /** + * Sample code: Workspaces_ListLinkedSaaS. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesListLinkedSaaS(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .listLinkedSaaSWithResponse("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml new file mode 100644 index 0000000000000..d550594eb594a --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-koreaiartemis + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Kore AI Artemis Management + This package contains Microsoft Azure SDK for Kore AI Artemis Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Kore.AgentPlatform Resource Provider for managing Kore AI Agent Platform + Organizations and their Workspaces. + + Organizations are top-level tracked ARM resources. Each Organization is + provisioned together with a default Workspace. Additional Workspaces are + managed as a child proxy resource type under the Organization using the + standard ARM verbs (PUT / DELETE / GET / LIST) on the workspace URL. + + Service-to-service authentication between Liftr and Kore uses federated + Microsoft Entra credentials and is enforced at the runtime layer + (not on the ARM surface). Package api-version 2026-07-01-preview. + 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 + 0 + 0 + true + + + + com.azure + azure-core + 1.60.0 + + + com.azure + azure-core-management + 1.19.8 + + + com.azure + azure-core-test + 1.27.0-beta.19 + test + + + com.azure + azure-identity + 1.18.7 + test + + + diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/KoreAIArtemisManager.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/KoreAIArtemisManager.java new file mode 100644 index 0000000000000..942a8a138ca35 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/KoreAIArtemisManager.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +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.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.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.koreaiartemis.fluent.KoreAIArtemisManagementClient; +import com.azure.resourcemanager.koreaiartemis.implementation.KoreAIArtemisManagementClientBuilder; +import com.azure.resourcemanager.koreaiartemis.implementation.OperationsImpl; +import com.azure.resourcemanager.koreaiartemis.implementation.OrganizationsImpl; +import com.azure.resourcemanager.koreaiartemis.implementation.SaaSOperationGroupsImpl; +import com.azure.resourcemanager.koreaiartemis.implementation.WorkspacesImpl; +import com.azure.resourcemanager.koreaiartemis.models.Operations; +import com.azure.resourcemanager.koreaiartemis.models.Organizations; +import com.azure.resourcemanager.koreaiartemis.models.SaaSOperationGroups; +import com.azure.resourcemanager.koreaiartemis.models.Workspaces; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to KoreAIArtemisManager. + * Kore.AgentPlatform Resource Provider for managing Kore AI Agent Platform + * Organizations and their Workspaces. + * + * Organizations are top-level tracked ARM resources. Each Organization is + * provisioned together with a default Workspace. Additional Workspaces are + * managed as a child proxy resource type under the Organization using the + * standard ARM verbs (PUT / DELETE / GET / LIST) on the workspace URL. + * + * Service-to-service authentication between Liftr and Kore uses federated + * Microsoft Entra credentials and is enforced at the runtime layer + * (not on the ARM surface). + */ +public final class KoreAIArtemisManager { + private Operations operations; + + private Organizations organizations; + + private SaaSOperationGroups saaSOperationGroups; + + private Workspaces workspaces; + + private final KoreAIArtemisManagementClient clientObject; + + private KoreAIArtemisManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new KoreAIArtemisManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Kore AI Artemis service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Kore AI Artemis service API instance. + */ + public static KoreAIArtemisManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Kore AI Artemis service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Kore AI Artemis service API instance. + */ + public static KoreAIArtemisManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new KoreAIArtemisManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create KoreAIArtemisManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new KoreAIArtemisManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-koreaiartemis.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Kore AI Artemis service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Kore AI Artemis service API instance. + */ + public KoreAIArtemisManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.koreaiartemis") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new KoreAIArtemisManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Organizations. It manages OrganizationResource. + * + * @return Resource collection API of Organizations. + */ + public Organizations organizations() { + if (this.organizations == null) { + this.organizations = new OrganizationsImpl(clientObject.getOrganizations(), this); + } + return organizations; + } + + /** + * Gets the resource collection API of SaaSOperationGroups. + * + * @return Resource collection API of SaaSOperationGroups. + */ + public SaaSOperationGroups saaSOperationGroups() { + if (this.saaSOperationGroups == null) { + this.saaSOperationGroups = new SaaSOperationGroupsImpl(clientObject.getSaaSOperationGroups(), this); + } + return saaSOperationGroups; + } + + /** + * Gets the resource collection API of Workspaces. It manages WorkspaceResource. + * + * @return Resource collection API of Workspaces. + */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); + } + return workspaces; + } + + /** + * Gets wrapped service client KoreAIArtemisManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client KoreAIArtemisManagementClient. + */ + public KoreAIArtemisManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/KoreAIArtemisManagementClient.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/KoreAIArtemisManagementClient.java new file mode 100644 index 0000000000000..d31adbd324851 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/KoreAIArtemisManagementClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for KoreAIArtemisManagementClient class. + */ +public interface KoreAIArtemisManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the OrganizationsClient object to access its operations. + * + * @return the OrganizationsClient object. + */ + OrganizationsClient getOrganizations(); + + /** + * Gets the SaaSOperationGroupsClient object to access its operations. + * + * @return the SaaSOperationGroupsClient object. + */ + SaaSOperationGroupsClient getSaaSOperationGroups(); + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + WorkspacesClient getWorkspaces(); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OperationsClient.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OperationsClient.java new file mode 100644 index 0000000000000..a619c76e35854 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OperationsClient.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.resourcemanager.koreaiartemis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OrganizationsClient.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OrganizationsClient.java new file mode 100644 index 0000000000000..4c2ee1e57b9b4 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OrganizationsClient.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.koreaiartemis.fluent.models.ListWorkspacesResponseInner; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResourceUpdate; + +/** + * An instance of this class provides access to all the operations defined in OrganizationsClient. + */ +public interface OrganizationsClient { + /** + * Get an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String organizationName, Context context); + + /** + * Get an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner getByResourceGroup(String resourceGroupName, String organizationName); + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationResourceInner> beginCreate(String resourceGroupName, + String organizationName, OrganizationResourceInner resource); + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationResourceInner> beginCreate(String resourceGroupName, + String organizationName, OrganizationResourceInner resource, Context context); + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner create(String resourceGroupName, String organizationName, + OrganizationResourceInner resource); + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner create(String resourceGroupName, String organizationName, + OrganizationResourceInner resource, Context context); + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationResourceInner> beginUpdate(String resourceGroupName, + String organizationName, OrganizationResourceUpdate properties); + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationResourceInner> beginUpdate(String resourceGroupName, + String organizationName, OrganizationResourceUpdate properties, Context context); + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner update(String resourceGroupName, String organizationName, + OrganizationResourceUpdate properties); + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner update(String resourceGroupName, String organizationName, + OrganizationResourceUpdate properties, Context context); + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName); + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, Context context); + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String organizationName); + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String organizationName, Context context); + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List Organizations in a Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Organizations in a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWorkspacesWithResponse(String resourceGroupName, String organizationName, + Context context); + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListWorkspacesResponseInner listWorkspaces(String resourceGroupName, String organizationName); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/SaaSOperationGroupsClient.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/SaaSOperationGroupsClient.java new file mode 100644 index 0000000000000..f8099fbda5b44 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/SaaSOperationGroupsClient.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.koreaiartemis.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.koreaiartemis.models.ActivateSaaSParameterRequest; + +/** + * An instance of this class provides access to all the operations defined in SaaSOperationGroupsClient. + */ +public interface SaaSOperationGroupsClient { + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SaaSResourceDetailsResponseInner> + beginActivateResource(ActivateSaaSParameterRequest body); + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SaaSResourceDetailsResponseInner> + beginActivateResource(ActivateSaaSParameterRequest body, Context context); + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SaaSResourceDetailsResponseInner activateResource(ActivateSaaSParameterRequest body); + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SaaSResourceDetailsResponseInner activateResource(ActivateSaaSParameterRequest body, Context context); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/WorkspacesClient.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/WorkspacesClient.java new file mode 100644 index 0000000000000..199e6d999afb3 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/WorkspacesClient.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceDetailInner; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceLinkedSaaSListResponseInner; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceResourceInner; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceSaaSData; + +/** + * An instance of this class provides access to all the operations defined in WorkspacesClient. + */ +public interface WorkspacesClient { + /** + * Get a Workspace under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String organizationName, + String workspaceName, Context context); + + /** + * Get a Workspace under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceResourceInner get(String resourceGroupName, String organizationName, String workspaceName); + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WorkspaceResourceInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String workspaceName, WorkspaceResourceInner resource); + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WorkspaceResourceInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String workspaceName, WorkspaceResourceInner resource, Context context); + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceResourceInner createOrUpdate(String resourceGroupName, String organizationName, String workspaceName, + WorkspaceResourceInner resource); + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceResourceInner createOrUpdate(String resourceGroupName, String organizationName, String workspaceName, + WorkspaceResourceInner resource, Context context); + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String workspaceName); + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String workspaceName, Context context); + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String organizationName, String workspaceName); + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String organizationName, String workspaceName, Context context); + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOrganization(String resourceGroupName, String organizationName); + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOrganization(String resourceGroupName, String organizationName, + Context context); + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginLinkSaaS(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceSaaSData body); + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginLinkSaaS(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceSaaSData body, Context context); + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void linkSaaS(String resourceGroupName, String organizationName, String workspaceName, WorkspaceSaaSData body); + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void linkSaaS(String resourceGroupName, String organizationName, String workspaceName, WorkspaceSaaSData body, + Context context); + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listLinkedSaaSWithResponse(String resourceGroupName, + String organizationName, String workspaceName, Context context); + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceLinkedSaaSListResponseInner listLinkedSaaS(String resourceGroupName, String organizationName, + String workspaceName); + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDetailsWithResponse(String resourceGroupName, String organizationName, + String workspaceName, Context context); + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceDetailInner getDetails(String resourceGroupName, String organizationName, String workspaceName); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/ListWorkspacesResponseInner.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/ListWorkspacesResponseInner.java new file mode 100644 index 0000000000000..7400209fb4537 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/ListWorkspacesResponseInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.fluent.models; + +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.resourcemanager.koreaiartemis.models.DiscoveredWorkspace; +import java.io.IOException; +import java.util.List; + +/** + * Response containing all Workspaces in a Kore Organization. + */ +@Immutable +public final class ListWorkspacesResponseInner implements JsonSerializable { + /* + * Workspaces returned by Kore, including Liftr-managed and partner-managed Workspaces. + */ + private List value; + + /** + * Creates an instance of ListWorkspacesResponseInner class. + */ + private ListWorkspacesResponseInner() { + } + + /** + * Get the value property: Workspaces returned by Kore, including Liftr-managed and partner-managed Workspaces. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListWorkspacesResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListWorkspacesResponseInner 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 ListWorkspacesResponseInner. + */ + public static ListWorkspacesResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListWorkspacesResponseInner deserializedListWorkspacesResponseInner = new ListWorkspacesResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DiscoveredWorkspace.fromJson(reader1)); + deserializedListWorkspacesResponseInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedListWorkspacesResponseInner; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OperationInner.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..a949c3b6836b0 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OperationInner.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.resourcemanager.koreaiartemis.fluent.models; + +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.resourcemanager.koreaiartemis.models.ActionType; +import com.azure.resourcemanager.koreaiartemis.models.OperationDisplay; +import com.azure.resourcemanager.koreaiartemis.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner 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 OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OrganizationResourceInner.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OrganizationResourceInner.java new file mode 100644 index 0000000000000..da6694dec8b0d --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OrganizationResourceInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationProperties; +import java.io.IOException; +import java.util.Map; + +/** + * An Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. Each Organization is provisioned with a default + * Workspace atomically; additional Workspaces are managed via the + * `createWorkspace` and `deleteWorkspace` actions defined below. + */ +@Fluent +public final class OrganizationResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private OrganizationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OrganizationResourceInner class. + */ + public OrganizationResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public OrganizationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the OrganizationResourceInner object itself. + */ + public OrganizationResourceInner withProperties(OrganizationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public OrganizationResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OrganizationResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationResourceInner 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 OrganizationResourceInner. + */ + public static OrganizationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationResourceInner deserializedOrganizationResourceInner = new OrganizationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOrganizationResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOrganizationResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOrganizationResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedOrganizationResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedOrganizationResourceInner.properties = OrganizationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOrganizationResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceInner; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/SaaSResourceDetailsResponseInner.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/SaaSResourceDetailsResponseInner.java new file mode 100644 index 0000000000000..213fe6c08f575 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/SaaSResourceDetailsResponseInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Marketplace SaaS resource details. + */ +@Immutable +public final class SaaSResourceDetailsResponseInner extends ProxyResource { + /* + * SaaS subscription identifier (GUID) issued by the Azure Marketplace fulfillment API for the activated SaaS + * resource. + */ + private String saasId; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SaaSResourceDetailsResponseInner class. + */ + private SaaSResourceDetailsResponseInner() { + } + + /** + * Get the saasId property: SaaS subscription identifier (GUID) issued by the Azure Marketplace fulfillment API for + * the activated SaaS resource. + * + * @return the saasId value. + */ + public String saasId() { + return this.saasId; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("saasId", this.saasId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SaaSResourceDetailsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SaaSResourceDetailsResponseInner 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 SaaSResourceDetailsResponseInner. + */ + public static SaaSResourceDetailsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SaaSResourceDetailsResponseInner deserializedSaaSResourceDetailsResponseInner + = new SaaSResourceDetailsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.type = reader.getString(); + } else if ("saasId".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.saasId = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSaaSResourceDetailsResponseInner; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceDetailInner.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceDetailInner.java new file mode 100644 index 0000000000000..601f5f330b655 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceDetailInner.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.fluent.models; + +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 com.azure.resourcemanager.koreaiartemis.models.WorkspaceDetailPartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLifecycleStatus; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProject; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Complete Workspace details returned by Kore. + */ +@Immutable +public final class WorkspaceDetailInner implements JsonSerializable { + /* + * Partner-issued Workspace identifier. + */ + private String id; + + /* + * Full Azure resource ID of the Workspace. + */ + private String azureResourceId; + + /* + * Partner-issued identifier of the parent Organization. + */ + private String organizationId; + + /* + * Partner-specific fields returned by the Workspace details action. + */ + private WorkspaceDetailPartnerProperties partnerProperties; + + /* + * Lifecycle status of the Workspace. + */ + private WorkspaceLifecycleStatus status; + + /* + * Projects under the Workspace. + */ + private List projects; + + /* + * Time when the partner Workspace was created, as reported by Kore. This is distinct from ARM-managed + * `systemData.createdAt`. + */ + private OffsetDateTime createdAt; + + /* + * Time when the partner Workspace was last updated, as reported by Kore. This is distinct from ARM-managed + * `systemData.lastModifiedAt`. + */ + private OffsetDateTime updatedAt; + + /** + * Creates an instance of WorkspaceDetailInner class. + */ + private WorkspaceDetailInner() { + } + + /** + * Get the id property: Partner-issued Workspace identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the azureResourceId property: Full Azure resource ID of the Workspace. + * + * @return the azureResourceId value. + */ + public String azureResourceId() { + return this.azureResourceId; + } + + /** + * Get the organizationId property: Partner-issued identifier of the parent Organization. + * + * @return the organizationId value. + */ + public String organizationId() { + return this.organizationId; + } + + /** + * Get the partnerProperties property: Partner-specific fields returned by the Workspace details action. + * + * @return the partnerProperties value. + */ + public WorkspaceDetailPartnerProperties partnerProperties() { + return this.partnerProperties; + } + + /** + * Get the status property: Lifecycle status of the Workspace. + * + * @return the status value. + */ + public WorkspaceLifecycleStatus status() { + return this.status; + } + + /** + * Get the projects property: Projects under the Workspace. + * + * @return the projects value. + */ + public List projects() { + return this.projects; + } + + /** + * Get the createdAt property: Time when the partner Workspace was created, as reported by Kore. This is distinct + * from ARM-managed `systemData.createdAt`. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: Time when the partner Workspace was last updated, as reported by Kore. This is + * distinct from ARM-managed `systemData.lastModifiedAt`. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("azureResourceId", this.azureResourceId); + jsonWriter.writeStringField("organizationId", this.organizationId); + jsonWriter.writeJsonField("partnerProperties", this.partnerProperties); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeArrayField("projects", this.projects, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("createdAt", + this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); + jsonWriter.writeStringField("updatedAt", + this.updatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedAt)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceDetailInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceDetailInner 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 WorkspaceDetailInner. + */ + public static WorkspaceDetailInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceDetailInner deserializedWorkspaceDetailInner = new WorkspaceDetailInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceDetailInner.id = reader.getString(); + } else if ("azureResourceId".equals(fieldName)) { + deserializedWorkspaceDetailInner.azureResourceId = reader.getString(); + } else if ("organizationId".equals(fieldName)) { + deserializedWorkspaceDetailInner.organizationId = reader.getString(); + } else if ("partnerProperties".equals(fieldName)) { + deserializedWorkspaceDetailInner.partnerProperties + = WorkspaceDetailPartnerProperties.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedWorkspaceDetailInner.status = WorkspaceLifecycleStatus.fromString(reader.getString()); + } else if ("projects".equals(fieldName)) { + List projects = reader.readArray(reader1 -> WorkspaceProject.fromJson(reader1)); + deserializedWorkspaceDetailInner.projects = projects; + } else if ("createdAt".equals(fieldName)) { + deserializedWorkspaceDetailInner.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedAt".equals(fieldName)) { + deserializedWorkspaceDetailInner.updatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceDetailInner; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceLinkedSaaSListResponseInner.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceLinkedSaaSListResponseInner.java new file mode 100644 index 0000000000000..0b12e058f9d75 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceLinkedSaaSListResponseInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.fluent.models; + +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.resourcemanager.koreaiartemis.models.WorkspaceLinkedSaaSItem; +import java.io.IOException; +import java.util.List; + +/** + * Response containing the list of SaaS resources linked to the Workspace. + */ +@Immutable +public final class WorkspaceLinkedSaaSListResponseInner + implements JsonSerializable { + /* + * List of SaaS resources linked to this Workspace. + */ + private List value; + + /** + * Creates an instance of WorkspaceLinkedSaaSListResponseInner class. + */ + private WorkspaceLinkedSaaSListResponseInner() { + } + + /** + * Get the value property: List of SaaS resources linked to this Workspace. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceLinkedSaaSListResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceLinkedSaaSListResponseInner 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 WorkspaceLinkedSaaSListResponseInner. + */ + public static WorkspaceLinkedSaaSListResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceLinkedSaaSListResponseInner deserializedWorkspaceLinkedSaaSListResponseInner + = new WorkspaceLinkedSaaSListResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WorkspaceLinkedSaaSItem.fromJson(reader1)); + deserializedWorkspaceLinkedSaaSListResponseInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceLinkedSaaSListResponseInner; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceResourceInner.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceResourceInner.java new file mode 100644 index 0000000000000..a019a5472c626 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceResourceInner.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.resourcemanager.koreaiartemis.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProperties; +import java.io.IOException; + +/** + * A Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. Workspaces are not tracked + * (no `location`/`tags`). Lifecycle is managed through the standard ARM verbs + * on the child URL: + * + * - PUT .../organizations/{org}/workspaces/{workspaceName} (create or update) + * - DELETE .../organizations/{org}/workspaces/{workspaceName} + * - GET .../organizations/{org}/workspaces/{workspaceName} + * - GET .../organizations/{org}/workspaces (list by parent) + * + * A default Workspace is also provisioned atomically when the parent + * Organization is created (see `OrganizationProperties.defaultWorkspace`); + * additional Workspaces are managed via the operations defined here. + */ +@Fluent +public final class WorkspaceResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private WorkspaceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of WorkspaceResourceInner class. + */ + public WorkspaceResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public WorkspaceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WorkspaceResourceInner object itself. + */ + public WorkspaceResourceInner withProperties(WorkspaceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceResourceInner 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 WorkspaceResourceInner. + */ + public static WorkspaceResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceResourceInner deserializedWorkspaceResourceInner = new WorkspaceResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkspaceResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkspaceResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceResourceInner.properties = WorkspaceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWorkspaceResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceResourceInner; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/package-info.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/package-info.java new file mode 100644 index 0000000000000..fec9862ffc713 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/package-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for KoreAIArtemis. + * Kore.AgentPlatform Resource Provider for managing Kore AI Agent Platform + * Organizations and their Workspaces. + * + * Organizations are top-level tracked ARM resources. Each Organization is + * provisioned together with a default Workspace. Additional Workspaces are + * managed as a child proxy resource type under the Organization using the + * standard ARM verbs (PUT / DELETE / GET / LIST) on the workspace URL. + * + * Service-to-service authentication between Liftr and Kore uses federated + * Microsoft Entra credentials and is enforced at the runtime layer + * (not on the ARM surface). + */ +package com.azure.resourcemanager.koreaiartemis.fluent.models; diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/package-info.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/package-info.java new file mode 100644 index 0000000000000..38608c456295c --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/package-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for KoreAIArtemis. + * Kore.AgentPlatform Resource Provider for managing Kore AI Agent Platform + * Organizations and their Workspaces. + * + * Organizations are top-level tracked ARM resources. Each Organization is + * provisioned together with a default Workspace. Additional Workspaces are + * managed as a child proxy resource type under the Organization using the + * standard ARM verbs (PUT / DELETE / GET / LIST) on the workspace URL. + * + * Service-to-service authentication between Liftr and Kore uses federated + * Microsoft Entra credentials and is enforced at the runtime layer + * (not on the ARM surface). + */ +package com.azure.resourcemanager.koreaiartemis.fluent; diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientBuilder.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientBuilder.java new file mode 100644 index 0000000000000..3d72133f4e554 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +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.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the KoreAIArtemisManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { KoreAIArtemisManagementClientImpl.class }) +public final class KoreAIArtemisManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the KoreAIArtemisManagementClientBuilder. + */ + public KoreAIArtemisManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the KoreAIArtemisManagementClientBuilder. + */ + public KoreAIArtemisManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the KoreAIArtemisManagementClientBuilder. + */ + public KoreAIArtemisManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the KoreAIArtemisManagementClientBuilder. + */ + public KoreAIArtemisManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the KoreAIArtemisManagementClientBuilder. + */ + public KoreAIArtemisManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the KoreAIArtemisManagementClientBuilder. + */ + public KoreAIArtemisManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of KoreAIArtemisManagementClientImpl with the provided parameters. + * + * @return an instance of KoreAIArtemisManagementClientImpl. + */ + public KoreAIArtemisManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + KoreAIArtemisManagementClientImpl client = new KoreAIArtemisManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientImpl.java new file mode 100644 index 0000000000000..df76a7a9dda22 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientImpl.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.koreaiartemis.fluent.KoreAIArtemisManagementClient; +import com.azure.resourcemanager.koreaiartemis.fluent.OperationsClient; +import com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient; +import com.azure.resourcemanager.koreaiartemis.fluent.SaaSOperationGroupsClient; +import com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the KoreAIArtemisManagementClientImpl type. + */ +@ServiceClient(builder = KoreAIArtemisManagementClientBuilder.class) +public final class KoreAIArtemisManagementClientImpl implements KoreAIArtemisManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * 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. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The OrganizationsClient object to access its operations. + */ + private final OrganizationsClient organizations; + + /** + * Gets the OrganizationsClient object to access its operations. + * + * @return the OrganizationsClient object. + */ + public OrganizationsClient getOrganizations() { + return this.organizations; + } + + /** + * The SaaSOperationGroupsClient object to access its operations. + */ + private final SaaSOperationGroupsClient saaSOperationGroups; + + /** + * Gets the SaaSOperationGroupsClient object to access its operations. + * + * @return the SaaSOperationGroupsClient object. + */ + public SaaSOperationGroupsClient getSaaSOperationGroups() { + return this.saaSOperationGroups; + } + + /** + * The WorkspacesClient object to access its operations. + */ + private final WorkspacesClient workspaces; + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + public WorkspacesClient getWorkspaces() { + return this.workspaces; + } + + /** + * Initializes an instance of KoreAIArtemisManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + KoreAIArtemisManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-07-01-preview"; + this.operations = new OperationsClientImpl(this); + this.organizations = new OrganizationsClientImpl(this); + this.saaSOperationGroups = new SaaSOperationGroupsClientImpl(this); + this.workspaces = new WorkspacesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KoreAIArtemisManagementClientImpl.class); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ListWorkspacesResponseImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ListWorkspacesResponseImpl.java new file mode 100644 index 0000000000000..9deb5d388ce8c --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ListWorkspacesResponseImpl.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.resourcemanager.koreaiartemis.implementation; + +import com.azure.resourcemanager.koreaiartemis.fluent.models.ListWorkspacesResponseInner; +import com.azure.resourcemanager.koreaiartemis.models.DiscoveredWorkspace; +import com.azure.resourcemanager.koreaiartemis.models.ListWorkspacesResponse; +import java.util.Collections; +import java.util.List; + +public final class ListWorkspacesResponseImpl implements ListWorkspacesResponse { + private ListWorkspacesResponseInner innerObject; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + ListWorkspacesResponseImpl(ListWorkspacesResponseInner innerObject, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ListWorkspacesResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationImpl.java new file mode 100644 index 0000000000000..9b7607335c009 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationImpl.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.resourcemanager.koreaiartemis.implementation; + +import com.azure.resourcemanager.koreaiartemis.fluent.models.OperationInner; +import com.azure.resourcemanager.koreaiartemis.models.ActionType; +import com.azure.resourcemanager.koreaiartemis.models.Operation; +import com.azure.resourcemanager.koreaiartemis.models.OperationDisplay; +import com.azure.resourcemanager.koreaiartemis.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsClientImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..8d9bf8a7b0da5 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.koreaiartemis.fluent.OperationsClient; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OperationInner; +import com.azure.resourcemanager.koreaiartemis.implementation.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final KoreAIArtemisManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(KoreAIArtemisManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KoreAIArtemisManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "KoreAIArtemisManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Kore.AgentPlatform/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Kore.AgentPlatform/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..81bb45645beba --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.koreaiartemis.fluent.OperationsClient; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OperationInner; +import com.azure.resourcemanager.koreaiartemis.models.Operation; +import com.azure.resourcemanager.koreaiartemis.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationResourceImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationResourceImpl.java new file mode 100644 index 0000000000000..6b39176f469e6 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationResourceImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.koreaiartemis.models.ListWorkspacesResponse; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationProperties; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPropertiesUpdate; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResource; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResourceUpdate; +import java.util.Collections; +import java.util.Map; + +public final class OrganizationResourceImpl + implements OrganizationResource, OrganizationResource.Definition, OrganizationResource.Update { + private OrganizationResourceInner innerObject; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OrganizationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OrganizationResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String organizationName; + + private OrganizationResourceUpdate updateProperties; + + public OrganizationResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public OrganizationResource create() { + this.innerObject = serviceManager.serviceClient() + .getOrganizations() + .create(resourceGroupName, organizationName, this.innerModel(), Context.NONE); + return this; + } + + public OrganizationResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizations() + .create(resourceGroupName, organizationName, this.innerModel(), context); + return this; + } + + OrganizationResourceImpl(String name, com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerObject = new OrganizationResourceInner(); + this.serviceManager = serviceManager; + this.organizationName = name; + } + + public OrganizationResourceImpl update() { + this.updateProperties = new OrganizationResourceUpdate(); + return this; + } + + public OrganizationResource apply() { + this.innerObject = serviceManager.serviceClient() + .getOrganizations() + .update(resourceGroupName, organizationName, updateProperties, Context.NONE); + return this; + } + + public OrganizationResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizations() + .update(resourceGroupName, organizationName, updateProperties, context); + return this; + } + + OrganizationResourceImpl(OrganizationResourceInner innerObject, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.organizationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "organizations"); + } + + public OrganizationResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getOrganizations() + .getByResourceGroupWithResponse(resourceGroupName, organizationName, Context.NONE) + .getValue(); + return this; + } + + public OrganizationResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizations() + .getByResourceGroupWithResponse(resourceGroupName, organizationName, context) + .getValue(); + return this; + } + + public Response listWorkspacesWithResponse(Context context) { + return serviceManager.organizations().listWorkspacesWithResponse(resourceGroupName, organizationName, context); + } + + public ListWorkspacesResponse listWorkspaces() { + return serviceManager.organizations().listWorkspaces(resourceGroupName, organizationName); + } + + public OrganizationResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public OrganizationResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public OrganizationResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public OrganizationResourceImpl withProperties(OrganizationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public OrganizationResourceImpl withProperties(OrganizationPropertiesUpdate properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsClientImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsClientImpl.java new file mode 100644 index 0000000000000..fe5273ca2d04d --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsClientImpl.java @@ -0,0 +1,1285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.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.Headers; +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.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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient; +import com.azure.resourcemanager.koreaiartemis.fluent.models.ListWorkspacesResponseInner; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.koreaiartemis.implementation.models.OrganizationResourceListResult; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResourceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OrganizationsClient. + */ +public final class OrganizationsClientImpl implements OrganizationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OrganizationsService service; + + /** + * The service client containing this operation class. + */ + private final KoreAIArtemisManagementClientImpl client; + + /** + * Initializes an instance of OrganizationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OrganizationsClientImpl(KoreAIArtemisManagementClientImpl client) { + this.service + = RestProxy.create(OrganizationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KoreAIArtemisManagementClientOrganizations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "KoreAIArtemisManagementClientOrganizations") + public interface OrganizationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") OrganizationResourceInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") OrganizationResourceInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") OrganizationResourceUpdate properties, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") OrganizationResourceUpdate properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Kore.AgentPlatform/organizations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Kore.AgentPlatform/organizations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/listWorkspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listWorkspaces(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/listWorkspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listWorkspacesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String organizationName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String organizationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, organizationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String organizationName, Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, accept, context); + } + + /** + * Get an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner getByResourceGroup(String resourceGroupName, String organizationName) { + return getByResourceGroupWithResponse(resourceGroupName, organizationName, Context.NONE).getValue(); + } + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String organizationName, + OrganizationResourceInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String organizationName, + OrganizationResourceInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String organizationName, + OrganizationResourceInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, contentType, accept, resource, + context); + } + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationResourceInner> + beginCreateAsync(String resourceGroupName, String organizationName, OrganizationResourceInner resource) { + Mono>> mono = createWithResponseAsync(resourceGroupName, organizationName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationResourceInner.class, OrganizationResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationResourceInner> + beginCreate(String resourceGroupName, String organizationName, OrganizationResourceInner resource) { + Response response = createWithResponse(resourceGroupName, organizationName, resource); + return this.client.getLroResult(response, + OrganizationResourceInner.class, OrganizationResourceInner.class, Context.NONE); + } + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationResourceInner> beginCreate( + String resourceGroupName, String organizationName, OrganizationResourceInner resource, Context context) { + Response response = createWithResponse(resourceGroupName, organizationName, resource, context); + return this.client.getLroResult(response, + OrganizationResourceInner.class, OrganizationResourceInner.class, context); + } + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String organizationName, + OrganizationResourceInner resource) { + return beginCreateAsync(resourceGroupName, organizationName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner create(String resourceGroupName, String organizationName, + OrganizationResourceInner resource) { + return beginCreate(resourceGroupName, organizationName, resource).getFinalResult(); + } + + /** + * Create or update an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner create(String resourceGroupName, String organizationName, + OrganizationResourceInner resource, Context context) { + return beginCreate(resourceGroupName, organizationName, resource, context).getFinalResult(); + } + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String organizationName, + OrganizationResourceUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, contentType, accept, properties, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String organizationName, + OrganizationResourceUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, contentType, accept, properties, + Context.NONE); + } + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String organizationName, + OrganizationResourceUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, contentType, accept, properties, + context); + } + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationResourceInner> + beginUpdateAsync(String resourceGroupName, String organizationName, OrganizationResourceUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, organizationName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationResourceInner.class, OrganizationResourceInner.class, + this.client.getContext()); + } + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationResourceInner> + beginUpdate(String resourceGroupName, String organizationName, OrganizationResourceUpdate properties) { + Response response = updateWithResponse(resourceGroupName, organizationName, properties); + return this.client.getLroResult(response, + OrganizationResourceInner.class, OrganizationResourceInner.class, Context.NONE); + } + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationResourceInner> beginUpdate( + String resourceGroupName, String organizationName, OrganizationResourceUpdate properties, Context context) { + Response response = updateWithResponse(resourceGroupName, organizationName, properties, context); + return this.client.getLroResult(response, + OrganizationResourceInner.class, OrganizationResourceInner.class, context); + } + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String organizationName, + OrganizationResourceUpdate properties) { + return beginUpdateAsync(resourceGroupName, organizationName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner update(String resourceGroupName, String organizationName, + OrganizationResourceUpdate properties) { + return beginUpdate(resourceGroupName, organizationName, properties).getFinalResult(); + } + + /** + * Update mutable properties of an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization resource in the Kore.AgentPlatform provider. + * + * Top-level tracked ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner update(String resourceGroupName, String organizationName, + OrganizationResourceUpdate properties, Context context) { + return beginUpdate(resourceGroupName, organizationName, properties, context).getFinalResult(); + } + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String organizationName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String organizationName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, Context.NONE); + } + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String organizationName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, context); + } + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String organizationName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, organizationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName) { + Response response = deleteWithResponse(resourceGroupName, organizationName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, organizationName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String organizationName) { + return beginDeleteAsync(resourceGroupName, organizationName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String organizationName) { + beginDelete(resourceGroupName, organizationName).getFinalResult(); + } + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String organizationName, Context context) { + beginDelete(resourceGroupName, organizationName, context).getFinalResult(); + } + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * List Organizations in a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Organizations in a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Organizations in a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Organizations in a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Organizations in a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List Organizations in a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkspacesWithResponseAsync(String resourceGroupName, + String organizationName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listWorkspaces(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listWorkspacesAsync(String resourceGroupName, String organizationName) { + return listWorkspacesWithResponseAsync(resourceGroupName, organizationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWorkspacesWithResponse(String resourceGroupName, + String organizationName, Context context) { + final String accept = "application/json"; + return service.listWorkspacesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, accept, context); + } + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListWorkspacesResponseInner listWorkspaces(String resourceGroupName, String organizationName) { + return listWorkspacesWithResponse(resourceGroupName, organizationName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsImpl.java new file mode 100644 index 0000000000000..943c71c537a53 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient; +import com.azure.resourcemanager.koreaiartemis.fluent.models.ListWorkspacesResponseInner; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.koreaiartemis.models.ListWorkspacesResponse; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResource; +import com.azure.resourcemanager.koreaiartemis.models.Organizations; + +public final class OrganizationsImpl implements Organizations { + private static final ClientLogger LOGGER = new ClientLogger(OrganizationsImpl.class); + + private final OrganizationsClient innerClient; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + public OrganizationsImpl(OrganizationsClient innerClient, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String organizationName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, organizationName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OrganizationResourceImpl(inner.getValue(), this.manager())); + } + + public OrganizationResource getByResourceGroup(String resourceGroupName, String organizationName) { + OrganizationResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, organizationName); + if (inner != null) { + return new OrganizationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String organizationName) { + this.serviceClient().delete(resourceGroupName, organizationName); + } + + public void delete(String resourceGroupName, String organizationName, Context context) { + this.serviceClient().delete(resourceGroupName, organizationName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationResourceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationResourceImpl(inner1, this.manager())); + } + + public Response listWorkspacesWithResponse(String resourceGroupName, + String organizationName, Context context) { + Response inner + = this.serviceClient().listWorkspacesWithResponse(resourceGroupName, organizationName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListWorkspacesResponseImpl(inner.getValue(), this.manager())); + } + + public ListWorkspacesResponse listWorkspaces(String resourceGroupName, String organizationName) { + ListWorkspacesResponseInner inner = this.serviceClient().listWorkspaces(resourceGroupName, organizationName); + if (inner != null) { + return new ListWorkspacesResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public OrganizationResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, organizationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, organizationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + this.delete(resourceGroupName, organizationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + this.delete(resourceGroupName, organizationName, context); + } + + private OrganizationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } + + public OrganizationResourceImpl define(String name) { + return new OrganizationResourceImpl(name, this.manager()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ResourceManagerUtils.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ResourceManagerUtils.java new file mode 100644 index 0000000000000..2a1e24476493e --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsClientImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsClientImpl.java new file mode 100644 index 0000000000000..4711674d51780 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsClientImpl.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.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.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.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.koreaiartemis.fluent.SaaSOperationGroupsClient; +import com.azure.resourcemanager.koreaiartemis.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.koreaiartemis.models.ActivateSaaSParameterRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SaaSOperationGroupsClient. + */ +public final class SaaSOperationGroupsClientImpl implements SaaSOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SaaSOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final KoreAIArtemisManagementClientImpl client; + + /** + * Initializes an instance of SaaSOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SaaSOperationGroupsClientImpl(KoreAIArtemisManagementClientImpl client) { + this.service = RestProxy.create(SaaSOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KoreAIArtemisManagementClientSaaSOperationGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "KoreAIArtemisManagementClientSaaSOperationGroups") + public interface SaaSOperationGroupsService { + @Post("/subscriptions/{subscriptionId}/providers/Kore.AgentPlatform/activateSaaS") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> activateResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ActivateSaaSParameterRequest body, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Kore.AgentPlatform/activateSaaS") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response activateResourceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ActivateSaaSParameterRequest body, Context context); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> activateResourceWithResponseAsync(ActivateSaaSParameterRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.activateResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response activateResourceWithResponse(ActivateSaaSParameterRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.activateResourceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, body, Context.NONE); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response activateResourceWithResponse(ActivateSaaSParameterRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.activateResourceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, body, context); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SaaSResourceDetailsResponseInner> + beginActivateResourceAsync(ActivateSaaSParameterRequest body) { + Mono>> mono = activateResourceWithResponseAsync(body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SaaSResourceDetailsResponseInner.class, + SaaSResourceDetailsResponseInner.class, this.client.getContext()); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SaaSResourceDetailsResponseInner> + beginActivateResource(ActivateSaaSParameterRequest body) { + Response response = activateResourceWithResponse(body); + return this.client.getLroResult(response, + SaaSResourceDetailsResponseInner.class, SaaSResourceDetailsResponseInner.class, Context.NONE); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SaaSResourceDetailsResponseInner> + beginActivateResource(ActivateSaaSParameterRequest body, Context context) { + Response response = activateResourceWithResponse(body, context); + return this.client.getLroResult(response, + SaaSResourceDetailsResponseInner.class, SaaSResourceDetailsResponseInner.class, context); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono activateResourceAsync(ActivateSaaSParameterRequest body) { + return beginActivateResourceAsync(body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SaaSResourceDetailsResponseInner activateResource(ActivateSaaSParameterRequest body) { + return beginActivateResource(body).getFinalResult(); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SaaSResourceDetailsResponseInner activateResource(ActivateSaaSParameterRequest body, Context context) { + return beginActivateResource(body, context).getFinalResult(); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsImpl.java new file mode 100644 index 0000000000000..e13e46992912a --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.koreaiartemis.fluent.SaaSOperationGroupsClient; +import com.azure.resourcemanager.koreaiartemis.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.koreaiartemis.models.ActivateSaaSParameterRequest; +import com.azure.resourcemanager.koreaiartemis.models.SaaSOperationGroups; +import com.azure.resourcemanager.koreaiartemis.models.SaaSResourceDetailsResponse; + +public final class SaaSOperationGroupsImpl implements SaaSOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(SaaSOperationGroupsImpl.class); + + private final SaaSOperationGroupsClient innerClient; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + public SaaSOperationGroupsImpl(SaaSOperationGroupsClient innerClient, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SaaSResourceDetailsResponse activateResource(ActivateSaaSParameterRequest body) { + SaaSResourceDetailsResponseInner inner = this.serviceClient().activateResource(body); + if (inner != null) { + return new SaaSResourceDetailsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public SaaSResourceDetailsResponse activateResource(ActivateSaaSParameterRequest body, Context context) { + SaaSResourceDetailsResponseInner inner = this.serviceClient().activateResource(body, context); + if (inner != null) { + return new SaaSResourceDetailsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private SaaSOperationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSResourceDetailsResponseImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSResourceDetailsResponseImpl.java new file mode 100644 index 0000000000000..17bbbff861a14 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSResourceDetailsResponseImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.koreaiartemis.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.koreaiartemis.models.SaaSResourceDetailsResponse; + +public final class SaaSResourceDetailsResponseImpl implements SaaSResourceDetailsResponse { + private SaaSResourceDetailsResponseInner innerObject; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + SaaSResourceDetailsResponseImpl(SaaSResourceDetailsResponseInner innerObject, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String saasId() { + return this.innerModel().saasId(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SaaSResourceDetailsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceDetailImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceDetailImpl.java new file mode 100644 index 0000000000000..dae1187134d9c --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceDetailImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceDetailInner; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceDetail; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceDetailPartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLifecycleStatus; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProject; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class WorkspaceDetailImpl implements WorkspaceDetail { + private WorkspaceDetailInner innerObject; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + WorkspaceDetailImpl(WorkspaceDetailInner innerObject, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String azureResourceId() { + return this.innerModel().azureResourceId(); + } + + public String organizationId() { + return this.innerModel().organizationId(); + } + + public WorkspaceDetailPartnerProperties partnerProperties() { + return this.innerModel().partnerProperties(); + } + + public WorkspaceLifecycleStatus status() { + return this.innerModel().status(); + } + + public List projects() { + List inner = this.innerModel().projects(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime createdAt() { + return this.innerModel().createdAt(); + } + + public OffsetDateTime updatedAt() { + return this.innerModel().updatedAt(); + } + + public WorkspaceDetailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceLinkedSaaSListResponseImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceLinkedSaaSListResponseImpl.java new file mode 100644 index 0000000000000..1ad6beeec0e18 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceLinkedSaaSListResponseImpl.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.resourcemanager.koreaiartemis.implementation; + +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceLinkedSaaSListResponseInner; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLinkedSaaSItem; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLinkedSaaSListResponse; +import java.util.Collections; +import java.util.List; + +public final class WorkspaceLinkedSaaSListResponseImpl implements WorkspaceLinkedSaaSListResponse { + private WorkspaceLinkedSaaSListResponseInner innerObject; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + WorkspaceLinkedSaaSListResponseImpl(WorkspaceLinkedSaaSListResponseInner innerObject, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public WorkspaceLinkedSaaSListResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceResourceImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceResourceImpl.java new file mode 100644 index 0000000000000..bea184287e639 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceResourceImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceResourceInner; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceDetail; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLinkedSaaSListResponse; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceResource; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceSaaSData; + +public final class WorkspaceResourceImpl + implements WorkspaceResource, WorkspaceResource.Definition, WorkspaceResource.Update { + private WorkspaceResourceInner innerObject; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public WorkspaceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public WorkspaceResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String organizationName; + + private String workspaceName; + + public WorkspaceResourceImpl withExistingOrganization(String resourceGroupName, String organizationName) { + this.resourceGroupName = resourceGroupName; + this.organizationName = organizationName; + return this; + } + + public WorkspaceResource create() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, organizationName, workspaceName, this.innerModel(), Context.NONE); + return this; + } + + public WorkspaceResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, organizationName, workspaceName, this.innerModel(), context); + return this; + } + + WorkspaceResourceImpl(String name, com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerObject = new WorkspaceResourceInner(); + this.serviceManager = serviceManager; + this.workspaceName = name; + } + + public WorkspaceResourceImpl update() { + return this; + } + + public WorkspaceResource apply() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, organizationName, workspaceName, this.innerModel(), Context.NONE); + return this; + } + + public WorkspaceResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, organizationName, workspaceName, this.innerModel(), context); + return this; + } + + WorkspaceResourceImpl(WorkspaceResourceInner innerObject, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.organizationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "organizations"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + } + + public WorkspaceResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .getWithResponse(resourceGroupName, organizationName, workspaceName, Context.NONE) + .getValue(); + return this; + } + + public WorkspaceResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .getWithResponse(resourceGroupName, organizationName, workspaceName, context) + .getValue(); + return this; + } + + public void linkSaaS(WorkspaceSaaSData body) { + serviceManager.workspaces().linkSaaS(resourceGroupName, organizationName, workspaceName, body); + } + + public void linkSaaS(WorkspaceSaaSData body, Context context) { + serviceManager.workspaces().linkSaaS(resourceGroupName, organizationName, workspaceName, body, context); + } + + public Response listLinkedSaaSWithResponse(Context context) { + return serviceManager.workspaces() + .listLinkedSaaSWithResponse(resourceGroupName, organizationName, workspaceName, context); + } + + public WorkspaceLinkedSaaSListResponse listLinkedSaaS() { + return serviceManager.workspaces().listLinkedSaaS(resourceGroupName, organizationName, workspaceName); + } + + public Response getDetailsWithResponse(Context context) { + return serviceManager.workspaces() + .getDetailsWithResponse(resourceGroupName, organizationName, workspaceName, context); + } + + public WorkspaceDetail getDetails() { + return serviceManager.workspaces().getDetails(resourceGroupName, organizationName, workspaceName); + } + + public WorkspaceResourceImpl withProperties(WorkspaceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesClientImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesClientImpl.java new file mode 100644 index 0000000000000..0dc70cdb96fbe --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesClientImpl.java @@ -0,0 +1,1212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.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.Headers; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceDetailInner; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceLinkedSaaSListResponseInner; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceResourceInner; +import com.azure.resourcemanager.koreaiartemis.implementation.models.WorkspaceResourceListResult; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceSaaSData; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WorkspacesClient. + */ +public final class WorkspacesClientImpl implements WorkspacesClient { + /** + * The proxy service used to perform REST calls. + */ + private final WorkspacesService service; + + /** + * The service client containing this operation class. + */ + private final KoreAIArtemisManagementClientImpl client; + + /** + * Initializes an instance of WorkspacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspacesClientImpl(KoreAIArtemisManagementClientImpl client) { + this.service + = RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KoreAIArtemisManagementClientWorkspaces to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "KoreAIArtemisManagementClientWorkspaces") + public interface WorkspacesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceResourceInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceResourceInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOrganization(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByOrganizationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}/linkSaaS") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> linkSaaS(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") WorkspaceSaaSData body, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}/linkSaaS") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response linkSaaSSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") WorkspaceSaaSData body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}/listLinkedSaaS") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLinkedSaaS(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}/listLinkedSaaS") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listLinkedSaaSSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}/getWorkspaceDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDetails(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Kore.AgentPlatform/organizations/{organizationName}/workspaces/{workspaceName}/getWorkspaceDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getDetailsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOrganizationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByOrganizationNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Workspace under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String organizationName, String workspaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Workspace under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String organizationName, + String workspaceName) { + return getWithResponseAsync(resourceGroupName, organizationName, workspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Workspace under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String organizationName, + String workspaceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, organizationName, workspaceName, accept, context); + } + + /** + * Get a Workspace under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceResourceInner get(String resourceGroupName, String organizationName, String workspaceName) { + return getWithResponse(resourceGroupName, organizationName, workspaceName, Context.NONE).getValue(); + } + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String organizationName, String workspaceName, WorkspaceResourceInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, contentType, + accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceResourceInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, contentType, accept, + resource, Context.NONE); + } + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceResourceInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, contentType, accept, + resource, context); + } + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WorkspaceResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String organizationName, String workspaceName, WorkspaceResourceInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, organizationName, workspaceName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WorkspaceResourceInner.class, WorkspaceResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WorkspaceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String organizationName, String workspaceName, WorkspaceResourceInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, organizationName, workspaceName, resource); + return this.client.getLroResult(response, + WorkspaceResourceInner.class, WorkspaceResourceInner.class, Context.NONE); + } + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WorkspaceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String organizationName, String workspaceName, WorkspaceResourceInner resource, + Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, organizationName, workspaceName, resource, context); + return this.client.getLroResult(response, + WorkspaceResourceInner.class, WorkspaceResourceInner.class, context); + } + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, organizationName, workspaceName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceResourceInner createOrUpdate(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceResourceInner resource) { + return beginCreateOrUpdate(resourceGroupName, organizationName, workspaceName, resource).getFinalResult(); + } + + /** + * Create or update a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace resource in the Kore.AgentPlatform provider. + * + * Child proxy resource type under an Organization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceResourceInner createOrUpdate(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceResourceInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, organizationName, workspaceName, resource, context) + .getFinalResult(); + } + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String organizationName, + String workspaceName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String organizationName, + String workspaceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, Context.NONE); + } + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String organizationName, + String workspaceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, context); + } + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String organizationName, + String workspaceName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, organizationName, workspaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String workspaceName) { + Response response = deleteWithResponse(resourceGroupName, organizationName, workspaceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String workspaceName, Context context) { + Response response = deleteWithResponse(resourceGroupName, organizationName, workspaceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String organizationName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, organizationName, workspaceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String organizationName, String workspaceName) { + beginDelete(resourceGroupName, organizationName, workspaceName).getFinalResult(); + } + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String organizationName, String workspaceName, Context context) { + beginDelete(resourceGroupName, organizationName, workspaceName, context).getFinalResult(); + } + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOrganizationSinglePageAsync(String resourceGroupName, + String organizationName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByOrganization(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOrganizationAsync(String resourceGroupName, + String organizationName) { + return new PagedFlux<>(() -> listByOrganizationSinglePageAsync(resourceGroupName, organizationName), + nextLink -> listByOrganizationNextSinglePageAsync(nextLink)); + } + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByOrganizationSinglePage(String resourceGroupName, + String organizationName) { + final String accept = "application/json"; + Response res + = service.listByOrganizationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByOrganizationSinglePage(String resourceGroupName, + String organizationName, Context context) { + final String accept = "application/json"; + Response res + = service.listByOrganizationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOrganization(String resourceGroupName, String organizationName) { + return new PagedIterable<>(() -> listByOrganizationSinglePage(resourceGroupName, organizationName), + nextLink -> listByOrganizationNextSinglePage(nextLink)); + } + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOrganization(String resourceGroupName, String organizationName, + Context context) { + return new PagedIterable<>(() -> listByOrganizationSinglePage(resourceGroupName, organizationName, context), + nextLink -> listByOrganizationNextSinglePage(nextLink, context)); + } + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> linkSaaSWithResponseAsync(String resourceGroupName, + String organizationName, String workspaceName, WorkspaceSaaSData body) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.linkSaaS(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, contentType, body, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response linkSaaSWithResponse(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceSaaSData body) { + final String contentType = "application/json"; + return service.linkSaaSSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, contentType, body, + Context.NONE); + } + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response linkSaaSWithResponse(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceSaaSData body, Context context) { + final String contentType = "application/json"; + return service.linkSaaSSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, contentType, body, + context); + } + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginLinkSaaSAsync(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceSaaSData body) { + Mono>> mono + = linkSaaSWithResponseAsync(resourceGroupName, organizationName, workspaceName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginLinkSaaS(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceSaaSData body) { + Response response = linkSaaSWithResponse(resourceGroupName, organizationName, workspaceName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginLinkSaaS(String resourceGroupName, String organizationName, + String workspaceName, WorkspaceSaaSData body, Context context) { + Response response + = linkSaaSWithResponse(resourceGroupName, organizationName, workspaceName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono linkSaaSAsync(String resourceGroupName, String organizationName, String workspaceName, + WorkspaceSaaSData body) { + return beginLinkSaaSAsync(resourceGroupName, organizationName, workspaceName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void linkSaaS(String resourceGroupName, String organizationName, String workspaceName, + WorkspaceSaaSData body) { + beginLinkSaaS(resourceGroupName, organizationName, workspaceName, body).getFinalResult(); + } + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void linkSaaS(String resourceGroupName, String organizationName, String workspaceName, + WorkspaceSaaSData body, Context context) { + beginLinkSaaS(resourceGroupName, organizationName, workspaceName, body, context).getFinalResult(); + } + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listLinkedSaaSWithResponseAsync(String resourceGroupName, String organizationName, String workspaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listLinkedSaaS(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listLinkedSaaSAsync(String resourceGroupName, + String organizationName, String workspaceName) { + return listLinkedSaaSWithResponseAsync(resourceGroupName, organizationName, workspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listLinkedSaaSWithResponse(String resourceGroupName, + String organizationName, String workspaceName, Context context) { + final String accept = "application/json"; + return service.listLinkedSaaSSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, accept, context); + } + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceLinkedSaaSListResponseInner listLinkedSaaS(String resourceGroupName, String organizationName, + String workspaceName) { + return listLinkedSaaSWithResponse(resourceGroupName, organizationName, workspaceName, Context.NONE).getValue(); + } + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDetailsWithResponseAsync(String resourceGroupName, + String organizationName, String workspaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDetailsAsync(String resourceGroupName, String organizationName, + String workspaceName) { + return getDetailsWithResponseAsync(resourceGroupName, organizationName, workspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDetailsWithResponse(String resourceGroupName, String organizationName, + String workspaceName, Context context) { + final String accept = "application/json"; + return service.getDetailsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, workspaceName, accept, context); + } + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceDetailInner getDetails(String resourceGroupName, String organizationName, String workspaceName) { + return getDetailsWithResponse(resourceGroupName, organizationName, workspaceName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOrganizationNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByOrganizationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByOrganizationNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByOrganizationNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByOrganizationNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByOrganizationNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesImpl.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesImpl.java new file mode 100644 index 0000000000000..e34ab652b7e5c --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceDetailInner; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceLinkedSaaSListResponseInner; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceResourceInner; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceDetail; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLinkedSaaSListResponse; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceResource; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceSaaSData; +import com.azure.resourcemanager.koreaiartemis.models.Workspaces; + +public final class WorkspacesImpl implements Workspaces { + private static final ClientLogger LOGGER = new ClientLogger(WorkspacesImpl.class); + + private final WorkspacesClient innerClient; + + private final com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager; + + public WorkspacesImpl(WorkspacesClient innerClient, + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String organizationName, + String workspaceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, organizationName, workspaceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceResourceImpl(inner.getValue(), this.manager())); + } + + public WorkspaceResource get(String resourceGroupName, String organizationName, String workspaceName) { + WorkspaceResourceInner inner = this.serviceClient().get(resourceGroupName, organizationName, workspaceName); + if (inner != null) { + return new WorkspaceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String organizationName, String workspaceName) { + this.serviceClient().delete(resourceGroupName, organizationName, workspaceName); + } + + public void delete(String resourceGroupName, String organizationName, String workspaceName, Context context) { + this.serviceClient().delete(resourceGroupName, organizationName, workspaceName, context); + } + + public PagedIterable listByOrganization(String resourceGroupName, String organizationName) { + PagedIterable inner + = this.serviceClient().listByOrganization(resourceGroupName, organizationName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByOrganization(String resourceGroupName, String organizationName, + Context context) { + PagedIterable inner + = this.serviceClient().listByOrganization(resourceGroupName, organizationName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceResourceImpl(inner1, this.manager())); + } + + public void linkSaaS(String resourceGroupName, String organizationName, String workspaceName, + WorkspaceSaaSData body) { + this.serviceClient().linkSaaS(resourceGroupName, organizationName, workspaceName, body); + } + + public void linkSaaS(String resourceGroupName, String organizationName, String workspaceName, + WorkspaceSaaSData body, Context context) { + this.serviceClient().linkSaaS(resourceGroupName, organizationName, workspaceName, body, context); + } + + public Response listLinkedSaaSWithResponse(String resourceGroupName, + String organizationName, String workspaceName, Context context) { + Response inner = this.serviceClient() + .listLinkedSaaSWithResponse(resourceGroupName, organizationName, workspaceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceLinkedSaaSListResponseImpl(inner.getValue(), this.manager())); + } + + public WorkspaceLinkedSaaSListResponse listLinkedSaaS(String resourceGroupName, String organizationName, + String workspaceName) { + WorkspaceLinkedSaaSListResponseInner inner + = this.serviceClient().listLinkedSaaS(resourceGroupName, organizationName, workspaceName); + if (inner != null) { + return new WorkspaceLinkedSaaSListResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDetailsWithResponse(String resourceGroupName, String organizationName, + String workspaceName, Context context) { + Response inner + = this.serviceClient().getDetailsWithResponse(resourceGroupName, organizationName, workspaceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceDetailImpl(inner.getValue(), this.manager())); + } + + public WorkspaceDetail getDetails(String resourceGroupName, String organizationName, String workspaceName) { + WorkspaceDetailInner inner + = this.serviceClient().getDetails(resourceGroupName, organizationName, workspaceName); + if (inner != null) { + return new WorkspaceDetailImpl(inner, this.manager()); + } else { + return null; + } + } + + public WorkspaceResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + return this.getWithResponse(resourceGroupName, organizationName, workspaceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + return this.getWithResponse(resourceGroupName, organizationName, workspaceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, organizationName, workspaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + this.delete(resourceGroupName, organizationName, workspaceName, context); + } + + private WorkspacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager() { + return this.serviceManager; + } + + public WorkspaceResourceImpl define(String name) { + return new WorkspaceResourceImpl(name, this.manager()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OperationListResult.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OperationListResult.java new file mode 100644 index 0000000000000..b7906f23bc4e9 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation.models; + +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.resourcemanager.koreaiartemis.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult 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 OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OrganizationResourceListResult.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OrganizationResourceListResult.java new file mode 100644 index 0000000000000..a783052b2ee1f --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OrganizationResourceListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation.models; + +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.resourcemanager.koreaiartemis.fluent.models.OrganizationResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a OrganizationResource list operation. + */ +@Immutable +public final class OrganizationResourceListResult implements JsonSerializable { + /* + * The OrganizationResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OrganizationResourceListResult class. + */ + private OrganizationResourceListResult() { + } + + /** + * Get the value property: The OrganizationResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationResourceListResult 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 OrganizationResourceListResult. + */ + public static OrganizationResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationResourceListResult deserializedOrganizationResourceListResult + = new OrganizationResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OrganizationResourceInner.fromJson(reader1)); + deserializedOrganizationResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOrganizationResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceListResult; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/WorkspaceResourceListResult.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/WorkspaceResourceListResult.java new file mode 100644 index 0000000000000..b6eab709d7a89 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/WorkspaceResourceListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.implementation.models; + +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.resourcemanager.koreaiartemis.fluent.models.WorkspaceResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a WorkspaceResource list operation. + */ +@Immutable +public final class WorkspaceResourceListResult implements JsonSerializable { + /* + * The WorkspaceResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WorkspaceResourceListResult class. + */ + private WorkspaceResourceListResult() { + } + + /** + * Get the value property: The WorkspaceResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceResourceListResult 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 WorkspaceResourceListResult. + */ + public static WorkspaceResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceResourceListResult deserializedWorkspaceResourceListResult = new WorkspaceResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WorkspaceResourceInner.fromJson(reader1)); + deserializedWorkspaceResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWorkspaceResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceResourceListResult; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/package-info.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/package-info.java new file mode 100644 index 0000000000000..6798ef790024c --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/package-info.java @@ -0,0 +1,19 @@ +// 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 KoreAIArtemis. + * Kore.AgentPlatform Resource Provider for managing Kore AI Agent Platform + * Organizations and their Workspaces. + * + * Organizations are top-level tracked ARM resources. Each Organization is + * provisioned together with a default Workspace. Additional Workspaces are + * managed as a child proxy resource type under the Organization using the + * standard ARM verbs (PUT / DELETE / GET / LIST) on the workspace URL. + * + * Service-to-service authentication between Liftr and Kore uses federated + * Microsoft Entra credentials and is enforced at the runtime layer + * (not on the ARM surface). + */ +package com.azure.resourcemanager.koreaiartemis.implementation; diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActionType.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActionType.java new file mode 100644 index 0000000000000..c06ad116a5737 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActionType.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActivateSaaSParameterRequest.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActivateSaaSParameterRequest.java new file mode 100644 index 0000000000000..1d11191ceef41 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActivateSaaSParameterRequest.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SaaS guid & PublisherId for Activate and Validate SaaS Resource. + */ +@Fluent +public final class ActivateSaaSParameterRequest implements JsonSerializable { + /* + * SaaS subscription identifier (GUID) issued by the Azure Marketplace fulfillment API. + */ + private String saasGuid; + + /* + * Publisher Id for the marketplace offer. + */ + private String publisherId; + + /** + * Creates an instance of ActivateSaaSParameterRequest class. + */ + public ActivateSaaSParameterRequest() { + } + + /** + * Get the saasGuid property: SaaS subscription identifier (GUID) issued by the Azure Marketplace fulfillment API. + * + * @return the saasGuid value. + */ + public String saasGuid() { + return this.saasGuid; + } + + /** + * Set the saasGuid property: SaaS subscription identifier (GUID) issued by the Azure Marketplace fulfillment API. + * + * @param saasGuid the saasGuid value to set. + * @return the ActivateSaaSParameterRequest object itself. + */ + public ActivateSaaSParameterRequest withSaasGuid(String saasGuid) { + this.saasGuid = saasGuid; + return this; + } + + /** + * Get the publisherId property: Publisher Id for the marketplace offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Publisher Id for the marketplace offer. + * + * @param publisherId the publisherId value to set. + * @return the ActivateSaaSParameterRequest object itself. + */ + public ActivateSaaSParameterRequest withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("saasGuid", this.saasGuid); + jsonWriter.writeStringField("publisherId", this.publisherId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivateSaaSParameterRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivateSaaSParameterRequest 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 ActivateSaaSParameterRequest. + */ + public static ActivateSaaSParameterRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivateSaaSParameterRequest deserializedActivateSaaSParameterRequest = new ActivateSaaSParameterRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saasGuid".equals(fieldName)) { + deserializedActivateSaaSParameterRequest.saasGuid = reader.getString(); + } else if ("publisherId".equals(fieldName)) { + deserializedActivateSaaSParameterRequest.publisherId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActivateSaaSParameterRequest; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/CompanyDetails.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/CompanyDetails.java new file mode 100644 index 0000000000000..066ae66798c5d --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/CompanyDetails.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Organization-tier company metadata. + */ +@Fluent +public final class CompanyDetails implements JsonSerializable { + /* + * Company name. + */ + private String companyName; + + /* + * Office address of the company. + */ + private String officeAddress; + + /* + * Country or region of the company. + */ + private String country; + + /* + * Primary domain of the company. + */ + private String domain; + + /* + * Industry or line of business. + */ + private String businessType; + + /* + * Approximate number of employees. + */ + private Integer numberOfEmployees; + + /** + * Creates an instance of CompanyDetails class. + */ + public CompanyDetails() { + } + + /** + * Get the companyName property: Company name. + * + * @return the companyName value. + */ + public String companyName() { + return this.companyName; + } + + /** + * Set the companyName property: Company name. + * + * @param companyName the companyName value to set. + * @return the CompanyDetails object itself. + */ + public CompanyDetails withCompanyName(String companyName) { + this.companyName = companyName; + return this; + } + + /** + * Get the officeAddress property: Office address of the company. + * + * @return the officeAddress value. + */ + public String officeAddress() { + return this.officeAddress; + } + + /** + * Set the officeAddress property: Office address of the company. + * + * @param officeAddress the officeAddress value to set. + * @return the CompanyDetails object itself. + */ + public CompanyDetails withOfficeAddress(String officeAddress) { + this.officeAddress = officeAddress; + return this; + } + + /** + * Get the country property: Country or region of the company. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: Country or region of the company. + * + * @param country the country value to set. + * @return the CompanyDetails object itself. + */ + public CompanyDetails withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the domain property: Primary domain of the company. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: Primary domain of the company. + * + * @param domain the domain value to set. + * @return the CompanyDetails object itself. + */ + public CompanyDetails withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the businessType property: Industry or line of business. + * + * @return the businessType value. + */ + public String businessType() { + return this.businessType; + } + + /** + * Set the businessType property: Industry or line of business. + * + * @param businessType the businessType value to set. + * @return the CompanyDetails object itself. + */ + public CompanyDetails withBusinessType(String businessType) { + this.businessType = businessType; + return this; + } + + /** + * Get the numberOfEmployees property: Approximate number of employees. + * + * @return the numberOfEmployees value. + */ + public Integer numberOfEmployees() { + return this.numberOfEmployees; + } + + /** + * Set the numberOfEmployees property: Approximate number of employees. + * + * @param numberOfEmployees the numberOfEmployees value to set. + * @return the CompanyDetails object itself. + */ + public CompanyDetails withNumberOfEmployees(Integer numberOfEmployees) { + this.numberOfEmployees = numberOfEmployees; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("companyName", this.companyName); + jsonWriter.writeStringField("officeAddress", this.officeAddress); + jsonWriter.writeStringField("country", this.country); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeStringField("businessType", this.businessType); + jsonWriter.writeNumberField("numberOfEmployees", this.numberOfEmployees); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompanyDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompanyDetails 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 CompanyDetails. + */ + public static CompanyDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CompanyDetails deserializedCompanyDetails = new CompanyDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("companyName".equals(fieldName)) { + deserializedCompanyDetails.companyName = reader.getString(); + } else if ("officeAddress".equals(fieldName)) { + deserializedCompanyDetails.officeAddress = reader.getString(); + } else if ("country".equals(fieldName)) { + deserializedCompanyDetails.country = reader.getString(); + } else if ("domain".equals(fieldName)) { + deserializedCompanyDetails.domain = reader.getString(); + } else if ("businessType".equals(fieldName)) { + deserializedCompanyDetails.businessType = reader.getString(); + } else if ("numberOfEmployees".equals(fieldName)) { + deserializedCompanyDetails.numberOfEmployees = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCompanyDetails; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/DefaultWorkspaceProperties.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/DefaultWorkspaceProperties.java new file mode 100644 index 0000000000000..91666c5b0bdc5 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/DefaultWorkspaceProperties.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Properties of the default Workspace created with the Organization. + */ +@Fluent +public final class DefaultWorkspaceProperties implements JsonSerializable { + /* + * Display name of the default Workspace. + */ + private String name; + + /* + * Marketplace product selected for this Workspace. + */ + private Product product; + + /* + * Azure Marketplace SaaS subscriptions linked to this Workspace. + * At least one entry is required. Mutable to support Marketplace-driven + * plan changes. + */ + private List marketplaceDetails; + + /** + * Creates an instance of DefaultWorkspaceProperties class. + */ + public DefaultWorkspaceProperties() { + } + + /** + * Get the name property: Display name of the default Workspace. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Display name of the default Workspace. + * + * @param name the name value to set. + * @return the DefaultWorkspaceProperties object itself. + */ + public DefaultWorkspaceProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the product property: Marketplace product selected for this Workspace. + * + * @return the product value. + */ + public Product product() { + return this.product; + } + + /** + * Set the product property: Marketplace product selected for this Workspace. + * + * @param product the product value to set. + * @return the DefaultWorkspaceProperties object itself. + */ + public DefaultWorkspaceProperties withProduct(Product product) { + this.product = product; + return this; + } + + /** + * Get the marketplaceDetails property: Azure Marketplace SaaS subscriptions linked to this Workspace. + * At least one entry is required. Mutable to support Marketplace-driven + * plan changes. + * + * @return the marketplaceDetails value. + */ + public List marketplaceDetails() { + return this.marketplaceDetails; + } + + /** + * Set the marketplaceDetails property: Azure Marketplace SaaS subscriptions linked to this Workspace. + * At least one entry is required. Mutable to support Marketplace-driven + * plan changes. + * + * @param marketplaceDetails the marketplaceDetails value to set. + * @return the DefaultWorkspaceProperties object itself. + */ + public DefaultWorkspaceProperties withMarketplaceDetails(List marketplaceDetails) { + this.marketplaceDetails = marketplaceDetails; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("marketplaceDetails", this.marketplaceDetails, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("product", this.product == null ? null : this.product.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultWorkspaceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultWorkspaceProperties 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 DefaultWorkspaceProperties. + */ + public static DefaultWorkspaceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultWorkspaceProperties deserializedDefaultWorkspaceProperties = new DefaultWorkspaceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDefaultWorkspaceProperties.name = reader.getString(); + } else if ("marketplaceDetails".equals(fieldName)) { + List marketplaceDetails + = reader.readArray(reader1 -> MarketplaceDetails.fromJson(reader1)); + deserializedDefaultWorkspaceProperties.marketplaceDetails = marketplaceDetails; + } else if ("product".equals(fieldName)) { + deserializedDefaultWorkspaceProperties.product = Product.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultWorkspaceProperties; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/DiscoveredWorkspace.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/DiscoveredWorkspace.java new file mode 100644 index 0000000000000..7480710cd7577 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/DiscoveredWorkspace.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +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; + +/** + * Workspace returned by the Organization listWorkspaces discovery action. + */ +@Immutable +public final class DiscoveredWorkspace implements JsonSerializable { + /* + * Partner-issued Workspace identifier. + */ + private String partnerResourceId; + + /* + * Display name of the Workspace on the partner side. + */ + private String name; + + /* + * Email address of the Workspace owner. + */ + private String ownerEmail; + + /* + * Indicates whether this is the default Workspace created with the Organization. + */ + private Boolean isDefault; + + /* + * Lifecycle status of the Workspace as reported by the Kore partner. + */ + private WorkspaceLifecycleStatus status; + + /* + * Marketplace product selected for this Workspace. + */ + private Product product; + + /* + * Azure Marketplace SaaS subscriptions linked to this Workspace. + */ + private List marketplaceDetails; + + /* + * Indicates whether the Workspace is managed as an ARM resource through Liftr. + */ + private boolean isManagedByLiftr; + + /* + * ARM resource ID when the Workspace is managed through Liftr. + */ + private String armResourceId; + + /** + * Creates an instance of DiscoveredWorkspace class. + */ + private DiscoveredWorkspace() { + } + + /** + * Get the partnerResourceId property: Partner-issued Workspace identifier. + * + * @return the partnerResourceId value. + */ + public String partnerResourceId() { + return this.partnerResourceId; + } + + /** + * Get the name property: Display name of the Workspace on the partner side. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the ownerEmail property: Email address of the Workspace owner. + * + * @return the ownerEmail value. + */ + public String ownerEmail() { + return this.ownerEmail; + } + + /** + * Get the isDefault property: Indicates whether this is the default Workspace created with the Organization. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Get the status property: Lifecycle status of the Workspace as reported by the Kore partner. + * + * @return the status value. + */ + public WorkspaceLifecycleStatus status() { + return this.status; + } + + /** + * Get the product property: Marketplace product selected for this Workspace. + * + * @return the product value. + */ + public Product product() { + return this.product; + } + + /** + * Get the marketplaceDetails property: Azure Marketplace SaaS subscriptions linked to this Workspace. + * + * @return the marketplaceDetails value. + */ + public List marketplaceDetails() { + return this.marketplaceDetails; + } + + /** + * Get the isManagedByLiftr property: Indicates whether the Workspace is managed as an ARM resource through Liftr. + * + * @return the isManagedByLiftr value. + */ + public boolean isManagedByLiftr() { + return this.isManagedByLiftr; + } + + /** + * Get the armResourceId property: ARM resource ID when the Workspace is managed through Liftr. + * + * @return the armResourceId value. + */ + public String armResourceId() { + return this.armResourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("partnerResourceId", this.partnerResourceId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("isManagedByLiftr", this.isManagedByLiftr); + jsonWriter.writeStringField("ownerEmail", this.ownerEmail); + jsonWriter.writeBooleanField("isDefault", this.isDefault); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("product", this.product == null ? null : this.product.toString()); + jsonWriter.writeArrayField("marketplaceDetails", this.marketplaceDetails, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("armResourceId", this.armResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoveredWorkspace from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoveredWorkspace 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 DiscoveredWorkspace. + */ + public static DiscoveredWorkspace fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiscoveredWorkspace deserializedDiscoveredWorkspace = new DiscoveredWorkspace(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("partnerResourceId".equals(fieldName)) { + deserializedDiscoveredWorkspace.partnerResourceId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDiscoveredWorkspace.name = reader.getString(); + } else if ("isManagedByLiftr".equals(fieldName)) { + deserializedDiscoveredWorkspace.isManagedByLiftr = reader.getBoolean(); + } else if ("ownerEmail".equals(fieldName)) { + deserializedDiscoveredWorkspace.ownerEmail = reader.getString(); + } else if ("isDefault".equals(fieldName)) { + deserializedDiscoveredWorkspace.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("status".equals(fieldName)) { + deserializedDiscoveredWorkspace.status = WorkspaceLifecycleStatus.fromString(reader.getString()); + } else if ("product".equals(fieldName)) { + deserializedDiscoveredWorkspace.product = Product.fromString(reader.getString()); + } else if ("marketplaceDetails".equals(fieldName)) { + List marketplaceDetails + = reader.readArray(reader1 -> MarketplaceDetails.fromJson(reader1)); + deserializedDiscoveredWorkspace.marketplaceDetails = marketplaceDetails; + } else if ("armResourceId".equals(fieldName)) { + deserializedDiscoveredWorkspace.armResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiscoveredWorkspace; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ListWorkspacesResponse.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ListWorkspacesResponse.java new file mode 100644 index 0000000000000..03d03bbaf46c9 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ListWorkspacesResponse.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.resourcemanager.koreaiartemis.models; + +import com.azure.resourcemanager.koreaiartemis.fluent.models.ListWorkspacesResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of ListWorkspacesResponse. + */ +public interface ListWorkspacesResponse { + /** + * Gets the value property: Workspaces returned by Kore, including Liftr-managed and partner-managed Workspaces. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.koreaiartemis.fluent.models.ListWorkspacesResponseInner object. + * + * @return the inner object. + */ + ListWorkspacesResponseInner innerModel(); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceDetails.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceDetails.java new file mode 100644 index 0000000000000..b75797a901f0a --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceDetails.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Marketplace details for an organization. + */ +@Fluent +public final class MarketplaceDetails implements JsonSerializable { + /* + * Azure subscription id for the the marketplace offer is purchased from + */ + private String subscriptionId; + + /* + * Marketplace subscription status + */ + private MarketplaceSubscriptionStatus subscriptionStatus; + + /* + * Marketplace SaaS Resource Id + */ + private String saasResourceId; + + /* + * Offer details for the marketplace that is selected by the user + */ + private OfferDetails offerDetails; + + /** + * Creates an instance of MarketplaceDetails class. + */ + public MarketplaceDetails() { + } + + /** + * Get the subscriptionId property: Azure subscription id for the the marketplace offer is purchased from. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Azure subscription id for the the marketplace offer is purchased from. + * + * @param subscriptionId the subscriptionId value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the subscriptionStatus property: Marketplace subscription status. + * + * @return the subscriptionStatus value. + */ + public MarketplaceSubscriptionStatus subscriptionStatus() { + return this.subscriptionStatus; + } + + /** + * Get the saasResourceId property: Marketplace SaaS Resource Id. + * + * @return the saasResourceId value. + */ + public String saasResourceId() { + return this.saasResourceId; + } + + /** + * Set the saasResourceId property: Marketplace SaaS Resource Id. + * + * @param saasResourceId the saasResourceId value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withSaasResourceId(String saasResourceId) { + this.saasResourceId = saasResourceId; + return this; + } + + /** + * Get the offerDetails property: Offer details for the marketplace that is selected by the user. + * + * @return the offerDetails value. + */ + public OfferDetails offerDetails() { + return this.offerDetails; + } + + /** + * Set the offerDetails property: Offer details for the marketplace that is selected by the user. + * + * @param offerDetails the offerDetails value to set. + * @return the MarketplaceDetails object itself. + */ + public MarketplaceDetails withOfferDetails(OfferDetails offerDetails) { + this.offerDetails = offerDetails; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("offerDetails", this.offerDetails); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("saasResourceId", this.saasResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceDetails 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 MarketplaceDetails. + */ + public static MarketplaceDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceDetails deserializedMarketplaceDetails = new MarketplaceDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offerDetails".equals(fieldName)) { + deserializedMarketplaceDetails.offerDetails = OfferDetails.fromJson(reader); + } else if ("subscriptionId".equals(fieldName)) { + deserializedMarketplaceDetails.subscriptionId = reader.getString(); + } else if ("subscriptionStatus".equals(fieldName)) { + deserializedMarketplaceDetails.subscriptionStatus + = MarketplaceSubscriptionStatus.fromString(reader.getString()); + } else if ("saasResourceId".equals(fieldName)) { + deserializedMarketplaceDetails.saasResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceDetails; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceSubscriptionStatus.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceSubscriptionStatus.java new file mode 100644 index 0000000000000..3c67a106caaa2 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceSubscriptionStatus.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Marketplace subscription status of a resource. + */ +public final class MarketplaceSubscriptionStatus extends ExpandableStringEnum { + /** + * Purchased but not yet activated. + */ + public static final MarketplaceSubscriptionStatus PENDING_FULFILLMENT_START = fromString("PendingFulfillmentStart"); + + /** + * Marketplace subscription is activated. + */ + public static final MarketplaceSubscriptionStatus SUBSCRIBED = fromString("Subscribed"); + + /** + * This state indicates that a customer's payment for the Marketplace service was not received. + */ + public static final MarketplaceSubscriptionStatus SUSPENDED = fromString("Suspended"); + + /** + * Customer has cancelled the subscription. + */ + public static final MarketplaceSubscriptionStatus UNSUBSCRIBED = fromString("Unsubscribed"); + + /** + * Creates a new instance of MarketplaceSubscriptionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MarketplaceSubscriptionStatus() { + } + + /** + * Creates or finds a MarketplaceSubscriptionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MarketplaceSubscriptionStatus. + */ + public static MarketplaceSubscriptionStatus fromString(String name) { + return fromString(name, MarketplaceSubscriptionStatus.class); + } + + /** + * Gets known MarketplaceSubscriptionStatus values. + * + * @return known MarketplaceSubscriptionStatus values. + */ + public static Collection values() { + return values(MarketplaceSubscriptionStatus.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OfferDetails.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OfferDetails.java new file mode 100644 index 0000000000000..b51f3a21fe7d0 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OfferDetails.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Offer details for the marketplace that is selected by the user. + */ +@Fluent +public final class OfferDetails implements JsonSerializable { + /* + * Publisher Id for the marketplace offer + */ + private String publisherId; + + /* + * Offer Id for the marketplace offer + */ + private String offerId; + + /* + * Plan Id for the marketplace offer + */ + private String planId; + + /* + * Plan Name for the marketplace offer + */ + private String planName; + + /* + * Plan Display Name for the marketplace offer + */ + private String termUnit; + + /* + * Plan Display Name for the marketplace offer + */ + private String termId; + + /** + * Creates an instance of OfferDetails class. + */ + public OfferDetails() { + } + + /** + * Get the publisherId property: Publisher Id for the marketplace offer. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Publisher Id for the marketplace offer. + * + * @param publisherId the publisherId value to set. + * @return the OfferDetails object itself. + */ + public OfferDetails withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the offerId property: Offer Id for the marketplace offer. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Set the offerId property: Offer Id for the marketplace offer. + * + * @param offerId the offerId value to set. + * @return the OfferDetails object itself. + */ + public OfferDetails withOfferId(String offerId) { + this.offerId = offerId; + return this; + } + + /** + * Get the planId property: Plan Id for the marketplace offer. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: Plan Id for the marketplace offer. + * + * @param planId the planId value to set. + * @return the OfferDetails object itself. + */ + public OfferDetails withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the planName property: Plan Name for the marketplace offer. + * + * @return the planName value. + */ + public String planName() { + return this.planName; + } + + /** + * Set the planName property: Plan Name for the marketplace offer. + * + * @param planName the planName value to set. + * @return the OfferDetails object itself. + */ + public OfferDetails withPlanName(String planName) { + this.planName = planName; + return this; + } + + /** + * Get the termUnit property: Plan Display Name for the marketplace offer. + * + * @return the termUnit value. + */ + public String termUnit() { + return this.termUnit; + } + + /** + * Set the termUnit property: Plan Display Name for the marketplace offer. + * + * @param termUnit the termUnit value to set. + * @return the OfferDetails object itself. + */ + public OfferDetails withTermUnit(String termUnit) { + this.termUnit = termUnit; + return this; + } + + /** + * Get the termId property: Plan Display Name for the marketplace offer. + * + * @return the termId value. + */ + public String termId() { + return this.termId; + } + + /** + * Set the termId property: Plan Display Name for the marketplace offer. + * + * @param termId the termId value to set. + * @return the OfferDetails object itself. + */ + public OfferDetails withTermId(String termId) { + this.termId = termId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisherId", this.publisherId); + jsonWriter.writeStringField("offerId", this.offerId); + jsonWriter.writeStringField("planId", this.planId); + jsonWriter.writeStringField("planName", this.planName); + jsonWriter.writeStringField("termUnit", this.termUnit); + jsonWriter.writeStringField("termId", this.termId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfferDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfferDetails 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 OfferDetails. + */ + public static OfferDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfferDetails deserializedOfferDetails = new OfferDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publisherId".equals(fieldName)) { + deserializedOfferDetails.publisherId = reader.getString(); + } else if ("offerId".equals(fieldName)) { + deserializedOfferDetails.offerId = reader.getString(); + } else if ("planId".equals(fieldName)) { + deserializedOfferDetails.planId = reader.getString(); + } else if ("planName".equals(fieldName)) { + deserializedOfferDetails.planName = reader.getString(); + } else if ("termUnit".equals(fieldName)) { + deserializedOfferDetails.termUnit = reader.getString(); + } else if ("termId".equals(fieldName)) { + deserializedOfferDetails.termId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOfferDetails; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operation.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operation.java new file mode 100644 index 0000000000000..21ea0eb57e65d --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.resourcemanager.koreaiartemis.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.koreaiartemis.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OperationDisplay.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OperationDisplay.java new file mode 100644 index 0000000000000..ff163cd2f382f --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +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; + +/** + * Localized display information for an operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay 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 OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operations.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operations.java new file mode 100644 index 0000000000000..e850c7c1bfae2 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operations.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerProperties.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerProperties.java new file mode 100644 index 0000000000000..bf1096cc0cce3 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerProperties.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Partner-specific (Kore) properties for an Organization. + */ +@Fluent +public final class OrganizationPartnerProperties implements JsonSerializable { + /* + * Display name of the Organization on the partner side. + */ + private String organizationName; + + /* + * Billing contact email address for the Organization. + */ + private String billingEmail; + + /* + * Initial owner email for the Organization. JIT-provisioned by the partner if the user does not already exist. + */ + private String ownerEmail; + + /* + * Default Workspace created atomically with the Organization. + * Required at create time and immutable thereafter. + * After create, manage workspaces (including this default) via the standard + * Workspace child resource operations. + */ + private DefaultWorkspaceProperties defaultWorkspace; + + /* + * Partner-issued Organization identifier (e.g., "org_01..."). + */ + private String partnerResourceId; + + /** + * Creates an instance of OrganizationPartnerProperties class. + */ + public OrganizationPartnerProperties() { + } + + /** + * Get the organizationName property: Display name of the Organization on the partner side. + * + * @return the organizationName value. + */ + public String organizationName() { + return this.organizationName; + } + + /** + * Set the organizationName property: Display name of the Organization on the partner side. + * + * @param organizationName the organizationName value to set. + * @return the OrganizationPartnerProperties object itself. + */ + public OrganizationPartnerProperties withOrganizationName(String organizationName) { + this.organizationName = organizationName; + return this; + } + + /** + * Get the billingEmail property: Billing contact email address for the Organization. + * + * @return the billingEmail value. + */ + public String billingEmail() { + return this.billingEmail; + } + + /** + * Set the billingEmail property: Billing contact email address for the Organization. + * + * @param billingEmail the billingEmail value to set. + * @return the OrganizationPartnerProperties object itself. + */ + public OrganizationPartnerProperties withBillingEmail(String billingEmail) { + this.billingEmail = billingEmail; + return this; + } + + /** + * Get the ownerEmail property: Initial owner email for the Organization. JIT-provisioned by the partner if the user + * does not already exist. + * + * @return the ownerEmail value. + */ + public String ownerEmail() { + return this.ownerEmail; + } + + /** + * Set the ownerEmail property: Initial owner email for the Organization. JIT-provisioned by the partner if the user + * does not already exist. + * + * @param ownerEmail the ownerEmail value to set. + * @return the OrganizationPartnerProperties object itself. + */ + public OrganizationPartnerProperties withOwnerEmail(String ownerEmail) { + this.ownerEmail = ownerEmail; + return this; + } + + /** + * Get the defaultWorkspace property: Default Workspace created atomically with the Organization. + * Required at create time and immutable thereafter. + * After create, manage workspaces (including this default) via the standard + * Workspace child resource operations. + * + * @return the defaultWorkspace value. + */ + public DefaultWorkspaceProperties defaultWorkspace() { + return this.defaultWorkspace; + } + + /** + * Set the defaultWorkspace property: Default Workspace created atomically with the Organization. + * Required at create time and immutable thereafter. + * After create, manage workspaces (including this default) via the standard + * Workspace child resource operations. + * + * @param defaultWorkspace the defaultWorkspace value to set. + * @return the OrganizationPartnerProperties object itself. + */ + public OrganizationPartnerProperties withDefaultWorkspace(DefaultWorkspaceProperties defaultWorkspace) { + this.defaultWorkspace = defaultWorkspace; + return this; + } + + /** + * Get the partnerResourceId property: Partner-issued Organization identifier (e.g., "org_01..."). + * + * @return the partnerResourceId value. + */ + public String partnerResourceId() { + return this.partnerResourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("organizationName", this.organizationName); + jsonWriter.writeStringField("billingEmail", this.billingEmail); + jsonWriter.writeStringField("ownerEmail", this.ownerEmail); + jsonWriter.writeJsonField("defaultWorkspace", this.defaultWorkspace); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationPartnerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationPartnerProperties 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 OrganizationPartnerProperties. + */ + public static OrganizationPartnerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationPartnerProperties deserializedOrganizationPartnerProperties + = new OrganizationPartnerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("organizationName".equals(fieldName)) { + deserializedOrganizationPartnerProperties.organizationName = reader.getString(); + } else if ("billingEmail".equals(fieldName)) { + deserializedOrganizationPartnerProperties.billingEmail = reader.getString(); + } else if ("ownerEmail".equals(fieldName)) { + deserializedOrganizationPartnerProperties.ownerEmail = reader.getString(); + } else if ("defaultWorkspace".equals(fieldName)) { + deserializedOrganizationPartnerProperties.defaultWorkspace + = DefaultWorkspaceProperties.fromJson(reader); + } else if ("partnerResourceId".equals(fieldName)) { + deserializedOrganizationPartnerProperties.partnerResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationPartnerProperties; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerPropertiesUpdate.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerPropertiesUpdate.java new file mode 100644 index 0000000000000..f6bac8eda7d34 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerPropertiesUpdate.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Mutable partner properties for PATCH. + */ +@Fluent +public final class OrganizationPartnerPropertiesUpdate + implements JsonSerializable { + /* + * Display name of the Organization on the partner side. + */ + private String organizationName; + + /* + * Billing contact email address for the Organization. + */ + private String billingEmail; + + /* + * Initial owner email for the Organization. + */ + private String ownerEmail; + + /** + * Creates an instance of OrganizationPartnerPropertiesUpdate class. + */ + public OrganizationPartnerPropertiesUpdate() { + } + + /** + * Get the organizationName property: Display name of the Organization on the partner side. + * + * @return the organizationName value. + */ + public String organizationName() { + return this.organizationName; + } + + /** + * Set the organizationName property: Display name of the Organization on the partner side. + * + * @param organizationName the organizationName value to set. + * @return the OrganizationPartnerPropertiesUpdate object itself. + */ + public OrganizationPartnerPropertiesUpdate withOrganizationName(String organizationName) { + this.organizationName = organizationName; + return this; + } + + /** + * Get the billingEmail property: Billing contact email address for the Organization. + * + * @return the billingEmail value. + */ + public String billingEmail() { + return this.billingEmail; + } + + /** + * Set the billingEmail property: Billing contact email address for the Organization. + * + * @param billingEmail the billingEmail value to set. + * @return the OrganizationPartnerPropertiesUpdate object itself. + */ + public OrganizationPartnerPropertiesUpdate withBillingEmail(String billingEmail) { + this.billingEmail = billingEmail; + return this; + } + + /** + * Get the ownerEmail property: Initial owner email for the Organization. + * + * @return the ownerEmail value. + */ + public String ownerEmail() { + return this.ownerEmail; + } + + /** + * Set the ownerEmail property: Initial owner email for the Organization. + * + * @param ownerEmail the ownerEmail value to set. + * @return the OrganizationPartnerPropertiesUpdate object itself. + */ + public OrganizationPartnerPropertiesUpdate withOwnerEmail(String ownerEmail) { + this.ownerEmail = ownerEmail; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("organizationName", this.organizationName); + jsonWriter.writeStringField("billingEmail", this.billingEmail); + jsonWriter.writeStringField("ownerEmail", this.ownerEmail); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationPartnerPropertiesUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationPartnerPropertiesUpdate 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 OrganizationPartnerPropertiesUpdate. + */ + public static OrganizationPartnerPropertiesUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationPartnerPropertiesUpdate deserializedOrganizationPartnerPropertiesUpdate + = new OrganizationPartnerPropertiesUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("organizationName".equals(fieldName)) { + deserializedOrganizationPartnerPropertiesUpdate.organizationName = reader.getString(); + } else if ("billingEmail".equals(fieldName)) { + deserializedOrganizationPartnerPropertiesUpdate.billingEmail = reader.getString(); + } else if ("ownerEmail".equals(fieldName)) { + deserializedOrganizationPartnerPropertiesUpdate.ownerEmail = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationPartnerPropertiesUpdate; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationProperties.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationProperties.java new file mode 100644 index 0000000000000..ea373f9dcc212 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationProperties.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of a Kore.AgentPlatform Organization. + */ +@Fluent +public final class OrganizationProperties implements JsonSerializable { + /* + * Partner-specific (Kore) Organization properties. + */ + private OrganizationPartnerProperties partnerProperties; + + /* + * Azure customer profile metadata used by the partner for JIT provisioning. + */ + private UserDetails user; + + /* + * Organization-tier company metadata. + */ + private CompanyDetails companyDetails; + + /* + * Single sign-on metadata returned by the partner after Organization creation. + */ + private SingleSignOnProperties singleSignOn; + + /* + * Partner-issued identifier of the default Workspace for this Organization. + */ + private String defaultWorkspaceId; + + /* + * Total count of Workspaces under this Organization. + */ + private Integer workspaceCount; + + /* + * Provisioning state of the resource. + */ + private ResourceProvisioningState provisioningState; + + /** + * Creates an instance of OrganizationProperties class. + */ + public OrganizationProperties() { + } + + /** + * Get the partnerProperties property: Partner-specific (Kore) Organization properties. + * + * @return the partnerProperties value. + */ + public OrganizationPartnerProperties partnerProperties() { + return this.partnerProperties; + } + + /** + * Set the partnerProperties property: Partner-specific (Kore) Organization properties. + * + * @param partnerProperties the partnerProperties value to set. + * @return the OrganizationProperties object itself. + */ + public OrganizationProperties withPartnerProperties(OrganizationPartnerProperties partnerProperties) { + this.partnerProperties = partnerProperties; + return this; + } + + /** + * Get the user property: Azure customer profile metadata used by the partner for JIT provisioning. + * + * @return the user value. + */ + public UserDetails user() { + return this.user; + } + + /** + * Set the user property: Azure customer profile metadata used by the partner for JIT provisioning. + * + * @param user the user value to set. + * @return the OrganizationProperties object itself. + */ + public OrganizationProperties withUser(UserDetails user) { + this.user = user; + return this; + } + + /** + * Get the companyDetails property: Organization-tier company metadata. + * + * @return the companyDetails value. + */ + public CompanyDetails companyDetails() { + return this.companyDetails; + } + + /** + * Set the companyDetails property: Organization-tier company metadata. + * + * @param companyDetails the companyDetails value to set. + * @return the OrganizationProperties object itself. + */ + public OrganizationProperties withCompanyDetails(CompanyDetails companyDetails) { + this.companyDetails = companyDetails; + return this; + } + + /** + * Get the singleSignOn property: Single sign-on metadata returned by the partner after Organization creation. + * + * @return the singleSignOn value. + */ + public SingleSignOnProperties singleSignOn() { + return this.singleSignOn; + } + + /** + * Get the defaultWorkspaceId property: Partner-issued identifier of the default Workspace for this Organization. + * + * @return the defaultWorkspaceId value. + */ + public String defaultWorkspaceId() { + return this.defaultWorkspaceId; + } + + /** + * Get the workspaceCount property: Total count of Workspaces under this Organization. + * + * @return the workspaceCount value. + */ + public Integer workspaceCount() { + return this.workspaceCount; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("partnerProperties", this.partnerProperties); + jsonWriter.writeJsonField("user", this.user); + jsonWriter.writeJsonField("companyDetails", this.companyDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationProperties 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 OrganizationProperties. + */ + public static OrganizationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationProperties deserializedOrganizationProperties = new OrganizationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("partnerProperties".equals(fieldName)) { + deserializedOrganizationProperties.partnerProperties + = OrganizationPartnerProperties.fromJson(reader); + } else if ("user".equals(fieldName)) { + deserializedOrganizationProperties.user = UserDetails.fromJson(reader); + } else if ("companyDetails".equals(fieldName)) { + deserializedOrganizationProperties.companyDetails = CompanyDetails.fromJson(reader); + } else if ("singleSignOn".equals(fieldName)) { + deserializedOrganizationProperties.singleSignOn = SingleSignOnProperties.fromJson(reader); + } else if ("defaultWorkspaceId".equals(fieldName)) { + deserializedOrganizationProperties.defaultWorkspaceId = reader.getString(); + } else if ("workspaceCount".equals(fieldName)) { + deserializedOrganizationProperties.workspaceCount = reader.getNullable(JsonReader::getInt); + } else if ("provisioningState".equals(fieldName)) { + deserializedOrganizationProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationProperties; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPropertiesUpdate.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPropertiesUpdate.java new file mode 100644 index 0000000000000..3af6a38398991 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPropertiesUpdate.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Mutable Organization properties (subset of OrganizationProperties). + */ +@Fluent +public final class OrganizationPropertiesUpdate implements JsonSerializable { + /* + * Partner-specific (Kore) Organization properties. + */ + private OrganizationPartnerPropertiesUpdate partnerProperties; + + /* + * Azure customer profile metadata. + */ + private UserDetails user; + + /* + * Organization-tier company metadata. + */ + private CompanyDetails companyDetails; + + /** + * Creates an instance of OrganizationPropertiesUpdate class. + */ + public OrganizationPropertiesUpdate() { + } + + /** + * Get the partnerProperties property: Partner-specific (Kore) Organization properties. + * + * @return the partnerProperties value. + */ + public OrganizationPartnerPropertiesUpdate partnerProperties() { + return this.partnerProperties; + } + + /** + * Set the partnerProperties property: Partner-specific (Kore) Organization properties. + * + * @param partnerProperties the partnerProperties value to set. + * @return the OrganizationPropertiesUpdate object itself. + */ + public OrganizationPropertiesUpdate withPartnerProperties(OrganizationPartnerPropertiesUpdate partnerProperties) { + this.partnerProperties = partnerProperties; + return this; + } + + /** + * Get the user property: Azure customer profile metadata. + * + * @return the user value. + */ + public UserDetails user() { + return this.user; + } + + /** + * Set the user property: Azure customer profile metadata. + * + * @param user the user value to set. + * @return the OrganizationPropertiesUpdate object itself. + */ + public OrganizationPropertiesUpdate withUser(UserDetails user) { + this.user = user; + return this; + } + + /** + * Get the companyDetails property: Organization-tier company metadata. + * + * @return the companyDetails value. + */ + public CompanyDetails companyDetails() { + return this.companyDetails; + } + + /** + * Set the companyDetails property: Organization-tier company metadata. + * + * @param companyDetails the companyDetails value to set. + * @return the OrganizationPropertiesUpdate object itself. + */ + public OrganizationPropertiesUpdate withCompanyDetails(CompanyDetails companyDetails) { + this.companyDetails = companyDetails; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("partnerProperties", this.partnerProperties); + jsonWriter.writeJsonField("user", this.user); + jsonWriter.writeJsonField("companyDetails", this.companyDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationPropertiesUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationPropertiesUpdate 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 OrganizationPropertiesUpdate. + */ + public static OrganizationPropertiesUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationPropertiesUpdate deserializedOrganizationPropertiesUpdate = new OrganizationPropertiesUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("partnerProperties".equals(fieldName)) { + deserializedOrganizationPropertiesUpdate.partnerProperties + = OrganizationPartnerPropertiesUpdate.fromJson(reader); + } else if ("user".equals(fieldName)) { + deserializedOrganizationPropertiesUpdate.user = UserDetails.fromJson(reader); + } else if ("companyDetails".equals(fieldName)) { + deserializedOrganizationPropertiesUpdate.companyDetails = CompanyDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationPropertiesUpdate; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResource.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResource.java new file mode 100644 index 0000000000000..6ec55a38a2218 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResource.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OrganizationResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of OrganizationResource. + */ +public interface OrganizationResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + OrganizationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.koreaiartemis.fluent.models.OrganizationResourceInner object. + * + * @return the inner object. + */ + OrganizationResourceInner innerModel(); + + /** + * The entirety of the OrganizationResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The OrganizationResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the OrganizationResource definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the OrganizationResource definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the OrganizationResource definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the OrganizationResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + OrganizationResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OrganizationResource create(Context context); + } + + /** + * The stage of the OrganizationResource definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the OrganizationResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(OrganizationProperties properties); + } + } + + /** + * Begins update for the OrganizationResource resource. + * + * @return the stage of resource update. + */ + OrganizationResource.Update update(); + + /** + * The template for OrganizationResource update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OrganizationResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OrganizationResource apply(Context context); + } + + /** + * The OrganizationResource update stages. + */ + interface UpdateStages { + /** + * The stage of the OrganizationResource update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the OrganizationResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties to update.. + * + * @param properties The resource-specific properties to update. + * @return the next definition stage. + */ + Update withProperties(OrganizationPropertiesUpdate properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OrganizationResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OrganizationResource refresh(Context context); + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization along with {@link Response}. + */ + Response listWorkspacesWithResponse(Context context); + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization. + */ + ListWorkspacesResponse listWorkspaces(); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResourceUpdate.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResourceUpdate.java new file mode 100644 index 0000000000000..8aaeffe7b619b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResourceUpdate.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +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.Map; + +/** + * PATCH body for the Organization resource. + */ +@Fluent +public final class OrganizationResourceUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * The resource-specific properties to update. + */ + private OrganizationPropertiesUpdate properties; + + /** + * Creates an instance of OrganizationResourceUpdate class. + */ + public OrganizationResourceUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the OrganizationResourceUpdate object itself. + */ + public OrganizationResourceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The resource-specific properties to update. + * + * @return the properties value. + */ + public OrganizationPropertiesUpdate properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties to update. + * + * @param properties the properties value to set. + * @return the OrganizationResourceUpdate object itself. + */ + public OrganizationResourceUpdate withProperties(OrganizationPropertiesUpdate properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationResourceUpdate 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 OrganizationResourceUpdate. + */ + public static OrganizationResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationResourceUpdate deserializedOrganizationResourceUpdate = new OrganizationResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationResourceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedOrganizationResourceUpdate.properties = OrganizationPropertiesUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceUpdate; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Organizations.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Organizations.java new file mode 100644 index 0000000000000..db1f0bafef02b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Organizations.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Organizations. + */ +public interface Organizations { + /** + * Get an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String organizationName, + Context context); + + /** + * Get an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization. + */ + OrganizationResource getByResourceGroup(String resourceGroupName, String organizationName); + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String organizationName); + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String organizationName, Context context); + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Organizations in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List Organizations in a Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Organizations in a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization along with {@link Response}. + */ + Response listWorkspacesWithResponse(String resourceGroupName, String organizationName, + Context context); + + /** + * Lists all Workspaces in the Kore Organization, including Workspaces not managed through Liftr. + * + * This discovery operation uses POST because its response combines ARM-tracked + * Workspaces with Kore-only Workspaces that have no ARM resource ID and cannot + * be represented by the standard Workspaces collection GET. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing all Workspaces in a Kore Organization. + */ + ListWorkspacesResponse listWorkspaces(String resourceGroupName, String organizationName); + + /** + * Get an Organization. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization along with {@link Response}. + */ + OrganizationResource getById(String id); + + /** + * Get an Organization. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Organization along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an Organization (long-running). + * + * Permanently removes the Organization and cascades the deletion to all + * child Workspaces at the partner. This operation is irreversible. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OrganizationResource resource. + * + * @param name resource name. + * @return the first stage of the new OrganizationResource definition. + */ + OrganizationResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Origin.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Origin.java new file mode 100644 index 0000000000000..622a6c746c538 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Origin.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Product.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Product.java new file mode 100644 index 0000000000000..31a9ea0f6ca49 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Product.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Marketplace product options available for a Workspace. + */ +public final class Product extends ExpandableStringEnum { + /** + * AI for Work product. <!-- cspell:words aiforservice aiforwork -->. + */ + public static final Product AIFORWORK = fromString("aiforwork"); + + /** + * AI for Service product. + */ + public static final Product AIFORSERVICE = fromString("aiforservice"); + + /** + * Creates a new instance of Product value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Product() { + } + + /** + * Creates or finds a Product from its string representation. + * + * @param name a name to look for. + * @return the corresponding Product. + */ + public static Product fromString(String name) { + return fromString(name, Product.class); + } + + /** + * Gets known Product values. + * + * @return known Product values. + */ + public static Collection values() { + return values(Product.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ResourceProvisioningState.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ResourceProvisioningState.java new file mode 100644 index 0000000000000..0fa8961c6f90b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/ResourceProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of a resource type. + */ +public final class ResourceProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ResourceProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ResourceProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ResourceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceProvisioningState() { + } + + /** + * Creates or finds a ResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProvisioningState. + */ + public static ResourceProvisioningState fromString(String name) { + return fromString(name, ResourceProvisioningState.class); + } + + /** + * Gets known ResourceProvisioningState values. + * + * @return known ResourceProvisioningState values. + */ + public static Collection values() { + return values(ResourceProvisioningState.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSOperationGroups.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSOperationGroups.java new file mode 100644 index 0000000000000..0f6e1e67282df --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSOperationGroups.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of SaaSOperationGroups. + */ +public interface SaaSOperationGroups { + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details. + */ + SaaSResourceDetailsResponse activateResource(ActivateSaaSParameterRequest body); + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details. + */ + SaaSResourceDetailsResponse activateResource(ActivateSaaSParameterRequest body, Context context); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSResourceDetailsResponse.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSResourceDetailsResponse.java new file mode 100644 index 0000000000000..72abe4b06758b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSResourceDetailsResponse.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.koreaiartemis.fluent.models.SaaSResourceDetailsResponseInner; + +/** + * An immutable client-side representation of SaaSResourceDetailsResponse. + */ +public interface SaaSResourceDetailsResponse { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the saasId property: SaaS subscription identifier (GUID) issued by the Azure Marketplace fulfillment API for + * the activated SaaS resource. + * + * @return the saasId value. + */ + String saasId(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.koreaiartemis.fluent.models.SaaSResourceDetailsResponseInner object. + * + * @return the inner object. + */ + SaaSResourceDetailsResponseInner innerModel(); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnProperties.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnProperties.java new file mode 100644 index 0000000000000..2123de9e38a94 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnProperties.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +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; + +/** + * Single Sign-On metadata returned by the partner after Organization creation. + * + * Spreads the standard `LiftrBase.SingleSignOnPropertiesV2` shape + * (`type`, `state`, `enterpriseAppId`, `url`, `aadDomains`). + */ +@Immutable +public final class SingleSignOnProperties implements JsonSerializable { + /* + * Type of Single Sign-On mechanism being used + */ + private SingleSignOnType type; + + /* + * State of the Single Sign On for the resource + */ + private SingleSignOnStates state; + + /* + * AAD enterprise application Id used to setup SSO + */ + private String enterpriseAppId; + + /* + * URL for SSO to be used by the partner to redirect the user to their system + */ + private String url; + + /* + * List of AAD domains fetched from Microsoft Graph for user. + */ + private List aadDomains; + + /** + * Creates an instance of SingleSignOnProperties class. + */ + private SingleSignOnProperties() { + } + + /** + * Get the type property: Type of Single Sign-On mechanism being used. + * + * @return the type value. + */ + public SingleSignOnType type() { + return this.type; + } + + /** + * Get the state property: State of the Single Sign On for the resource. + * + * @return the state value. + */ + public SingleSignOnStates state() { + return this.state; + } + + /** + * Get the enterpriseAppId property: AAD enterprise application Id used to setup SSO. + * + * @return the enterpriseAppId value. + */ + public String enterpriseAppId() { + return this.enterpriseAppId; + } + + /** + * Get the url property: URL for SSO to be used by the partner to redirect the user to their system. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the aadDomains property: List of AAD domains fetched from Microsoft Graph for user. + * + * @return the aadDomains value. + */ + public List aadDomains() { + return this.aadDomains; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("enterpriseAppId", this.enterpriseAppId); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeArrayField("aadDomains", this.aadDomains, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingleSignOnProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingleSignOnProperties 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 SingleSignOnProperties. + */ + public static SingleSignOnProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingleSignOnProperties deserializedSingleSignOnProperties = new SingleSignOnProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSingleSignOnProperties.type = SingleSignOnType.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedSingleSignOnProperties.state = SingleSignOnStates.fromString(reader.getString()); + } else if ("enterpriseAppId".equals(fieldName)) { + deserializedSingleSignOnProperties.enterpriseAppId = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedSingleSignOnProperties.url = reader.getString(); + } else if ("aadDomains".equals(fieldName)) { + List aadDomains = reader.readArray(reader1 -> reader1.getString()); + deserializedSingleSignOnProperties.aadDomains = aadDomains; + } else { + reader.skipChildren(); + } + } + + return deserializedSingleSignOnProperties; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnStates.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnStates.java new file mode 100644 index 0000000000000..4238950c009a1 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnStates.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Various states of the SSO resource. + */ +public final class SingleSignOnStates extends ExpandableStringEnum { + /** + * Initial state of the SSO resource. + */ + public static final SingleSignOnStates INITIAL = fromString("Initial"); + + /** + * State of the SSO resource when it is enabled. + */ + public static final SingleSignOnStates ENABLE = fromString("Enable"); + + /** + * State of the SSO resource when it is disabled. + */ + public static final SingleSignOnStates DISABLE = fromString("Disable"); + + /** + * Creates a new instance of SingleSignOnStates value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SingleSignOnStates() { + } + + /** + * Creates or finds a SingleSignOnStates from its string representation. + * + * @param name a name to look for. + * @return the corresponding SingleSignOnStates. + */ + public static SingleSignOnStates fromString(String name) { + return fromString(name, SingleSignOnStates.class); + } + + /** + * Gets known SingleSignOnStates values. + * + * @return known SingleSignOnStates values. + */ + public static Collection values() { + return values(SingleSignOnStates.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnType.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnType.java new file mode 100644 index 0000000000000..978c9d33f5bab --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnType.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the type of Single Sign-On (SSO) mechanism being used. + */ +public final class SingleSignOnType extends ExpandableStringEnum { + /** + * Security Assertion Markup Language (SAML) based Single Sign-On. + */ + public static final SingleSignOnType SAML = fromString("Saml"); + + /** + * OpenID Connect based Single Sign-On. + */ + public static final SingleSignOnType OPEN_ID = fromString("OpenId"); + + /** + * Creates a new instance of SingleSignOnType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SingleSignOnType() { + } + + /** + * Creates or finds a SingleSignOnType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SingleSignOnType. + */ + public static SingleSignOnType fromString(String name) { + return fromString(name, SingleSignOnType.class); + } + + /** + * Gets known SingleSignOnType values. + * + * @return known SingleSignOnType values. + */ + public static Collection values() { + return values(SingleSignOnType.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/UserDetails.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/UserDetails.java new file mode 100644 index 0000000000000..9fb83699f9492 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/UserDetails.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure customer profile metadata used by the partner for JIT provisioning. + * + * Composes the standard `LiftrBase.UserDetails` (firstName, lastName, + * emailAddress, upn, phoneNumber) with Kore-specific extensions. + */ +@Fluent +public final class UserDetails implements JsonSerializable { + /* + * First name of the user + */ + private String firstName; + + /* + * Last name of the user + */ + private String lastName; + + /* + * Email address of the user + */ + private String emailAddress; + + /* + * User's principal name + */ + private String upn; + + /* + * User's phone number + */ + private String phoneNumber; + + /* + * Alternate email address of the user. + */ + private String alternateEmail; + + /* + * Mailing or office address. + */ + private String address; + + /** + * Creates an instance of UserDetails class. + */ + public UserDetails() { + } + + /** + * Get the firstName property: First name of the user. + * + * @return the firstName value. + */ + public String firstName() { + return this.firstName; + } + + /** + * Set the firstName property: First name of the user. + * + * @param firstName the firstName value to set. + * @return the UserDetails object itself. + */ + public UserDetails withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get the lastName property: Last name of the user. + * + * @return the lastName value. + */ + public String lastName() { + return this.lastName; + } + + /** + * Set the lastName property: Last name of the user. + * + * @param lastName the lastName value to set. + * @return the UserDetails object itself. + */ + public UserDetails withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get the emailAddress property: Email address of the user. + * + * @return the emailAddress value. + */ + public String emailAddress() { + return this.emailAddress; + } + + /** + * Set the emailAddress property: Email address of the user. + * + * @param emailAddress the emailAddress value to set. + * @return the UserDetails object itself. + */ + public UserDetails withEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Get the upn property: User's principal name. + * + * @return the upn value. + */ + public String upn() { + return this.upn; + } + + /** + * Set the upn property: User's principal name. + * + * @param upn the upn value to set. + * @return the UserDetails object itself. + */ + public UserDetails withUpn(String upn) { + this.upn = upn; + return this; + } + + /** + * Get the phoneNumber property: User's phone number. + * + * @return the phoneNumber value. + */ + public String phoneNumber() { + return this.phoneNumber; + } + + /** + * Set the phoneNumber property: User's phone number. + * + * @param phoneNumber the phoneNumber value to set. + * @return the UserDetails object itself. + */ + public UserDetails withPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get the alternateEmail property: Alternate email address of the user. + * + * @return the alternateEmail value. + */ + public String alternateEmail() { + return this.alternateEmail; + } + + /** + * Set the alternateEmail property: Alternate email address of the user. + * + * @param alternateEmail the alternateEmail value to set. + * @return the UserDetails object itself. + */ + public UserDetails withAlternateEmail(String alternateEmail) { + this.alternateEmail = alternateEmail; + return this; + } + + /** + * Get the address property: Mailing or office address. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Mailing or office address. + * + * @param address the address value to set. + * @return the UserDetails object itself. + */ + public UserDetails withAddress(String address) { + this.address = address; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstName", this.firstName); + jsonWriter.writeStringField("lastName", this.lastName); + jsonWriter.writeStringField("emailAddress", this.emailAddress); + jsonWriter.writeStringField("upn", this.upn); + jsonWriter.writeStringField("phoneNumber", this.phoneNumber); + jsonWriter.writeStringField("alternateEmail", this.alternateEmail); + jsonWriter.writeStringField("address", this.address); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDetails 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 UserDetails. + */ + public static UserDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserDetails deserializedUserDetails = new UserDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("firstName".equals(fieldName)) { + deserializedUserDetails.firstName = reader.getString(); + } else if ("lastName".equals(fieldName)) { + deserializedUserDetails.lastName = reader.getString(); + } else if ("emailAddress".equals(fieldName)) { + deserializedUserDetails.emailAddress = reader.getString(); + } else if ("upn".equals(fieldName)) { + deserializedUserDetails.upn = reader.getString(); + } else if ("phoneNumber".equals(fieldName)) { + deserializedUserDetails.phoneNumber = reader.getString(); + } else if ("alternateEmail".equals(fieldName)) { + deserializedUserDetails.alternateEmail = reader.getString(); + } else if ("address".equals(fieldName)) { + deserializedUserDetails.address = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserDetails; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetail.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetail.java new file mode 100644 index 0000000000000..68e7f0c88625b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetail.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceDetailInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of WorkspaceDetail. + */ +public interface WorkspaceDetail { + /** + * Gets the id property: Partner-issued Workspace identifier. + * + * @return the id value. + */ + String id(); + + /** + * Gets the azureResourceId property: Full Azure resource ID of the Workspace. + * + * @return the azureResourceId value. + */ + String azureResourceId(); + + /** + * Gets the organizationId property: Partner-issued identifier of the parent Organization. + * + * @return the organizationId value. + */ + String organizationId(); + + /** + * Gets the partnerProperties property: Partner-specific fields returned by the Workspace details action. + * + * @return the partnerProperties value. + */ + WorkspaceDetailPartnerProperties partnerProperties(); + + /** + * Gets the status property: Lifecycle status of the Workspace. + * + * @return the status value. + */ + WorkspaceLifecycleStatus status(); + + /** + * Gets the projects property: Projects under the Workspace. + * + * @return the projects value. + */ + List projects(); + + /** + * Gets the createdAt property: Time when the partner Workspace was created, as reported by Kore. This is distinct + * from ARM-managed `systemData.createdAt`. + * + * @return the createdAt value. + */ + OffsetDateTime createdAt(); + + /** + * Gets the updatedAt property: Time when the partner Workspace was last updated, as reported by Kore. This is + * distinct from ARM-managed `systemData.lastModifiedAt`. + * + * @return the updatedAt value. + */ + OffsetDateTime updatedAt(); + + /** + * Gets the inner com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceDetailInner object. + * + * @return the inner object. + */ + WorkspaceDetailInner innerModel(); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetailPartnerProperties.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetailPartnerProperties.java new file mode 100644 index 0000000000000..f614eb31e4c43 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetailPartnerProperties.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +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; + +/** + * Partner-specific fields returned by the Workspace details action. + */ +@Immutable +public final class WorkspaceDetailPartnerProperties implements JsonSerializable { + /* + * Workspace display name. + */ + private String name; + + /* + * Email address of the Workspace owner. + */ + private String ownerEmail; + + /* + * Conversation retention period in days. Valid values are 1 through 365. + */ + private int retentionDays; + + /* + * Indicates whether this is the Organization's default Workspace. + */ + private boolean defaultProperty; + + /* + * Marketplace SaaS subscriptions owned by the Workspace. + */ + private List marketplaceDetails; + + /** + * Creates an instance of WorkspaceDetailPartnerProperties class. + */ + private WorkspaceDetailPartnerProperties() { + } + + /** + * Get the name property: Workspace display name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the ownerEmail property: Email address of the Workspace owner. + * + * @return the ownerEmail value. + */ + public String ownerEmail() { + return this.ownerEmail; + } + + /** + * Get the retentionDays property: Conversation retention period in days. Valid values are 1 through 365. + * + * @return the retentionDays value. + */ + public int retentionDays() { + return this.retentionDays; + } + + /** + * Get the defaultProperty property: Indicates whether this is the Organization's default Workspace. + * + * @return the defaultProperty value. + */ + public boolean defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the marketplaceDetails property: Marketplace SaaS subscriptions owned by the Workspace. + * + * @return the marketplaceDetails value. + */ + public List marketplaceDetails() { + return this.marketplaceDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("ownerEmail", this.ownerEmail); + jsonWriter.writeIntField("retentionDays", this.retentionDays); + jsonWriter.writeBooleanField("default", this.defaultProperty); + jsonWriter.writeArrayField("marketplaceDetails", this.marketplaceDetails, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceDetailPartnerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceDetailPartnerProperties 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 WorkspaceDetailPartnerProperties. + */ + public static WorkspaceDetailPartnerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceDetailPartnerProperties deserializedWorkspaceDetailPartnerProperties + = new WorkspaceDetailPartnerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedWorkspaceDetailPartnerProperties.name = reader.getString(); + } else if ("ownerEmail".equals(fieldName)) { + deserializedWorkspaceDetailPartnerProperties.ownerEmail = reader.getString(); + } else if ("retentionDays".equals(fieldName)) { + deserializedWorkspaceDetailPartnerProperties.retentionDays = reader.getInt(); + } else if ("default".equals(fieldName)) { + deserializedWorkspaceDetailPartnerProperties.defaultProperty = reader.getBoolean(); + } else if ("marketplaceDetails".equals(fieldName)) { + List marketplaceDetails + = reader.readArray(reader1 -> WorkspaceMarketplaceDetails.fromJson(reader1)); + deserializedWorkspaceDetailPartnerProperties.marketplaceDetails = marketplaceDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceDetailPartnerProperties; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLifecycleStatus.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLifecycleStatus.java new file mode 100644 index 0000000000000..71a2f50408fb2 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLifecycleStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Lifecycle status of a Workspace as reported by the Kore partner. + */ +public final class WorkspaceLifecycleStatus extends ExpandableStringEnum { + /** + * Workspace is active and operational. + */ + public static final WorkspaceLifecycleStatus ACTIVE = fromString("active"); + + /** + * Workspace is suspended; operations are blocked but resource is retained. + */ + public static final WorkspaceLifecycleStatus SUSPENDED = fromString("suspended"); + + /** + * Workspace is archived (delete pending). + */ + public static final WorkspaceLifecycleStatus ARCHIVED = fromString("archived"); + + /** + * Creates a new instance of WorkspaceLifecycleStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceLifecycleStatus() { + } + + /** + * Creates or finds a WorkspaceLifecycleStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceLifecycleStatus. + */ + public static WorkspaceLifecycleStatus fromString(String name) { + return fromString(name, WorkspaceLifecycleStatus.class); + } + + /** + * Gets known WorkspaceLifecycleStatus values. + * + * @return known WorkspaceLifecycleStatus values. + */ + public static Collection values() { + return values(WorkspaceLifecycleStatus.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSItem.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSItem.java new file mode 100644 index 0000000000000..7d31e1a1c9d6b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSItem.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +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; + +/** + * Individual SaaS resource linked to the Workspace. + */ +@Immutable +public final class WorkspaceLinkedSaaSItem implements JsonSerializable { + /* + * ARM resource ID of the Microsoft.SaaS marketplace resource linked to this Workspace. + */ + private String saaSResourceId; + + /* + * Flag indicating if the SaaS resource is hidden. + */ + private Boolean isHiddenSaaS; + + /** + * Creates an instance of WorkspaceLinkedSaaSItem class. + */ + private WorkspaceLinkedSaaSItem() { + } + + /** + * Get the saaSResourceId property: ARM resource ID of the Microsoft.SaaS marketplace resource linked to this + * Workspace. + * + * @return the saaSResourceId value. + */ + public String saaSResourceId() { + return this.saaSResourceId; + } + + /** + * Get the isHiddenSaaS property: Flag indicating if the SaaS resource is hidden. + * + * @return the isHiddenSaaS value. + */ + public Boolean isHiddenSaaS() { + return this.isHiddenSaaS; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("saaSResourceId", this.saaSResourceId); + jsonWriter.writeBooleanField("isHiddenSaaS", this.isHiddenSaaS); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceLinkedSaaSItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceLinkedSaaSItem 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 WorkspaceLinkedSaaSItem. + */ + public static WorkspaceLinkedSaaSItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceLinkedSaaSItem deserializedWorkspaceLinkedSaaSItem = new WorkspaceLinkedSaaSItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saaSResourceId".equals(fieldName)) { + deserializedWorkspaceLinkedSaaSItem.saaSResourceId = reader.getString(); + } else if ("isHiddenSaaS".equals(fieldName)) { + deserializedWorkspaceLinkedSaaSItem.isHiddenSaaS = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceLinkedSaaSItem; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSListResponse.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSListResponse.java new file mode 100644 index 0000000000000..93bc6bb84d27b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSListResponse.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.resourcemanager.koreaiartemis.models; + +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceLinkedSaaSListResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of WorkspaceLinkedSaaSListResponse. + */ +public interface WorkspaceLinkedSaaSListResponse { + /** + * Gets the value property: List of SaaS resources linked to this Workspace. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceLinkedSaaSListResponseInner object. + * + * @return the inner object. + */ + WorkspaceLinkedSaaSListResponseInner innerModel(); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceDetails.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceDetails.java new file mode 100644 index 0000000000000..6a761b4209f14 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceDetails.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +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; + +/** + * Marketplace SaaS subscription details returned by Kore. + */ +@Immutable +public final class WorkspaceMarketplaceDetails implements JsonSerializable { + /* + * Azure resource ID of the Marketplace SaaS resource. + */ + private String resourceId; + + /* + * Globally unique Marketplace SaaS identifier used for billing. + */ + private String mpId; + + /* + * Plan identifier within the Marketplace offer. + */ + private String planId; + + /* + * Human-readable plan display name. + */ + private String planName; + + /* + * Marketplace offer identifier. + */ + private String offerId; + + /* + * Publisher identifier from Partner Center. + */ + private String publisherId; + + /* + * Marketplace subscription term identifier. + */ + private String termId; + + /* + * Azure Marketplace fulfillment subscription status. + */ + private WorkspaceMarketplaceStatus status; + + /** + * Creates an instance of WorkspaceMarketplaceDetails class. + */ + private WorkspaceMarketplaceDetails() { + } + + /** + * Get the resourceId property: Azure resource ID of the Marketplace SaaS resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the mpId property: Globally unique Marketplace SaaS identifier used for billing. + * + * @return the mpId value. + */ + public String mpId() { + return this.mpId; + } + + /** + * Get the planId property: Plan identifier within the Marketplace offer. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Get the planName property: Human-readable plan display name. + * + * @return the planName value. + */ + public String planName() { + return this.planName; + } + + /** + * Get the offerId property: Marketplace offer identifier. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Get the publisherId property: Publisher identifier from Partner Center. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Get the termId property: Marketplace subscription term identifier. + * + * @return the termId value. + */ + public String termId() { + return this.termId; + } + + /** + * Get the status property: Azure Marketplace fulfillment subscription status. + * + * @return the status value. + */ + public WorkspaceMarketplaceStatus status() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("mpId", this.mpId); + jsonWriter.writeStringField("planId", this.planId); + jsonWriter.writeStringField("offerId", this.offerId); + jsonWriter.writeStringField("planName", this.planName); + jsonWriter.writeStringField("publisherId", this.publisherId); + jsonWriter.writeStringField("termId", this.termId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceMarketplaceDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceMarketplaceDetails 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 WorkspaceMarketplaceDetails. + */ + public static WorkspaceMarketplaceDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceMarketplaceDetails deserializedWorkspaceMarketplaceDetails = new WorkspaceMarketplaceDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedWorkspaceMarketplaceDetails.resourceId = reader.getString(); + } else if ("mpId".equals(fieldName)) { + deserializedWorkspaceMarketplaceDetails.mpId = reader.getString(); + } else if ("planId".equals(fieldName)) { + deserializedWorkspaceMarketplaceDetails.planId = reader.getString(); + } else if ("offerId".equals(fieldName)) { + deserializedWorkspaceMarketplaceDetails.offerId = reader.getString(); + } else if ("planName".equals(fieldName)) { + deserializedWorkspaceMarketplaceDetails.planName = reader.getString(); + } else if ("publisherId".equals(fieldName)) { + deserializedWorkspaceMarketplaceDetails.publisherId = reader.getString(); + } else if ("termId".equals(fieldName)) { + deserializedWorkspaceMarketplaceDetails.termId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedWorkspaceMarketplaceDetails.status + = WorkspaceMarketplaceStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceMarketplaceDetails; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceStatus.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceStatus.java new file mode 100644 index 0000000000000..15403b52e6c8b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceStatus.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Marketplace fulfillment status reported by Kore. + */ +public final class WorkspaceMarketplaceStatus extends ExpandableStringEnum { + /** + * Fulfillment has not started. + */ + public static final WorkspaceMarketplaceStatus PENDING_FULFILLMENT_START = fromString("PendingFulfillmentStart"); + + /** + * The subscription is active. + */ + public static final WorkspaceMarketplaceStatus SUBSCRIBED = fromString("Subscribed"); + + /** + * The subscription is suspended. + */ + public static final WorkspaceMarketplaceStatus SUSPENDED = fromString("Suspended"); + + /** + * The subscription is unsubscribed. + */ + public static final WorkspaceMarketplaceStatus UNSUBSCRIBED = fromString("Unsubscribed"); + + /** + * Creates a new instance of WorkspaceMarketplaceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceMarketplaceStatus() { + } + + /** + * Creates or finds a WorkspaceMarketplaceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceMarketplaceStatus. + */ + public static WorkspaceMarketplaceStatus fromString(String name) { + return fromString(name, WorkspaceMarketplaceStatus.class); + } + + /** + * Gets known WorkspaceMarketplaceStatus values. + * + * @return known WorkspaceMarketplaceStatus values. + */ + public static Collection values() { + return values(WorkspaceMarketplaceStatus.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspacePartnerProperties.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspacePartnerProperties.java new file mode 100644 index 0000000000000..118551080ac40 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspacePartnerProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Partner-specific (Kore) properties for a Workspace. + */ +@Fluent +public final class WorkspacePartnerProperties implements JsonSerializable { + /* + * Display name of the Workspace on the partner side. + */ + private String name; + + /* + * Email address of the Workspace owner. + */ + private String ownerEmail; + + /* + * Partner-issued Workspace identifier (e.g., "ws_01..."). + */ + private String partnerResourceId; + + /** + * Creates an instance of WorkspacePartnerProperties class. + */ + public WorkspacePartnerProperties() { + } + + /** + * Get the name property: Display name of the Workspace on the partner side. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Display name of the Workspace on the partner side. + * + * @param name the name value to set. + * @return the WorkspacePartnerProperties object itself. + */ + public WorkspacePartnerProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ownerEmail property: Email address of the Workspace owner. + * + * @return the ownerEmail value. + */ + public String ownerEmail() { + return this.ownerEmail; + } + + /** + * Set the ownerEmail property: Email address of the Workspace owner. + * + * @param ownerEmail the ownerEmail value to set. + * @return the WorkspacePartnerProperties object itself. + */ + public WorkspacePartnerProperties withOwnerEmail(String ownerEmail) { + this.ownerEmail = ownerEmail; + return this; + } + + /** + * Get the partnerResourceId property: Partner-issued Workspace identifier (e.g., "ws_01..."). + * + * @return the partnerResourceId value. + */ + public String partnerResourceId() { + return this.partnerResourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("ownerEmail", this.ownerEmail); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspacePartnerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspacePartnerProperties 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 WorkspacePartnerProperties. + */ + public static WorkspacePartnerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspacePartnerProperties deserializedWorkspacePartnerProperties = new WorkspacePartnerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedWorkspacePartnerProperties.name = reader.getString(); + } else if ("ownerEmail".equals(fieldName)) { + deserializedWorkspacePartnerProperties.ownerEmail = reader.getString(); + } else if ("partnerResourceId".equals(fieldName)) { + deserializedWorkspacePartnerProperties.partnerResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspacePartnerProperties; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProject.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProject.java new file mode 100644 index 0000000000000..7891062a53760 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProject.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +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; + +/** + * Project summary returned with complete Workspace details. + */ +@Immutable +public final class WorkspaceProject implements JsonSerializable { + /* + * Partner-issued Project identifier. + */ + private String id; + + /* + * Project display name. + */ + private String name; + + /* + * Project description. + */ + private String description; + + /* + * Email address of the user who created the Project. + */ + private String createdBy; + + /* + * Lifecycle status of the Project. + */ + private WorkspaceProjectStatus status; + + /* + * Number of agents in the Project. + */ + private int agentCount; + + /* + * Time when the Project was created. + */ + private OffsetDateTime createdAt; + + /* + * Time when the Project was last updated. + */ + private OffsetDateTime updatedAt; + + /** + * Creates an instance of WorkspaceProject class. + */ + private WorkspaceProject() { + } + + /** + * Get the id property: Partner-issued Project identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Project display name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the description property: Project description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the createdBy property: Email address of the user who created the Project. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Get the status property: Lifecycle status of the Project. + * + * @return the status value. + */ + public WorkspaceProjectStatus status() { + return this.status; + } + + /** + * Get the agentCount property: Number of agents in the Project. + * + * @return the agentCount value. + */ + public int agentCount() { + return this.agentCount; + } + + /** + * Get the createdAt property: Time when the Project was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: Time when the Project was last updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("createdBy", this.createdBy); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeIntField("agentCount", this.agentCount); + jsonWriter.writeStringField("createdAt", + this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); + jsonWriter.writeStringField("updatedAt", + this.updatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedAt)); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceProject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceProject 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 WorkspaceProject. + */ + public static WorkspaceProject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceProject deserializedWorkspaceProject = new WorkspaceProject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceProject.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkspaceProject.name = reader.getString(); + } else if ("createdBy".equals(fieldName)) { + deserializedWorkspaceProject.createdBy = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedWorkspaceProject.status = WorkspaceProjectStatus.fromString(reader.getString()); + } else if ("agentCount".equals(fieldName)) { + deserializedWorkspaceProject.agentCount = reader.getInt(); + } else if ("createdAt".equals(fieldName)) { + deserializedWorkspaceProject.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedAt".equals(fieldName)) { + deserializedWorkspaceProject.updatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedWorkspaceProject.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceProject; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProjectStatus.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProjectStatus.java new file mode 100644 index 0000000000000..0712b9cb781e8 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProjectStatus.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.resourcemanager.koreaiartemis.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Lifecycle status of a Workspace Project. + */ +public final class WorkspaceProjectStatus extends ExpandableStringEnum { + /** + * The Project is active. + */ + public static final WorkspaceProjectStatus ACTIVE = fromString("active"); + + /** + * The Project is under development. + */ + public static final WorkspaceProjectStatus IN_DEVELOPMENT = fromString("in-development"); + + /** + * The Project is deployed. + */ + public static final WorkspaceProjectStatus DEPLOYED = fromString("deployed"); + + /** + * The Project is archived. + */ + public static final WorkspaceProjectStatus ARCHIVED = fromString("archived"); + + /** + * Creates a new instance of WorkspaceProjectStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceProjectStatus() { + } + + /** + * Creates or finds a WorkspaceProjectStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceProjectStatus. + */ + public static WorkspaceProjectStatus fromString(String name) { + return fromString(name, WorkspaceProjectStatus.class); + } + + /** + * Gets known WorkspaceProjectStatus values. + * + * @return known WorkspaceProjectStatus values. + */ + public static Collection values() { + return values(WorkspaceProjectStatus.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProperties.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProperties.java new file mode 100644 index 0000000000000..6bde9bd3f4854 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProperties.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * Properties of a Kore.AgentPlatform Workspace. + */ +@Fluent +public final class WorkspaceProperties implements JsonSerializable { + /* + * Marketplace product selected for this Workspace. + */ + private Product product; + + /* + * Azure Marketplace SaaS subscriptions linked to this Workspace. + * At least one entry is required. Mutable to support Marketplace-driven + * plan changes. + */ + private List marketplaceDetails; + + /* + * Partner-specific (Kore) Workspace properties. + */ + private WorkspacePartnerProperties partnerProperties; + + /* + * Indicates whether this is the default Workspace created with the Organization. + */ + private Boolean isDefault; + + /* + * Lifecycle status of the Workspace as reported by the Kore partner. + */ + private WorkspaceLifecycleStatus status; + + /* + * Provisioning state of the resource. + */ + private ResourceProvisioningState provisioningState; + + /** + * Creates an instance of WorkspaceProperties class. + */ + public WorkspaceProperties() { + } + + /** + * Get the product property: Marketplace product selected for this Workspace. + * + * @return the product value. + */ + public Product product() { + return this.product; + } + + /** + * Set the product property: Marketplace product selected for this Workspace. + * + * @param product the product value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withProduct(Product product) { + this.product = product; + return this; + } + + /** + * Get the marketplaceDetails property: Azure Marketplace SaaS subscriptions linked to this Workspace. + * At least one entry is required. Mutable to support Marketplace-driven + * plan changes. + * + * @return the marketplaceDetails value. + */ + public List marketplaceDetails() { + return this.marketplaceDetails; + } + + /** + * Set the marketplaceDetails property: Azure Marketplace SaaS subscriptions linked to this Workspace. + * At least one entry is required. Mutable to support Marketplace-driven + * plan changes. + * + * @param marketplaceDetails the marketplaceDetails value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withMarketplaceDetails(List marketplaceDetails) { + this.marketplaceDetails = marketplaceDetails; + return this; + } + + /** + * Get the partnerProperties property: Partner-specific (Kore) Workspace properties. + * + * @return the partnerProperties value. + */ + public WorkspacePartnerProperties partnerProperties() { + return this.partnerProperties; + } + + /** + * Set the partnerProperties property: Partner-specific (Kore) Workspace properties. + * + * @param partnerProperties the partnerProperties value to set. + * @return the WorkspaceProperties object itself. + */ + public WorkspaceProperties withPartnerProperties(WorkspacePartnerProperties partnerProperties) { + this.partnerProperties = partnerProperties; + return this; + } + + /** + * Get the isDefault property: Indicates whether this is the default Workspace created with the Organization. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Get the status property: Lifecycle status of the Workspace as reported by the Kore partner. + * + * @return the status value. + */ + public WorkspaceLifecycleStatus status() { + return this.status; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("marketplaceDetails", this.marketplaceDetails, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("partnerProperties", this.partnerProperties); + jsonWriter.writeStringField("product", this.product == null ? null : this.product.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceProperties 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 WorkspaceProperties. + */ + public static WorkspaceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceProperties deserializedWorkspaceProperties = new WorkspaceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("marketplaceDetails".equals(fieldName)) { + List marketplaceDetails + = reader.readArray(reader1 -> MarketplaceDetails.fromJson(reader1)); + deserializedWorkspaceProperties.marketplaceDetails = marketplaceDetails; + } else if ("partnerProperties".equals(fieldName)) { + deserializedWorkspaceProperties.partnerProperties = WorkspacePartnerProperties.fromJson(reader); + } else if ("product".equals(fieldName)) { + deserializedWorkspaceProperties.product = Product.fromString(reader.getString()); + } else if ("isDefault".equals(fieldName)) { + deserializedWorkspaceProperties.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("status".equals(fieldName)) { + deserializedWorkspaceProperties.status = WorkspaceLifecycleStatus.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedWorkspaceProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceProperties; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceResource.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceResource.java new file mode 100644 index 0000000000000..37334e9017a64 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceResource.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceResourceInner; + +/** + * An immutable client-side representation of WorkspaceResource. + */ +public interface WorkspaceResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + WorkspaceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceResourceInner object. + * + * @return the inner object. + */ + WorkspaceResourceInner innerModel(); + + /** + * The entirety of the WorkspaceResource definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The WorkspaceResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the WorkspaceResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the WorkspaceResource definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, organizationName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @return the next definition stage. + */ + WithCreate withExistingOrganization(String resourceGroupName, String organizationName); + } + + /** + * The stage of the WorkspaceResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkspaceResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkspaceResource create(Context context); + } + + /** + * The stage of the WorkspaceResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(WorkspaceProperties properties); + } + } + + /** + * Begins update for the WorkspaceResource resource. + * + * @return the stage of resource update. + */ + WorkspaceResource.Update update(); + + /** + * The template for WorkspaceResource update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkspaceResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkspaceResource apply(Context context); + } + + /** + * The WorkspaceResource update stages. + */ + interface UpdateStages { + /** + * The stage of the WorkspaceResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(WorkspaceProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkspaceResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkspaceResource refresh(Context context); + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void linkSaaS(WorkspaceSaaSData body); + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void linkSaaS(WorkspaceSaaSData body, Context context); + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace along with {@link Response}. + */ + Response listLinkedSaaSWithResponse(Context context); + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace. + */ + WorkspaceLinkedSaaSListResponse listLinkedSaaS(); + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore along with {@link Response}. + */ + Response getDetailsWithResponse(Context context); + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore. + */ + WorkspaceDetail getDetails(); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceSaaSData.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceSaaSData.java new file mode 100644 index 0000000000000..6bfa924950b3f --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceSaaSData.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.annotation.Fluent; +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; + +/** + * SaaS-related data properties. Contains the full list of SaaS resource IDs to link. + */ +@Fluent +public final class WorkspaceSaaSData implements JsonSerializable { + /* + * ARM resource IDs of the Microsoft.SaaS marketplace resources to link to this Workspace. + */ + private List saaSResourceIds; + + /** + * Creates an instance of WorkspaceSaaSData class. + */ + public WorkspaceSaaSData() { + } + + /** + * Get the saaSResourceIds property: ARM resource IDs of the Microsoft.SaaS marketplace resources to link to this + * Workspace. + * + * @return the saaSResourceIds value. + */ + public List saaSResourceIds() { + return this.saaSResourceIds; + } + + /** + * Set the saaSResourceIds property: ARM resource IDs of the Microsoft.SaaS marketplace resources to link to this + * Workspace. + * + * @param saaSResourceIds the saaSResourceIds value to set. + * @return the WorkspaceSaaSData object itself. + */ + public WorkspaceSaaSData withSaaSResourceIds(List saaSResourceIds) { + this.saaSResourceIds = saaSResourceIds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("saaSResourceIds", this.saaSResourceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceSaaSData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceSaaSData 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 WorkspaceSaaSData. + */ + public static WorkspaceSaaSData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceSaaSData deserializedWorkspaceSaaSData = new WorkspaceSaaSData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saaSResourceIds".equals(fieldName)) { + List saaSResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkspaceSaaSData.saaSResourceIds = saaSResourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceSaaSData; + }); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Workspaces.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Workspaces.java new file mode 100644 index 0000000000000..c607b42ef337b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/Workspaces.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Workspaces. + */ +public interface Workspaces { + /** + * Get a Workspace under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String organizationName, String workspaceName, + Context context); + + /** + * Get a Workspace under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization. + */ + WorkspaceResource get(String resourceGroupName, String organizationName, String workspaceName); + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String organizationName, String workspaceName); + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String organizationName, String workspaceName, Context context); + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOrganization(String resourceGroupName, String organizationName); + + /** + * List Workspaces under an Organization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WorkspaceResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByOrganization(String resourceGroupName, String organizationName, + Context context); + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void linkSaaS(String resourceGroupName, String organizationName, String workspaceName, WorkspaceSaaSData body); + + /** + * Links SaaS resources to the workspace. + * + * Links SaaS resources to the workspace. Accepts the full list of SaaS assets to be linked. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void linkSaaS(String resourceGroupName, String organizationName, String workspaceName, WorkspaceSaaSData body, + Context context); + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace along with {@link Response}. + */ + Response listLinkedSaaSWithResponse(String resourceGroupName, + String organizationName, String workspaceName, Context context); + + /** + * Returns the list of SaaS resources linked to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response containing the list of SaaS resources linked to the Workspace. + */ + WorkspaceLinkedSaaSListResponse listLinkedSaaS(String resourceGroupName, String organizationName, + String workspaceName); + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore along with {@link Response}. + */ + Response getDetailsWithResponse(String resourceGroupName, String organizationName, + String workspaceName, Context context); + + /** + * Returns the complete Workspace details reported by Kore, including its projects. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization. + * @param workspaceName Name of the Workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return complete Workspace details returned by Kore. + */ + WorkspaceDetail getDetails(String resourceGroupName, String organizationName, String workspaceName); + + /** + * Get a Workspace under an Organization. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization along with {@link Response}. + */ + WorkspaceResource getById(String id); + + /** + * Get a Workspace under an Organization. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workspace under an Organization along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Workspace under an Organization (long-running). + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WorkspaceResource resource. + * + * @param name resource name. + * @return the first stage of the new WorkspaceResource definition. + */ + WorkspaceResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/package-info.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/package-info.java new file mode 100644 index 0000000000000..aa272c3165f2d --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/models/package-info.java @@ -0,0 +1,19 @@ +// 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 KoreAIArtemis. + * Kore.AgentPlatform Resource Provider for managing Kore AI Agent Platform + * Organizations and their Workspaces. + * + * Organizations are top-level tracked ARM resources. Each Organization is + * provisioned together with a default Workspace. Additional Workspaces are + * managed as a child proxy resource type under the Organization using the + * standard ARM verbs (PUT / DELETE / GET / LIST) on the workspace URL. + * + * Service-to-service authentication between Liftr and Kore uses federated + * Microsoft Entra credentials and is enforced at the runtime layer + * (not on the ARM surface). + */ +package com.azure.resourcemanager.koreaiartemis.models; diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/package-info.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/package-info.java new file mode 100644 index 0000000000000..1c39d3dc9666b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/com/azure/resourcemanager/koreaiartemis/package-info.java @@ -0,0 +1,19 @@ +// 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 KoreAIArtemis. + * Kore.AgentPlatform Resource Provider for managing Kore AI Agent Platform + * Organizations and their Workspaces. + * + * Organizations are top-level tracked ARM resources. Each Organization is + * provisioned together with a default Workspace. Additional Workspaces are + * managed as a child proxy resource type under the Organization using the + * standard ARM verbs (PUT / DELETE / GET / LIST) on the workspace URL. + * + * Service-to-service authentication between Liftr and Kore uses federated + * Microsoft Entra credentials and is enforced at the runtime layer + * (not on the ARM surface). + */ +package com.azure.resourcemanager.koreaiartemis; diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/module-info.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/module-info.java new file mode 100644 index 0000000000000..a01e754b64463 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.koreaiartemis { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.koreaiartemis; + exports com.azure.resourcemanager.koreaiartemis.fluent; + exports com.azure.resourcemanager.koreaiartemis.fluent.models; + exports com.azure.resourcemanager.koreaiartemis.models; + + opens com.azure.resourcemanager.koreaiartemis.fluent.models to com.azure.core; + opens com.azure.resourcemanager.koreaiartemis.models to com.azure.core; + opens com.azure.resourcemanager.koreaiartemis.implementation.models to com.azure.core; +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/azure-resourcemanager-koreaiartemis_metadata.json b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/azure-resourcemanager-koreaiartemis_metadata.json new file mode 100644 index 0000000000000..f36b880403b57 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/azure-resourcemanager-koreaiartemis_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Kore.AgentPlatform":"2026-07-01-preview"},"crossLanguagePackageId":"Kore.AgentPlatform","crossLanguageVersion":"dc2472570a47","crossLanguageDefinitions":{"com.azure.resourcemanager.koreaiartemis.fluent.KoreAIArtemisManagementClient":"Kore.AgentPlatform","com.azure.resourcemanager.koreaiartemis.fluent.OperationsClient":"Kore.AgentPlatform.Operations","com.azure.resourcemanager.koreaiartemis.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient":"Kore.AgentPlatform.Organizations","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.beginCreate":"Kore.AgentPlatform.Organizations.create","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.beginDelete":"Kore.AgentPlatform.Organizations.delete","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.beginUpdate":"Kore.AgentPlatform.Organizations.update","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.create":"Kore.AgentPlatform.Organizations.create","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.delete":"Kore.AgentPlatform.Organizations.delete","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.getByResourceGroup":"Kore.AgentPlatform.Organizations.get","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.getByResourceGroupWithResponse":"Kore.AgentPlatform.Organizations.get","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.list":"Kore.AgentPlatform.Organizations.listBySubscription","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.listByResourceGroup":"Kore.AgentPlatform.Organizations.listByResourceGroup","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.listWorkspaces":"Kore.AgentPlatform.Organizations.listWorkspaces","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.listWorkspacesWithResponse":"Kore.AgentPlatform.Organizations.listWorkspaces","com.azure.resourcemanager.koreaiartemis.fluent.OrganizationsClient.update":"Kore.AgentPlatform.Organizations.update","com.azure.resourcemanager.koreaiartemis.fluent.SaaSOperationGroupsClient":"Kore.AgentPlatform.SaaSOperationGroup","com.azure.resourcemanager.koreaiartemis.fluent.SaaSOperationGroupsClient.activateResource":"Kore.AgentPlatform.SaaSOperationGroup.activateResource","com.azure.resourcemanager.koreaiartemis.fluent.SaaSOperationGroupsClient.beginActivateResource":"Kore.AgentPlatform.SaaSOperationGroup.activateResource","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient":"Kore.AgentPlatform.Workspaces","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.beginCreateOrUpdate":"Kore.AgentPlatform.Workspaces.createOrUpdate","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.beginDelete":"Kore.AgentPlatform.Workspaces.delete","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.beginLinkSaaS":"Kore.AgentPlatform.Workspaces.linkSaaS","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.createOrUpdate":"Kore.AgentPlatform.Workspaces.createOrUpdate","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.delete":"Kore.AgentPlatform.Workspaces.delete","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.get":"Kore.AgentPlatform.Workspaces.get","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.getDetails":"Kore.AgentPlatform.Workspaces.getDetails","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.getDetailsWithResponse":"Kore.AgentPlatform.Workspaces.getDetails","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.getWithResponse":"Kore.AgentPlatform.Workspaces.get","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.linkSaaS":"Kore.AgentPlatform.Workspaces.linkSaaS","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.listByOrganization":"Kore.AgentPlatform.Workspaces.listByOrganization","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.listLinkedSaaS":"Kore.AgentPlatform.Workspaces.listLinkedSaaS","com.azure.resourcemanager.koreaiartemis.fluent.WorkspacesClient.listLinkedSaaSWithResponse":"Kore.AgentPlatform.Workspaces.listLinkedSaaS","com.azure.resourcemanager.koreaiartemis.fluent.models.ListWorkspacesResponseInner":"Kore.AgentPlatform.ListWorkspacesResponse","com.azure.resourcemanager.koreaiartemis.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.koreaiartemis.fluent.models.OrganizationResourceInner":"Kore.AgentPlatform.OrganizationResource","com.azure.resourcemanager.koreaiartemis.fluent.models.SaaSResourceDetailsResponseInner":"Kore.AgentPlatform.SaaSResourceDetailsResponse","com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceDetailInner":"Kore.AgentPlatform.WorkspaceDetail","com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceLinkedSaaSListResponseInner":"Kore.AgentPlatform.WorkspaceLinkedSaaSListResponse","com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceResourceInner":"Kore.AgentPlatform.WorkspaceResource","com.azure.resourcemanager.koreaiartemis.implementation.KoreAIArtemisManagementClientBuilder":"Kore.AgentPlatform","com.azure.resourcemanager.koreaiartemis.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.koreaiartemis.implementation.models.OrganizationResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.koreaiartemis.implementation.models.WorkspaceResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.koreaiartemis.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.koreaiartemis.models.ActivateSaaSParameterRequest":"Kore.AgentPlatform.ActivateSaaSParameterRequest","com.azure.resourcemanager.koreaiartemis.models.CompanyDetails":"Kore.AgentPlatform.CompanyDetails","com.azure.resourcemanager.koreaiartemis.models.DefaultWorkspaceProperties":"Kore.AgentPlatform.DefaultWorkspaceProperties","com.azure.resourcemanager.koreaiartemis.models.DiscoveredWorkspace":"Kore.AgentPlatform.DiscoveredWorkspace","com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails":"LiftrBase.MarketplaceDetails","com.azure.resourcemanager.koreaiartemis.models.MarketplaceSubscriptionStatus":"LiftrBase.MarketplaceSubscriptionStatus","com.azure.resourcemanager.koreaiartemis.models.OfferDetails":"LiftrBase.OfferDetails","com.azure.resourcemanager.koreaiartemis.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerProperties":"Kore.AgentPlatform.OrganizationPartnerProperties","com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerPropertiesUpdate":"Kore.AgentPlatform.OrganizationPartnerPropertiesUpdate","com.azure.resourcemanager.koreaiartemis.models.OrganizationProperties":"Kore.AgentPlatform.OrganizationProperties","com.azure.resourcemanager.koreaiartemis.models.OrganizationPropertiesUpdate":"Kore.AgentPlatform.OrganizationPropertiesUpdate","com.azure.resourcemanager.koreaiartemis.models.OrganizationResourceUpdate":"Kore.AgentPlatform.OrganizationResourceUpdate","com.azure.resourcemanager.koreaiartemis.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.koreaiartemis.models.Product":"Kore.AgentPlatform.Product","com.azure.resourcemanager.koreaiartemis.models.ResourceProvisioningState":"Azure.ResourceManager.ResourceProvisioningState","com.azure.resourcemanager.koreaiartemis.models.SingleSignOnProperties":"Kore.AgentPlatform.SingleSignOnProperties","com.azure.resourcemanager.koreaiartemis.models.SingleSignOnStates":"LiftrBase.SingleSignOnStates","com.azure.resourcemanager.koreaiartemis.models.SingleSignOnType":"LiftrBase.SingleSignOnType","com.azure.resourcemanager.koreaiartemis.models.UserDetails":"Kore.AgentPlatform.UserDetails","com.azure.resourcemanager.koreaiartemis.models.WorkspaceDetailPartnerProperties":"Kore.AgentPlatform.WorkspaceDetailPartnerProperties","com.azure.resourcemanager.koreaiartemis.models.WorkspaceLifecycleStatus":"Kore.AgentPlatform.WorkspaceLifecycleStatus","com.azure.resourcemanager.koreaiartemis.models.WorkspaceLinkedSaaSItem":"Kore.AgentPlatform.WorkspaceLinkedSaaSItem","com.azure.resourcemanager.koreaiartemis.models.WorkspaceMarketplaceDetails":"Kore.AgentPlatform.WorkspaceMarketplaceDetails","com.azure.resourcemanager.koreaiartemis.models.WorkspaceMarketplaceStatus":"Kore.AgentPlatform.WorkspaceMarketplaceStatus","com.azure.resourcemanager.koreaiartemis.models.WorkspacePartnerProperties":"Kore.AgentPlatform.WorkspacePartnerProperties","com.azure.resourcemanager.koreaiartemis.models.WorkspaceProject":"Kore.AgentPlatform.WorkspaceProject","com.azure.resourcemanager.koreaiartemis.models.WorkspaceProjectStatus":"Kore.AgentPlatform.WorkspaceProjectStatus","com.azure.resourcemanager.koreaiartemis.models.WorkspaceProperties":"Kore.AgentPlatform.WorkspaceProperties","com.azure.resourcemanager.koreaiartemis.models.WorkspaceSaaSData":"Kore.AgentPlatform.WorkspaceSaaSData"},"generatedFiles":["src/main/java/com/azure/resourcemanager/koreaiartemis/KoreAIArtemisManager.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/KoreAIArtemisManagementClient.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/OrganizationsClient.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/SaaSOperationGroupsClient.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/WorkspacesClient.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/ListWorkspacesResponseInner.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/OrganizationResourceInner.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/SaaSResourceDetailsResponseInner.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceDetailInner.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceLinkedSaaSListResponseInner.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/WorkspaceResourceInner.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/koreaiartemis/fluent/package-info.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/KoreAIArtemisManagementClientImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ListWorkspacesResponseImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationResourceImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsClientImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/OrganizationsImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsClientImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSOperationGroupsImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/SaaSResourceDetailsResponseImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceDetailImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceLinkedSaaSListResponseImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspaceResourceImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesClientImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/WorkspacesImpl.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/OrganizationResourceListResult.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/models/WorkspaceResourceListResult.java","src/main/java/com/azure/resourcemanager/koreaiartemis/implementation/package-info.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActionType.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/ActivateSaaSParameterRequest.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/CompanyDetails.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/DefaultWorkspaceProperties.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/DiscoveredWorkspace.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/ListWorkspacesResponse.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceDetails.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/MarketplaceSubscriptionStatus.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/OfferDetails.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operation.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/Operations.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerProperties.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPartnerPropertiesUpdate.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationProperties.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationPropertiesUpdate.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResource.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/OrganizationResourceUpdate.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/Organizations.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/Origin.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/Product.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/ResourceProvisioningState.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSOperationGroups.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/SaaSResourceDetailsResponse.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnProperties.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnStates.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/SingleSignOnType.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/UserDetails.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetail.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceDetailPartnerProperties.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLifecycleStatus.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSItem.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceLinkedSaaSListResponse.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceDetails.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceMarketplaceStatus.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspacePartnerProperties.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProject.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProjectStatus.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceProperties.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceResource.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/WorkspaceSaaSData.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/Workspaces.java","src/main/java/com/azure/resourcemanager/koreaiartemis/models/package-info.java","src/main/java/com/azure/resourcemanager/koreaiartemis/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-koreaiartemis/proxy-config.json b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-koreaiartemis/proxy-config.json new file mode 100644 index 0000000000000..0ff9bcecdb04b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-koreaiartemis/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.koreaiartemis.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.koreaiartemis.implementation.OrganizationsClientImpl$OrganizationsService"],["com.azure.resourcemanager.koreaiartemis.implementation.SaaSOperationGroupsClientImpl$SaaSOperationGroupsService"],["com.azure.resourcemanager.koreaiartemis.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-koreaiartemis/reflect-config.json b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-koreaiartemis/reflect-config.json new file mode 100644 index 0000000000000..0637a088a01e8 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-koreaiartemis/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/azure-resourcemanager-koreaiartemis.properties b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/azure-resourcemanager-koreaiartemis.properties new file mode 100644 index 0000000000000..defbd48204e47 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/main/resources/azure-resourcemanager-koreaiartemis.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OperationsListSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..f12f516442f1d --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OperationsListSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + operationsListMinimumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void operationsList(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + operationsListMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsCreateSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsCreateSamples.java new file mode 100644 index 0000000000000..a81ba25a7a199 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsCreateSamples.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import com.azure.resourcemanager.koreaiartemis.models.DefaultWorkspaceProperties; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationProperties; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Organizations Create. + */ +public final class OrganizationsCreateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Create_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsCreateMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .define("contoso-org") + .withRegion("eastus2euap") + .withExistingResourceGroup("contoso-rg") + .withTags(mapOf("environment", "production")) + .withProperties(new OrganizationProperties().withPartnerProperties(new OrganizationPartnerProperties() + .withOrganizationName("Contoso AI Platform") + .withBillingEmail("billing@contoso.com") + .withOwnerEmail("admin@contoso.com") + .withDefaultWorkspace(new DefaultWorkspaceProperties().withName("my first workspace") + .withProduct(Product.AIFORWORK) + .withMarketplaceDetails(Arrays.asList(new MarketplaceDetails().withSubscriptionId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas") + .withOfferDetails(new OfferDetails().withPublisherId("kore-ai") + .withOfferId("kore-ai-platform") + .withPlanId("business-monthly") + .withPlanName("Business Monthly") + .withTermUnit("P1M") + .withTermId("1m")))))) + .withUser(new UserDetails().withFirstName("Jane") + .withLastName("Doe") + .withEmailAddress("jane.doe@contoso.com") + .withUpn("jane.doe@contoso.onmicrosoft.com") + .withPhoneNumber("+1-425-555-0100") + .withAlternateEmail("jane.alternate@contoso.com") + .withAddress("1 Microsoft Way, Redmond, WA 98052")) + .withCompanyDetails(new CompanyDetails().withCompanyName("Contoso Ltd.") + .withOfficeAddress("1 Microsoft Way, Redmond, WA 98052") + .withCountry("US") + .withDomain("contoso.com") + .withBusinessType("Technology") + .withNumberOfEmployees(500))) + .create(); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Create.json + */ + /** + * Sample code: Organizations_Create. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsCreate(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .define("contoso-org") + .withRegion("eastus2euap") + .withExistingResourceGroup("contoso-rg") + .withTags(mapOf("environment", "production")) + .withProperties(new OrganizationProperties().withPartnerProperties(new OrganizationPartnerProperties() + .withOrganizationName("Contoso AI Platform") + .withBillingEmail("billing@contoso.com") + .withOwnerEmail("admin@contoso.com") + .withDefaultWorkspace(new DefaultWorkspaceProperties().withName("my first workspace") + .withProduct(Product.AIFORWORK) + .withMarketplaceDetails(Arrays.asList(new MarketplaceDetails().withSubscriptionId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas") + .withOfferDetails(new OfferDetails().withPublisherId("kore-ai") + .withOfferId("kore-ai-platform") + .withPlanId("business-monthly") + .withPlanName("Business Monthly") + .withTermUnit("P1M") + .withTermId("1m")))))) + .withUser(new UserDetails().withFirstName("Jane") + .withLastName("Doe") + .withEmailAddress("jane.doe@contoso.com") + .withUpn("jane.doe@contoso.onmicrosoft.com") + .withPhoneNumber("+1-425-555-0100")) + .withCompanyDetails(new CompanyDetails().withCompanyName("Contoso Ltd.") + .withCountry("US") + .withDomain("contoso.com") + .withBusinessType("Technology") + .withNumberOfEmployees(500))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsDeleteSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsDeleteSamples.java new file mode 100644 index 0000000000000..4556f6ff0f444 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsDeleteSamples.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.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Organizations Delete. + */ +public final class OrganizationsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Delete.json + */ + /** + * Sample code: Organizations_Delete. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsDelete(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().delete("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Delete_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsDeleteMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().delete("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsGetByResourceGroupSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..0c84f447a365c --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsGetByResourceGroupSamples.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.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Organizations GetByResourceGroup. + */ +public final class OrganizationsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Get.json + */ + /** + * Sample code: Organizations_Get. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsGet(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .getByResourceGroupWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Get_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsGetMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .getByResourceGroupWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListByResourceGroupSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..45fbb9c28acf3 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListByResourceGroupSamples.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.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Organizations ListByResourceGroup. + */ +public final class OrganizationsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().listByResourceGroup("contoso-rg", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListByResourceGroup.json + */ + /** + * Sample code: Organizations_ListByResourceGroup. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsListByResourceGroup(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().listByResourceGroup("contoso-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListSamples.java new file mode 100644 index 0000000000000..8843d799ad7c9 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListSamples.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.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Organizations List. + */ +public final class OrganizationsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListBySubscription.json + */ + /** + * Sample code: Organizations_ListBySubscription. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsListBySubscription(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListWorkspacesSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListWorkspacesSamples.java new file mode 100644 index 0000000000000..87ced072b44ec --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListWorkspacesSamples.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.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Organizations ListWorkspaces. + */ +public final class OrganizationsListWorkspacesSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_ListWorkspaces.json + */ + /** + * Sample code: Organizations_ListWorkspaces. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsListWorkspaces(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.organizations() + .listWorkspacesWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsUpdateSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsUpdateSamples.java new file mode 100644 index 0000000000000..7862163a7a24a --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsUpdateSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerPropertiesUpdate; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPropertiesUpdate; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResource; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; + +/** + * Samples for Organizations Update. + */ +public final class OrganizationsUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Update.json + */ + /** + * Sample code: Organizations_Update. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void organizationsUpdate(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + OrganizationResource resource = manager.organizations() + .getByResourceGroupWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new OrganizationPropertiesUpdate().withPartnerProperties( + new OrganizationPartnerPropertiesUpdate().withOrganizationName("Contoso AI Platform (Updated)") + .withBillingEmail("new-billing@contoso.com") + .withOwnerEmail("admin@contoso.com"))) + .apply(); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Organizations_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Update_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + organizationsUpdateMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + OrganizationResource resource = manager.organizations() + .getByResourceGroupWithResponse("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new OrganizationPropertiesUpdate() + .withPartnerProperties( + new OrganizationPartnerPropertiesUpdate().withOrganizationName("Contoso AI Platform (Updated)") + .withBillingEmail("new-billing@contoso.com") + .withOwnerEmail("admin@contoso.com")) + .withUser(new UserDetails().withFirstName("Jane") + .withLastName("Doe") + .withEmailAddress("jane.alternate@contoso.com") + .withUpn("jane.doe@contoso.onmicrosoft.com") + .withPhoneNumber("+1-425-555-0100") + .withAlternateEmail("jane.alternate@contoso.com") + .withAddress("1 Microsoft Way, Redmond, WA 98052")) + .withCompanyDetails(new CompanyDetails().withCompanyName("Contoso Ltd.") + .withOfficeAddress("1 Microsoft Way, Redmond, WA 98052") + .withCountry("US") + .withDomain("contoso.com") + .withBusinessType("Technology") + .withNumberOfEmployees(28))) + .apply(); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSOperationGroupActivateResourceSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSOperationGroupActivateResourceSamples.java new file mode 100644 index 0000000000000..f7577f737eafb --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSOperationGroupActivateResourceSamples.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.resourcemanager.koreaiartemis.generated; + +import com.azure.resourcemanager.koreaiartemis.models.ActivateSaaSParameterRequest; + +/** + * Samples for SaaSOperationGroup ActivateResource. + */ +public final class SaaSOperationGroupActivateResourceSamples { + /* + * x-ms-original-file: 2026-07-01-preview/SaaSOperationGroup_ActivateResource.json + */ + /** + * Sample code: SaaSOperationGroup_ActivateResource. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + saaSOperationGroupActivateResource(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.saaSOperationGroups() + .activateResource(new ActivateSaaSParameterRequest().withSaasGuid("12345678-1234-1234-1234-123456789012") + .withPublisherId("kore-ai"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..029c93165a30b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesCreateOrUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspacePartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProperties; +import java.util.Arrays; + +/** + * Samples for Workspaces CreateOrUpdate. + */ +public final class WorkspacesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_CreateOrUpdate.json + */ + /** + * Sample code: Workspaces_CreateOrUpdate. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesCreateOrUpdate(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .define("contoso-prod") + .withExistingOrganization("contoso-rg", "contoso-org") + .withProperties(new WorkspaceProperties().withProduct(Product.AIFORWORK) + .withMarketplaceDetails(Arrays.asList(new MarketplaceDetails().withSubscriptionId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas") + .withOfferDetails(new OfferDetails().withPublisherId("kore-ai") + .withOfferId("kore-ai-platform") + .withPlanId("business-monthly") + .withPlanName("Business Monthly") + .withTermUnit("P1M") + .withTermId("1m")))) + .withPartnerProperties(new WorkspacePartnerProperties().withName("Contoso Production") + .withOwnerEmail("owner@contoso.com"))) + .create(); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesDeleteSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesDeleteSamples.java new file mode 100644 index 0000000000000..ef5cf3254ca43 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Workspaces Delete. + */ +public final class WorkspacesDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_Delete.json + */ + /** + * Sample code: Workspaces_Delete. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesDelete(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces().delete("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetDetailsSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetDetailsSamples.java new file mode 100644 index 0000000000000..6807226805806 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetDetailsSamples.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.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Workspaces GetDetails. + */ +public final class WorkspacesGetDetailsSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_GetDetails.json + */ + /** + * Sample code: Workspaces_GetDetails. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesGetDetails(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .getDetailsWithResponse("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetSamples.java new file mode 100644 index 0000000000000..681e53e4590ba --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetSamples.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.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Workspaces Get. + */ +public final class WorkspacesGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_Get.json + */ + /** + * Sample code: Workspaces_Get. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesGet(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .getWithResponse("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Workspaces_Get_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + workspacesGetMaximumSetGen(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .getWithResponse("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesLinkSaaSSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesLinkSaaSSamples.java new file mode 100644 index 0000000000000..200a3d092d26c --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesLinkSaaSSamples.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.resourcemanager.koreaiartemis.generated; + +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceSaaSData; +import java.util.Arrays; + +/** + * Samples for Workspaces LinkSaaS. + */ +public final class WorkspacesLinkSaaSSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_LinkSaaS.json + */ + /** + * Sample code: Workspaces_LinkSaaS. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesLinkSaaS(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .linkSaaS("contoso-rg", "contoso-org", "contoso-prod", + new WorkspaceSaaSData().withSaaSResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas-1", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-rg/providers/Microsoft.SaaS/resources/kore-ai-saas-2")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListByOrganizationSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListByOrganizationSamples.java new file mode 100644 index 0000000000000..4624821f6cf85 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListByOrganizationSamples.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.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Workspaces ListByOrganization. + */ +public final class WorkspacesListByOrganizationSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_ListByOrganization.json + */ + /** + * Sample code: Workspaces_ListByOrganization. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void + workspacesListByOrganization(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces().listByOrganization("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_ListByOrganization_MaximumSet_Gen.json + */ + /** + * Sample code: Workspaces_ListByOrganization_MaximumSet_Gen. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesListByOrganizationMaximumSetGen( + com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces().listByOrganization("contoso-rg", "contoso-org", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListLinkedSaaSSamples.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListLinkedSaaSSamples.java new file mode 100644 index 0000000000000..c750d45b2a51b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/samples/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListLinkedSaaSSamples.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.resourcemanager.koreaiartemis.generated; + +/** + * Samples for Workspaces ListLinkedSaaS. + */ +public final class WorkspacesListLinkedSaaSSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Workspaces_ListLinkedSaaS.json + */ + /** + * Sample code: Workspaces_ListLinkedSaaS. + * + * @param manager Entry point to KoreAIArtemisManager. + */ + public static void workspacesListLinkedSaaS(com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager manager) { + manager.workspaces() + .listLinkedSaaSWithResponse("contoso-rg", "contoso-org", "contoso-prod", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/ActivateSaaSParameterRequestTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/ActivateSaaSParameterRequestTests.java new file mode 100644 index 0000000000000..31b1afd993b96 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/ActivateSaaSParameterRequestTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.ActivateSaaSParameterRequest; +import org.junit.jupiter.api.Assertions; + +public final class ActivateSaaSParameterRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivateSaaSParameterRequest model = BinaryData.fromString("{\"saasGuid\":\"vmbmp\",\"publisherId\":\"xmodf\"}") + .toObject(ActivateSaaSParameterRequest.class); + Assertions.assertEquals("vmbmp", model.saasGuid()); + Assertions.assertEquals("xmodf", model.publisherId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ActivateSaaSParameterRequest model + = new ActivateSaaSParameterRequest().withSaasGuid("vmbmp").withPublisherId("xmodf"); + model = BinaryData.fromObject(model).toObject(ActivateSaaSParameterRequest.class); + Assertions.assertEquals("vmbmp", model.saasGuid()); + Assertions.assertEquals("xmodf", model.publisherId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/CompanyDetailsTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/CompanyDetailsTests.java new file mode 100644 index 0000000000000..47fd9e6b76a0d --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/CompanyDetailsTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import org.junit.jupiter.api.Assertions; + +public final class CompanyDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CompanyDetails model = BinaryData.fromString( + "{\"companyName\":\"jugwdkcglhsl\",\"officeAddress\":\"jdyggdtji\",\"country\":\"b\",\"domain\":\"ofqweykhmenevfye\",\"businessType\":\"whybcib\",\"numberOfEmployees\":153812125}") + .toObject(CompanyDetails.class); + Assertions.assertEquals("jugwdkcglhsl", model.companyName()); + Assertions.assertEquals("jdyggdtji", model.officeAddress()); + Assertions.assertEquals("b", model.country()); + Assertions.assertEquals("ofqweykhmenevfye", model.domain()); + Assertions.assertEquals("whybcib", model.businessType()); + Assertions.assertEquals(153812125, model.numberOfEmployees()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CompanyDetails model = new CompanyDetails().withCompanyName("jugwdkcglhsl") + .withOfficeAddress("jdyggdtji") + .withCountry("b") + .withDomain("ofqweykhmenevfye") + .withBusinessType("whybcib") + .withNumberOfEmployees(153812125); + model = BinaryData.fromObject(model).toObject(CompanyDetails.class); + Assertions.assertEquals("jugwdkcglhsl", model.companyName()); + Assertions.assertEquals("jdyggdtji", model.officeAddress()); + Assertions.assertEquals("b", model.country()); + Assertions.assertEquals("ofqweykhmenevfye", model.domain()); + Assertions.assertEquals("whybcib", model.businessType()); + Assertions.assertEquals(153812125, model.numberOfEmployees()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/DefaultWorkspacePropertiesTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/DefaultWorkspacePropertiesTests.java new file mode 100644 index 0000000000000..b468f71052b22 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/DefaultWorkspacePropertiesTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.DefaultWorkspaceProperties; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DefaultWorkspacePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DefaultWorkspaceProperties model = BinaryData.fromString( + "{\"name\":\"jqkwpyeicx\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"q\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"ixuigdtopbobj\",\"offerDetails\":{\"publisherId\":\"ghmewuam\",\"offerId\":\"uhrzayvvt\",\"planId\":\"vdfgiotk\",\"planName\":\"utqxlngx\",\"termUnit\":\"fgugnxkrxdqmid\",\"termId\":\"hzrvqd\"}},{\"subscriptionId\":\"bhj\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"ehoqfbowskan\",\"offerDetails\":{\"publisherId\":\"ktzlcuiywg\",\"offerId\":\"ywgndrv\",\"planId\":\"hzgpphrcgyncocpe\",\"planName\":\"vmmcoofs\",\"termUnit\":\"zevgb\",\"termId\":\"jqabcypmivkwlzuv\"}}]}") + .toObject(DefaultWorkspaceProperties.class); + Assertions.assertEquals("jqkwpyeicx", model.name()); + Assertions.assertEquals(Product.AIFORWORK, model.product()); + Assertions.assertEquals("q", model.marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("ixuigdtopbobj", model.marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("ghmewuam", model.marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("uhrzayvvt", model.marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("vdfgiotk", model.marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("utqxlngx", model.marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("fgugnxkrxdqmid", model.marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("hzrvqd", model.marketplaceDetails().get(0).offerDetails().termId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DefaultWorkspaceProperties model = new DefaultWorkspaceProperties().withName("jqkwpyeicx") + .withProduct(Product.AIFORWORK) + .withMarketplaceDetails(Arrays.asList( + new MarketplaceDetails().withSubscriptionId("q") + .withSaasResourceId("ixuigdtopbobj") + .withOfferDetails(new OfferDetails().withPublisherId("ghmewuam") + .withOfferId("uhrzayvvt") + .withPlanId("vdfgiotk") + .withPlanName("utqxlngx") + .withTermUnit("fgugnxkrxdqmid") + .withTermId("hzrvqd")), + new MarketplaceDetails().withSubscriptionId("bhj") + .withSaasResourceId("ehoqfbowskan") + .withOfferDetails(new OfferDetails().withPublisherId("ktzlcuiywg") + .withOfferId("ywgndrv") + .withPlanId("hzgpphrcgyncocpe") + .withPlanName("vmmcoofs") + .withTermUnit("zevgb") + .withTermId("jqabcypmivkwlzuv")))); + model = BinaryData.fromObject(model).toObject(DefaultWorkspaceProperties.class); + Assertions.assertEquals("jqkwpyeicx", model.name()); + Assertions.assertEquals(Product.AIFORWORK, model.product()); + Assertions.assertEquals("q", model.marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("ixuigdtopbobj", model.marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("ghmewuam", model.marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("uhrzayvvt", model.marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("vdfgiotk", model.marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("utqxlngx", model.marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("fgugnxkrxdqmid", model.marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("hzrvqd", model.marketplaceDetails().get(0).offerDetails().termId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/DiscoveredWorkspaceTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/DiscoveredWorkspaceTests.java new file mode 100644 index 0000000000000..3249ef87dae03 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/DiscoveredWorkspaceTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.DiscoveredWorkspace; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLifecycleStatus; +import org.junit.jupiter.api.Assertions; + +public final class DiscoveredWorkspaceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DiscoveredWorkspace model = BinaryData.fromString( + "{\"partnerResourceId\":\"wtppjflcxogaoko\",\"name\":\"z\",\"ownerEmail\":\"sikvmkqzeqqkdlt\",\"isDefault\":true,\"status\":\"suspended\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"r\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"wobdagxtibqdx\",\"offerDetails\":{\"publisherId\":\"xwak\",\"offerId\":\"ogqxndlkzgxhuri\",\"planId\":\"bpodxunkbebxm\",\"planName\":\"yyntwl\",\"termUnit\":\"qtkoievs\",\"termId\":\"tgqr\"}},{\"subscriptionId\":\"tmuwlauwzi\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"pgcjefuzmuvp\",\"offerDetails\":{\"publisherId\":\"ttdumorppxebmnzb\",\"offerId\":\"bhjpglkfgohdne\",\"planId\":\"lfphsdyhtozfikd\",\"planName\":\"wq\",\"termUnit\":\"v\",\"termId\":\"xclvit\"}},{\"subscriptionId\":\"qzonosggbhcohf\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"n\",\"offerDetails\":{\"publisherId\":\"aljutiiswac\",\"offerId\":\"fgdkzzew\",\"planId\":\"vhqcrail\",\"planName\":\"n\",\"termUnit\":\"fuflrwdmhdlx\",\"termId\":\"rxsagafcnihgwqa\"}},{\"subscriptionId\":\"edgfbcvkcvq\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"qdcvdrhvoo\",\"offerDetails\":{\"publisherId\":\"sotbob\",\"offerId\":\"dopcjwvnh\",\"planId\":\"d\",\"planName\":\"gx\",\"termUnit\":\"rslpmutwuoeg\",\"termId\":\"khjwn\"}}],\"isManagedByLiftr\":false,\"armResourceId\":\"sluicpdggkzz\"}") + .toObject(DiscoveredWorkspace.class); + Assertions.assertEquals("wtppjflcxogaoko", model.partnerResourceId()); + Assertions.assertEquals("z", model.name()); + Assertions.assertEquals("sikvmkqzeqqkdlt", model.ownerEmail()); + Assertions.assertTrue(model.isDefault()); + Assertions.assertEquals(WorkspaceLifecycleStatus.SUSPENDED, model.status()); + Assertions.assertEquals(Product.AIFORWORK, model.product()); + Assertions.assertEquals("r", model.marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("wobdagxtibqdx", model.marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("xwak", model.marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("ogqxndlkzgxhuri", model.marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("bpodxunkbebxm", model.marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("yyntwl", model.marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("qtkoievs", model.marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("tgqr", model.marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertFalse(model.isManagedByLiftr()); + Assertions.assertEquals("sluicpdggkzz", model.armResourceId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/ListWorkspacesResponseInnerTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/ListWorkspacesResponseInnerTests.java new file mode 100644 index 0000000000000..2d1472a8e6749 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/ListWorkspacesResponseInnerTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.fluent.models.ListWorkspacesResponseInner; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLifecycleStatus; +import org.junit.jupiter.api.Assertions; + +public final class ListWorkspacesResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ListWorkspacesResponseInner model = BinaryData.fromString( + "{\"value\":[{\"partnerResourceId\":\"sfwxosowzxc\",\"name\":\"gicjooxdjeb\",\"ownerEmail\":\"ucww\",\"isDefault\":true,\"status\":\"suspended\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"civyhzceuo\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"wjue\",\"offerDetails\":{\"publisherId\":\"otwmcdyt\",\"offerId\":\"x\",\"planId\":\"txnrjaw\",\"planName\":\"wgxhn\",\"termUnit\":\"kxfbkpycgklwndn\",\"termId\":\"dauwhvylwzbtd\"}},{\"subscriptionId\":\"ujznb\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"uwprzql\",\"offerDetails\":{\"publisherId\":\"eualupjmkhf\",\"offerId\":\"obbc\",\"planId\":\"s\",\"planName\":\"jriplrbpbewtghf\",\"termUnit\":\"lcgwxzvlvqh\",\"termId\":\"begibtnmxiebwwa\"}}],\"isManagedByLiftr\":false,\"armResourceId\":\"yqcgwrtzjuzgwy\"},{\"partnerResourceId\":\"mhtxongmtsavjcb\",\"name\":\"wxqpsrknftguvri\",\"ownerEmail\":\"prwmdyvxqt\",\"isDefault\":false,\"status\":\"suspended\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"bexrmcq\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"nojvknmefqsg\",\"offerDetails\":{\"publisherId\":\"vah\",\"offerId\":\"pjyzhpv\",\"planId\":\"zcjrvxdjzlmwlx\",\"planName\":\"ug\",\"termUnit\":\"zovawjvz\",\"termId\":\"luthn\"}},{\"subscriptionId\":\"rnxipei\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"uaejxdultsk\",\"offerDetails\":{\"publisherId\":\"bbtdzumvee\",\"offerId\":\"gpw\",\"planId\":\"uh\",\"planName\":\"p\",\"termUnit\":\"jyofdxluusdtto\",\"termId\":\"aboekqv\"}},{\"subscriptionId\":\"lns\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"wyjsflhhcaalnjix\",\"offerDetails\":{\"publisherId\":\"sxyawjoyaqcs\",\"offerId\":\"yjpkiidzyexz\",\"planId\":\"lixhnrztfol\",\"planName\":\"nxknalaulp\",\"termUnit\":\"gdtpnapnyiro\",\"termId\":\"hpigv\"}},{\"subscriptionId\":\"ylgqgitxmedjvcsl\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"wncwzzhxgktrmg\",\"offerDetails\":{\"publisherId\":\"cnapkteoell\",\"offerId\":\"pt\",\"planId\":\"ygpfqb\",\"planName\":\"ceopzfqrhhuaopp\",\"termUnit\":\"qeqxo\",\"termId\":\"dahzxctobg\"}}],\"isManagedByLiftr\":false,\"armResourceId\":\"moizpos\"},{\"partnerResourceId\":\"mgrcfbu\",\"name\":\"rmfqjhhkxbpvj\",\"ownerEmail\":\"jhxxjyn\",\"isDefault\":false,\"status\":\"archived\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"bxqz\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"fauvjfdxx\",\"offerDetails\":{\"publisherId\":\"vetvt\",\"offerId\":\"qaqtdoqmcbxvwvxy\",\"planId\":\"qbhsfxobl\",\"planName\":\"k\",\"termUnit\":\"mpew\",\"termId\":\"fbkrvrnsvs\"}},{\"subscriptionId\":\"johxcrsb\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"srruvwbhsqfsubcg\",\"offerDetails\":{\"publisherId\":\"birx\",\"offerId\":\"pybsrfbjfdtw\",\"planId\":\"otftpvjzbexilz\",\"planName\":\"fqqnvwpmqtaruo\",\"termUnit\":\"mkcjhwqytjrybn\",\"termId\":\"ewgdrjervn\"}}],\"isManagedByLiftr\":false,\"armResourceId\":\"qp\"},{\"partnerResourceId\":\"hin\",\"name\":\"oygmift\",\"ownerEmail\":\"zdnds\",\"isDefault\":false,\"status\":\"active\",\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"subscriptionId\":\"duhavhqlkt\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"qolbgyc\",\"offerDetails\":{\"publisherId\":\"uie\",\"offerId\":\"tgccymvaolpss\",\"planId\":\"lfmmdnbbglzpswi\",\"planName\":\"mcwyhzdxssadb\",\"termUnit\":\"nvdfznuda\",\"termId\":\"vxzbncb\"}},{\"subscriptionId\":\"lpstdbhhxsrzdz\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"scdntnevf\",\"offerDetails\":{\"publisherId\":\"wjmy\",\"offerId\":\"tdss\",\"planId\":\"wtmwerio\",\"planName\":\"pyqs\",\"termUnit\":\"wab\",\"termId\":\"tshhszhedp\"}}],\"isManagedByLiftr\":true,\"armResourceId\":\"iwubmwmbesldnk\"}]}") + .toObject(ListWorkspacesResponseInner.class); + Assertions.assertEquals("sfwxosowzxc", model.value().get(0).partnerResourceId()); + Assertions.assertEquals("gicjooxdjeb", model.value().get(0).name()); + Assertions.assertEquals("ucww", model.value().get(0).ownerEmail()); + Assertions.assertTrue(model.value().get(0).isDefault()); + Assertions.assertEquals(WorkspaceLifecycleStatus.SUSPENDED, model.value().get(0).status()); + Assertions.assertEquals(Product.AIFORWORK, model.value().get(0).product()); + Assertions.assertEquals("civyhzceuo", model.value().get(0).marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("wjue", model.value().get(0).marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("otwmcdyt", + model.value().get(0).marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("x", model.value().get(0).marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("txnrjaw", model.value().get(0).marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("wgxhn", model.value().get(0).marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("kxfbkpycgklwndn", + model.value().get(0).marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("dauwhvylwzbtd", + model.value().get(0).marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertFalse(model.value().get(0).isManagedByLiftr()); + Assertions.assertEquals("yqcgwrtzjuzgwy", model.value().get(0).armResourceId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/MarketplaceDetailsTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/MarketplaceDetailsTests.java new file mode 100644 index 0000000000000..939723e72057b --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/MarketplaceDetailsTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import org.junit.jupiter.api.Assertions; + +public final class MarketplaceDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MarketplaceDetails model = BinaryData.fromString( + "{\"subscriptionId\":\"fwnfnb\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"onlebxetqgtzxdpn\",\"offerDetails\":{\"publisherId\":\"bqqwxrj\",\"offerId\":\"eallnwsubisnj\",\"planId\":\"pmng\",\"planName\":\"scxaq\",\"termUnit\":\"ochcbonqvpkvl\",\"termId\":\"njeaseipheofloke\"}}") + .toObject(MarketplaceDetails.class); + Assertions.assertEquals("fwnfnb", model.subscriptionId()); + Assertions.assertEquals("onlebxetqgtzxdpn", model.saasResourceId()); + Assertions.assertEquals("bqqwxrj", model.offerDetails().publisherId()); + Assertions.assertEquals("eallnwsubisnj", model.offerDetails().offerId()); + Assertions.assertEquals("pmng", model.offerDetails().planId()); + Assertions.assertEquals("scxaq", model.offerDetails().planName()); + Assertions.assertEquals("ochcbonqvpkvl", model.offerDetails().termUnit()); + Assertions.assertEquals("njeaseipheofloke", model.offerDetails().termId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MarketplaceDetails model = new MarketplaceDetails().withSubscriptionId("fwnfnb") + .withSaasResourceId("onlebxetqgtzxdpn") + .withOfferDetails(new OfferDetails().withPublisherId("bqqwxrj") + .withOfferId("eallnwsubisnj") + .withPlanId("pmng") + .withPlanName("scxaq") + .withTermUnit("ochcbonqvpkvl") + .withTermId("njeaseipheofloke")); + model = BinaryData.fromObject(model).toObject(MarketplaceDetails.class); + Assertions.assertEquals("fwnfnb", model.subscriptionId()); + Assertions.assertEquals("onlebxetqgtzxdpn", model.saasResourceId()); + Assertions.assertEquals("bqqwxrj", model.offerDetails().publisherId()); + Assertions.assertEquals("eallnwsubisnj", model.offerDetails().offerId()); + Assertions.assertEquals("pmng", model.offerDetails().planId()); + Assertions.assertEquals("scxaq", model.offerDetails().planName()); + Assertions.assertEquals("ochcbonqvpkvl", model.offerDetails().termUnit()); + Assertions.assertEquals("njeaseipheofloke", model.offerDetails().termId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OfferDetailsTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OfferDetailsTests.java new file mode 100644 index 0000000000000..57f1e775fc217 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OfferDetailsTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import org.junit.jupiter.api.Assertions; + +public final class OfferDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfferDetails model = BinaryData.fromString( + "{\"publisherId\":\"y\",\"offerId\":\"enjbdlwtgrhp\",\"planId\":\"pj\",\"planName\":\"asxazjpqyegualhb\",\"termUnit\":\"hejjz\",\"termId\":\"dudgwdslfhot\"}") + .toObject(OfferDetails.class); + Assertions.assertEquals("y", model.publisherId()); + Assertions.assertEquals("enjbdlwtgrhp", model.offerId()); + Assertions.assertEquals("pj", model.planId()); + Assertions.assertEquals("asxazjpqyegualhb", model.planName()); + Assertions.assertEquals("hejjz", model.termUnit()); + Assertions.assertEquals("dudgwdslfhot", model.termId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfferDetails model = new OfferDetails().withPublisherId("y") + .withOfferId("enjbdlwtgrhp") + .withPlanId("pj") + .withPlanName("asxazjpqyegualhb") + .withTermUnit("hejjz") + .withTermId("dudgwdslfhot"); + model = BinaryData.fromObject(model).toObject(OfferDetails.class); + Assertions.assertEquals("y", model.publisherId()); + Assertions.assertEquals("enjbdlwtgrhp", model.offerId()); + Assertions.assertEquals("pj", model.planId()); + Assertions.assertEquals("asxazjpqyegualhb", model.planName()); + Assertions.assertEquals("hejjz", model.termUnit()); + Assertions.assertEquals("dudgwdslfhot", model.termId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationDisplayTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationDisplayTests.java new file mode 100644 index 0000000000000..4c771f57c2548 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationInnerTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationInnerTests.java new file mode 100644 index 0000000000000..6e1d7f1d652ca --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationListResultTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationListResultTests.java new file mode 100644 index 0000000000000..e1dde8494f056 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationsListMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationsListMockTests.java new file mode 100644 index 0000000000000..d0fc6430469fa --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OperationsListMockTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"dsdoakgtdlmkk\",\"isDataAction\":true,\"display\":{\"provider\":\"hewpusdsttwv\",\"resource\":\"vbbejdcng\",\"operation\":\"m\",\"description\":\"kufgmj\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPartnerPropertiesTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPartnerPropertiesTests.java new file mode 100644 index 0000000000000..d0b13cce0d8a7 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPartnerPropertiesTests.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.DefaultWorkspaceProperties; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class OrganizationPartnerPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OrganizationPartnerProperties model = BinaryData.fromString( + "{\"organizationName\":\"crmnohjtckwhds\",\"billingEmail\":\"ifiyipjxsqwpgrj\",\"ownerEmail\":\"znorcj\",\"defaultWorkspace\":{\"name\":\"vsnb\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"nmoc\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"hurzafblj\",\"offerDetails\":{\"publisherId\":\"gpbtoqcjmklj\",\"offerId\":\"vbqid\",\"planId\":\"ajzyul\",\"planName\":\"u\",\"termUnit\":\"krlkhbzhfepg\",\"termId\":\"qex\"}},{\"subscriptionId\":\"ocxscpaierhhbcs\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"majtjaod\",\"offerDetails\":{\"publisherId\":\"obnbdxkqpxokaj\",\"offerId\":\"onpimexgstxg\",\"planId\":\"odgmaajrmvdjwz\",\"planName\":\"ovmclwhijcoejct\",\"termUnit\":\"aqsqsycbkbfk\",\"termId\":\"kdkexxp\"}},{\"subscriptionId\":\"fmxa\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"pg\",\"offerDetails\":{\"publisherId\":\"dtocj\",\"offerId\":\"xhvpmoue\",\"planId\":\"dzxibqeojnxqbzvd\",\"planName\":\"t\",\"termUnit\":\"deicbtwnpzao\",\"termId\":\"uhrhcffcyddgl\"}}]},\"partnerResourceId\":\"t\"}") + .toObject(OrganizationPartnerProperties.class); + Assertions.assertEquals("crmnohjtckwhds", model.organizationName()); + Assertions.assertEquals("ifiyipjxsqwpgrj", model.billingEmail()); + Assertions.assertEquals("znorcj", model.ownerEmail()); + Assertions.assertEquals("vsnb", model.defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORWORK, model.defaultWorkspace().product()); + Assertions.assertEquals("nmoc", model.defaultWorkspace().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("hurzafblj", model.defaultWorkspace().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("gpbtoqcjmklj", + model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("vbqid", model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("ajzyul", model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("u", model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("krlkhbzhfepg", + model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("qex", model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().termId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationPartnerProperties model = new OrganizationPartnerProperties().withOrganizationName("crmnohjtckwhds") + .withBillingEmail("ifiyipjxsqwpgrj") + .withOwnerEmail("znorcj") + .withDefaultWorkspace(new DefaultWorkspaceProperties().withName("vsnb") + .withProduct(Product.AIFORWORK) + .withMarketplaceDetails(Arrays.asList( + new MarketplaceDetails().withSubscriptionId("nmoc") + .withSaasResourceId("hurzafblj") + .withOfferDetails(new OfferDetails().withPublisherId("gpbtoqcjmklj") + .withOfferId("vbqid") + .withPlanId("ajzyul") + .withPlanName("u") + .withTermUnit("krlkhbzhfepg") + .withTermId("qex")), + new MarketplaceDetails().withSubscriptionId("ocxscpaierhhbcs") + .withSaasResourceId("majtjaod") + .withOfferDetails(new OfferDetails().withPublisherId("obnbdxkqpxokaj") + .withOfferId("onpimexgstxg") + .withPlanId("odgmaajrmvdjwz") + .withPlanName("ovmclwhijcoejct") + .withTermUnit("aqsqsycbkbfk") + .withTermId("kdkexxp")), + new MarketplaceDetails().withSubscriptionId("fmxa") + .withSaasResourceId("pg") + .withOfferDetails(new OfferDetails().withPublisherId("dtocj") + .withOfferId("xhvpmoue") + .withPlanId("dzxibqeojnxqbzvd") + .withPlanName("t") + .withTermUnit("deicbtwnpzao") + .withTermId("uhrhcffcyddgl"))))); + model = BinaryData.fromObject(model).toObject(OrganizationPartnerProperties.class); + Assertions.assertEquals("crmnohjtckwhds", model.organizationName()); + Assertions.assertEquals("ifiyipjxsqwpgrj", model.billingEmail()); + Assertions.assertEquals("znorcj", model.ownerEmail()); + Assertions.assertEquals("vsnb", model.defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORWORK, model.defaultWorkspace().product()); + Assertions.assertEquals("nmoc", model.defaultWorkspace().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("hurzafblj", model.defaultWorkspace().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("gpbtoqcjmklj", + model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("vbqid", model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("ajzyul", model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("u", model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("krlkhbzhfepg", + model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("qex", model.defaultWorkspace().marketplaceDetails().get(0).offerDetails().termId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPartnerPropertiesUpdateTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPartnerPropertiesUpdateTests.java new file mode 100644 index 0000000000000..4f0a24e30bd6a --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPartnerPropertiesUpdateTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerPropertiesUpdate; +import org.junit.jupiter.api.Assertions; + +public final class OrganizationPartnerPropertiesUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OrganizationPartnerPropertiesUpdate model = BinaryData + .fromString("{\"organizationName\":\"m\",\"billingEmail\":\"yvshxmz\",\"ownerEmail\":\"bzoggigrx\"}") + .toObject(OrganizationPartnerPropertiesUpdate.class); + Assertions.assertEquals("m", model.organizationName()); + Assertions.assertEquals("yvshxmz", model.billingEmail()); + Assertions.assertEquals("bzoggigrx", model.ownerEmail()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationPartnerPropertiesUpdate model = new OrganizationPartnerPropertiesUpdate().withOrganizationName("m") + .withBillingEmail("yvshxmz") + .withOwnerEmail("bzoggigrx"); + model = BinaryData.fromObject(model).toObject(OrganizationPartnerPropertiesUpdate.class); + Assertions.assertEquals("m", model.organizationName()); + Assertions.assertEquals("yvshxmz", model.billingEmail()); + Assertions.assertEquals("bzoggigrx", model.ownerEmail()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPropertiesTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPropertiesTests.java new file mode 100644 index 0000000000000..a0ab6c72d583c --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPropertiesTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import com.azure.resourcemanager.koreaiartemis.models.DefaultWorkspaceProperties; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationProperties; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class OrganizationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OrganizationProperties model = BinaryData.fromString( + "{\"partnerProperties\":{\"organizationName\":\"vkocrcjdkwtn\",\"billingEmail\":\"xbnjbiksq\",\"ownerEmail\":\"gls\",\"defaultWorkspace\":{\"name\":\"ainqpjwnzlljfm\",\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"subscriptionId\":\"vmgxsab\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"uujitcjc\",\"offerDetails\":{\"publisherId\":\"dzevndhkrw\",\"offerId\":\"d\",\"planId\":\"p\",\"planName\":\"bdkvwrwjf\",\"termUnit\":\"snhu\",\"termId\":\"eltmrldhugjzzdat\"}},{\"subscriptionId\":\"hocdgeab\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"uticndvkaozwyif\",\"offerDetails\":{\"publisherId\":\"yhxhu\",\"offerId\":\"okftyxolniwpwcuk\",\"planId\":\"kgiawxklryplwck\",\"planName\":\"syyp\",\"termUnit\":\"dhsgcba\",\"termId\":\"hejkotynqgou\"}},{\"subscriptionId\":\"ndlik\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"gfgibm\",\"offerDetails\":{\"publisherId\":\"dgak\",\"offerId\":\"qsrxybzqqed\",\"planId\":\"tbciqfouflmm\",\"planName\":\"zsm\",\"termUnit\":\"mglougpbkw\",\"termId\":\"utduqktapspwgcu\"}},{\"subscriptionId\":\"tumkdosvqwhbm\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"jfddgmbmbe\",\"offerDetails\":{\"publisherId\":\"ppbhtqqrolfp\",\"offerId\":\"psalgbqux\",\"planId\":\"jyj\",\"planName\":\"jaoyfhrtx\",\"termUnit\":\"n\",\"termId\":\"kujysvlejuvfq\"}}]},\"partnerResourceId\":\"rlyxwjkcprbnw\"},\"user\":{\"firstName\":\"gjvtbv\",\"lastName\":\"sszdnru\",\"emailAddress\":\"guhmuouqfpr\",\"upn\":\"wbnguitnwui\",\"phoneNumber\":\"a\",\"alternateEmail\":\"ufizuckyf\",\"address\":\"rfidfvzwdz\"},\"companyDetails\":{\"companyName\":\"ymwisdkft\",\"officeAddress\":\"xmnteiwaop\",\"country\":\"mijcmmxdcufufs\",\"domain\":\"ymzidn\",\"businessType\":\"zcxtbzsgfyccsn\",\"numberOfEmployees\":1109063873},\"singleSignOn\":{\"type\":\"Saml\",\"state\":\"Enable\",\"enterpriseAppId\":\"iachbo\",\"url\":\"flnrosfqpteehzz\",\"aadDomains\":[\"yqrimzin\"]},\"defaultWorkspaceId\":\"swjdkirso\",\"workspaceCount\":1633669342,\"provisioningState\":\"Succeeded\"}") + .toObject(OrganizationProperties.class); + Assertions.assertEquals("vkocrcjdkwtn", model.partnerProperties().organizationName()); + Assertions.assertEquals("xbnjbiksq", model.partnerProperties().billingEmail()); + Assertions.assertEquals("gls", model.partnerProperties().ownerEmail()); + Assertions.assertEquals("ainqpjwnzlljfm", model.partnerProperties().defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORSERVICE, model.partnerProperties().defaultWorkspace().product()); + Assertions.assertEquals("vmgxsab", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("uujitcjc", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("dzevndhkrw", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("d", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("p", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("bdkvwrwjf", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("snhu", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("eltmrldhugjzzdat", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertEquals("gjvtbv", model.user().firstName()); + Assertions.assertEquals("sszdnru", model.user().lastName()); + Assertions.assertEquals("guhmuouqfpr", model.user().emailAddress()); + Assertions.assertEquals("wbnguitnwui", model.user().upn()); + Assertions.assertEquals("a", model.user().phoneNumber()); + Assertions.assertEquals("ufizuckyf", model.user().alternateEmail()); + Assertions.assertEquals("rfidfvzwdz", model.user().address()); + Assertions.assertEquals("ymwisdkft", model.companyDetails().companyName()); + Assertions.assertEquals("xmnteiwaop", model.companyDetails().officeAddress()); + Assertions.assertEquals("mijcmmxdcufufs", model.companyDetails().country()); + Assertions.assertEquals("ymzidn", model.companyDetails().domain()); + Assertions.assertEquals("zcxtbzsgfyccsn", model.companyDetails().businessType()); + Assertions.assertEquals(1109063873, model.companyDetails().numberOfEmployees()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationProperties model = new OrganizationProperties() + .withPartnerProperties(new OrganizationPartnerProperties().withOrganizationName("vkocrcjdkwtn") + .withBillingEmail("xbnjbiksq") + .withOwnerEmail("gls") + .withDefaultWorkspace(new DefaultWorkspaceProperties().withName("ainqpjwnzlljfm") + .withProduct(Product.AIFORSERVICE) + .withMarketplaceDetails(Arrays.asList( + new MarketplaceDetails().withSubscriptionId("vmgxsab") + .withSaasResourceId("uujitcjc") + .withOfferDetails(new OfferDetails().withPublisherId("dzevndhkrw") + .withOfferId("d") + .withPlanId("p") + .withPlanName("bdkvwrwjf") + .withTermUnit("snhu") + .withTermId("eltmrldhugjzzdat")), + new MarketplaceDetails().withSubscriptionId("hocdgeab") + .withSaasResourceId("uticndvkaozwyif") + .withOfferDetails(new OfferDetails().withPublisherId("yhxhu") + .withOfferId("okftyxolniwpwcuk") + .withPlanId("kgiawxklryplwck") + .withPlanName("syyp") + .withTermUnit("dhsgcba") + .withTermId("hejkotynqgou")), + new MarketplaceDetails().withSubscriptionId("ndlik") + .withSaasResourceId("gfgibm") + .withOfferDetails(new OfferDetails().withPublisherId("dgak") + .withOfferId("qsrxybzqqed") + .withPlanId("tbciqfouflmm") + .withPlanName("zsm") + .withTermUnit("mglougpbkw") + .withTermId("utduqktapspwgcu")), + new MarketplaceDetails().withSubscriptionId("tumkdosvqwhbm") + .withSaasResourceId("jfddgmbmbe") + .withOfferDetails(new OfferDetails().withPublisherId("ppbhtqqrolfp") + .withOfferId("psalgbqux") + .withPlanId("jyj") + .withPlanName("jaoyfhrtx") + .withTermUnit("n") + .withTermId("kujysvlejuvfq")))))) + .withUser(new UserDetails().withFirstName("gjvtbv") + .withLastName("sszdnru") + .withEmailAddress("guhmuouqfpr") + .withUpn("wbnguitnwui") + .withPhoneNumber("a") + .withAlternateEmail("ufizuckyf") + .withAddress("rfidfvzwdz")) + .withCompanyDetails(new CompanyDetails().withCompanyName("ymwisdkft") + .withOfficeAddress("xmnteiwaop") + .withCountry("mijcmmxdcufufs") + .withDomain("ymzidn") + .withBusinessType("zcxtbzsgfyccsn") + .withNumberOfEmployees(1109063873)); + model = BinaryData.fromObject(model).toObject(OrganizationProperties.class); + Assertions.assertEquals("vkocrcjdkwtn", model.partnerProperties().organizationName()); + Assertions.assertEquals("xbnjbiksq", model.partnerProperties().billingEmail()); + Assertions.assertEquals("gls", model.partnerProperties().ownerEmail()); + Assertions.assertEquals("ainqpjwnzlljfm", model.partnerProperties().defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORSERVICE, model.partnerProperties().defaultWorkspace().product()); + Assertions.assertEquals("vmgxsab", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("uujitcjc", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("dzevndhkrw", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("d", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("p", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("bdkvwrwjf", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("snhu", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("eltmrldhugjzzdat", + model.partnerProperties().defaultWorkspace().marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertEquals("gjvtbv", model.user().firstName()); + Assertions.assertEquals("sszdnru", model.user().lastName()); + Assertions.assertEquals("guhmuouqfpr", model.user().emailAddress()); + Assertions.assertEquals("wbnguitnwui", model.user().upn()); + Assertions.assertEquals("a", model.user().phoneNumber()); + Assertions.assertEquals("ufizuckyf", model.user().alternateEmail()); + Assertions.assertEquals("rfidfvzwdz", model.user().address()); + Assertions.assertEquals("ymwisdkft", model.companyDetails().companyName()); + Assertions.assertEquals("xmnteiwaop", model.companyDetails().officeAddress()); + Assertions.assertEquals("mijcmmxdcufufs", model.companyDetails().country()); + Assertions.assertEquals("ymzidn", model.companyDetails().domain()); + Assertions.assertEquals("zcxtbzsgfyccsn", model.companyDetails().businessType()); + Assertions.assertEquals(1109063873, model.companyDetails().numberOfEmployees()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPropertiesUpdateTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPropertiesUpdateTests.java new file mode 100644 index 0000000000000..9f7997611e125 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationPropertiesUpdateTests.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerPropertiesUpdate; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPropertiesUpdate; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; +import org.junit.jupiter.api.Assertions; + +public final class OrganizationPropertiesUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OrganizationPropertiesUpdate model = BinaryData.fromString( + "{\"partnerProperties\":{\"organizationName\":\"zwtruwiqzbqjvsov\",\"billingEmail\":\"okacspk\",\"ownerEmail\":\"hzdobpxjmflbvvnc\"},\"user\":{\"firstName\":\"cciw\",\"lastName\":\"juqk\",\"emailAddress\":\"sa\",\"upn\":\"wkuofoskghsauu\",\"phoneNumber\":\"jmvxie\",\"alternateEmail\":\"ugidyjrr\",\"address\":\"y\"},\"companyDetails\":{\"companyName\":\"v\",\"officeAddress\":\"csonpclhoco\",\"country\":\"lkevle\",\"domain\":\"zfbuhf\",\"businessType\":\"faxkffeii\",\"numberOfEmployees\":1914432251}}") + .toObject(OrganizationPropertiesUpdate.class); + Assertions.assertEquals("zwtruwiqzbqjvsov", model.partnerProperties().organizationName()); + Assertions.assertEquals("okacspk", model.partnerProperties().billingEmail()); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.partnerProperties().ownerEmail()); + Assertions.assertEquals("cciw", model.user().firstName()); + Assertions.assertEquals("juqk", model.user().lastName()); + Assertions.assertEquals("sa", model.user().emailAddress()); + Assertions.assertEquals("wkuofoskghsauu", model.user().upn()); + Assertions.assertEquals("jmvxie", model.user().phoneNumber()); + Assertions.assertEquals("ugidyjrr", model.user().alternateEmail()); + Assertions.assertEquals("y", model.user().address()); + Assertions.assertEquals("v", model.companyDetails().companyName()); + Assertions.assertEquals("csonpclhoco", model.companyDetails().officeAddress()); + Assertions.assertEquals("lkevle", model.companyDetails().country()); + Assertions.assertEquals("zfbuhf", model.companyDetails().domain()); + Assertions.assertEquals("faxkffeii", model.companyDetails().businessType()); + Assertions.assertEquals(1914432251, model.companyDetails().numberOfEmployees()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationPropertiesUpdate model = new OrganizationPropertiesUpdate() + .withPartnerProperties(new OrganizationPartnerPropertiesUpdate().withOrganizationName("zwtruwiqzbqjvsov") + .withBillingEmail("okacspk") + .withOwnerEmail("hzdobpxjmflbvvnc")) + .withUser(new UserDetails().withFirstName("cciw") + .withLastName("juqk") + .withEmailAddress("sa") + .withUpn("wkuofoskghsauu") + .withPhoneNumber("jmvxie") + .withAlternateEmail("ugidyjrr") + .withAddress("y")) + .withCompanyDetails(new CompanyDetails().withCompanyName("v") + .withOfficeAddress("csonpclhoco") + .withCountry("lkevle") + .withDomain("zfbuhf") + .withBusinessType("faxkffeii") + .withNumberOfEmployees(1914432251)); + model = BinaryData.fromObject(model).toObject(OrganizationPropertiesUpdate.class); + Assertions.assertEquals("zwtruwiqzbqjvsov", model.partnerProperties().organizationName()); + Assertions.assertEquals("okacspk", model.partnerProperties().billingEmail()); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.partnerProperties().ownerEmail()); + Assertions.assertEquals("cciw", model.user().firstName()); + Assertions.assertEquals("juqk", model.user().lastName()); + Assertions.assertEquals("sa", model.user().emailAddress()); + Assertions.assertEquals("wkuofoskghsauu", model.user().upn()); + Assertions.assertEquals("jmvxie", model.user().phoneNumber()); + Assertions.assertEquals("ugidyjrr", model.user().alternateEmail()); + Assertions.assertEquals("y", model.user().address()); + Assertions.assertEquals("v", model.companyDetails().companyName()); + Assertions.assertEquals("csonpclhoco", model.companyDetails().officeAddress()); + Assertions.assertEquals("lkevle", model.companyDetails().country()); + Assertions.assertEquals("zfbuhf", model.companyDetails().domain()); + Assertions.assertEquals("faxkffeii", model.companyDetails().businessType()); + Assertions.assertEquals(1914432251, model.companyDetails().numberOfEmployees()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceInnerTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceInnerTests.java new file mode 100644 index 0000000000000..cee3d62017ed1 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceInnerTests.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import com.azure.resourcemanager.koreaiartemis.models.DefaultWorkspaceProperties; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationProperties; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class OrganizationResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OrganizationResourceInner model = BinaryData.fromString( + "{\"properties\":{\"partnerProperties\":{\"organizationName\":\"ijbpzvgnwzsymgl\",\"billingEmail\":\"uf\",\"ownerEmail\":\"yzkohdbihanuf\",\"defaultWorkspace\":{\"name\":\"fcbjysagithxqha\",\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"subscriptionId\":\"kxwczbyscnpqxuhi\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"iwbybrkxvdumjg\",\"offerDetails\":{\"publisherId\":\"tfwvukxgaudc\",\"offerId\":\"snhsjcnyejhkryh\"}},{\"subscriptionId\":\"apcz\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"jye\",\"offerDetails\":{\"publisherId\":\"kkvnipjox\",\"offerId\":\"jnchgej\"}},{\"subscriptionId\":\"odmailzyd\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"wyahuxinpmqnja\",\"offerDetails\":{\"publisherId\":\"wixjsprozvcp\",\"offerId\":\"tegjvwmf\"}},{\"subscriptionId\":\"t\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"vpjhulsuuv\",\"offerDetails\":{\"publisherId\":\"kjozkrwfnd\",\"offerId\":\"odjpslwejd\"}}]},\"partnerResourceId\":\"wryoqpsoacc\"},\"user\":{\"firstName\":\"zakljlahbc\",\"lastName\":\"ffdfdosygexpa\",\"emailAddress\":\"akhmsbzjhcrz\",\"upn\":\"dphlxaolt\",\"phoneNumber\":\"trg\",\"alternateEmail\":\"bpf\",\"address\":\"s\"},\"companyDetails\":{\"companyName\":\"gvfcj\",\"officeAddress\":\"zoxxjtf\",\"country\":\"luwfzitonpeqfpjk\",\"domain\":\"xofpdvhpfxxypi\",\"businessType\":\"nmayhuybb\",\"numberOfEmployees\":49478059},\"singleSignOn\":{\"type\":\"Saml\",\"state\":\"Initial\",\"enterpriseAppId\":\"ginuvamih\",\"url\":\"gnarxzxtheo\",\"aadDomains\":[\"ivyevcciqihnhun\"]},\"defaultWorkspaceId\":\"wjzrnfygxgisp\",\"workspaceCount\":761437116,\"provisioningState\":\"Succeeded\"},\"location\":\"kufubljo\",\"tags\":{\"jbasvmsmjqulngs\":\"eofjaeqjh\"},\"id\":\"tnb\",\"name\":\"bkzgcwrwclx\",\"type\":\"wrljdouskc\"}") + .toObject(OrganizationResourceInner.class); + Assertions.assertEquals("kufubljo", model.location()); + Assertions.assertEquals("eofjaeqjh", model.tags().get("jbasvmsmjqulngs")); + Assertions.assertEquals("ijbpzvgnwzsymgl", model.properties().partnerProperties().organizationName()); + Assertions.assertEquals("uf", model.properties().partnerProperties().billingEmail()); + Assertions.assertEquals("yzkohdbihanuf", model.properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("fcbjysagithxqha", model.properties().partnerProperties().defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORSERVICE, + model.properties().partnerProperties().defaultWorkspace().product()); + Assertions.assertEquals("kxwczbyscnpqxuhi", + model.properties().partnerProperties().defaultWorkspace().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("iwbybrkxvdumjg", + model.properties().partnerProperties().defaultWorkspace().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("tfwvukxgaudc", + model.properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .publisherId()); + Assertions.assertEquals("snhsjcnyejhkryh", + model.properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .offerId()); + Assertions.assertEquals("zakljlahbc", model.properties().user().firstName()); + Assertions.assertEquals("ffdfdosygexpa", model.properties().user().lastName()); + Assertions.assertEquals("akhmsbzjhcrz", model.properties().user().emailAddress()); + Assertions.assertEquals("dphlxaolt", model.properties().user().upn()); + Assertions.assertEquals("trg", model.properties().user().phoneNumber()); + Assertions.assertEquals("bpf", model.properties().user().alternateEmail()); + Assertions.assertEquals("s", model.properties().user().address()); + Assertions.assertEquals("gvfcj", model.properties().companyDetails().companyName()); + Assertions.assertEquals("zoxxjtf", model.properties().companyDetails().officeAddress()); + Assertions.assertEquals("luwfzitonpeqfpjk", model.properties().companyDetails().country()); + Assertions.assertEquals("xofpdvhpfxxypi", model.properties().companyDetails().domain()); + Assertions.assertEquals("nmayhuybb", model.properties().companyDetails().businessType()); + Assertions.assertEquals(49478059, model.properties().companyDetails().numberOfEmployees()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationResourceInner model + = new OrganizationResourceInner().withLocation("kufubljo") + .withTags(mapOf("jbasvmsmjqulngs", "eofjaeqjh")) + .withProperties( + new OrganizationProperties() + .withPartnerProperties( + new OrganizationPartnerProperties().withOrganizationName("ijbpzvgnwzsymgl") + .withBillingEmail("uf") + .withOwnerEmail("yzkohdbihanuf") + .withDefaultWorkspace( + new DefaultWorkspaceProperties().withName("fcbjysagithxqha") + .withProduct(Product.AIFORSERVICE) + .withMarketplaceDetails(Arrays.asList( + new MarketplaceDetails().withSubscriptionId("kxwczbyscnpqxuhi") + .withSaasResourceId("iwbybrkxvdumjg") + .withOfferDetails(new OfferDetails().withPublisherId("tfwvukxgaudc") + .withOfferId("snhsjcnyejhkryh")), + new MarketplaceDetails().withSubscriptionId("apcz") + .withSaasResourceId("jye") + .withOfferDetails(new OfferDetails().withPublisherId("kkvnipjox") + .withOfferId("jnchgej")), + new MarketplaceDetails().withSubscriptionId("odmailzyd") + .withSaasResourceId("wyahuxinpmqnja") + .withOfferDetails(new OfferDetails().withPublisherId("wixjsprozvcp") + .withOfferId("tegjvwmf")), + new MarketplaceDetails().withSubscriptionId("t") + .withSaasResourceId("vpjhulsuuv") + .withOfferDetails(new OfferDetails().withPublisherId("kjozkrwfnd") + .withOfferId("odjpslwejd")))))) + .withUser(new UserDetails().withFirstName("zakljlahbc") + .withLastName("ffdfdosygexpa") + .withEmailAddress("akhmsbzjhcrz") + .withUpn("dphlxaolt") + .withPhoneNumber("trg") + .withAlternateEmail("bpf") + .withAddress("s")) + .withCompanyDetails(new CompanyDetails().withCompanyName("gvfcj") + .withOfficeAddress("zoxxjtf") + .withCountry("luwfzitonpeqfpjk") + .withDomain("xofpdvhpfxxypi") + .withBusinessType("nmayhuybb") + .withNumberOfEmployees(49478059))); + model = BinaryData.fromObject(model).toObject(OrganizationResourceInner.class); + Assertions.assertEquals("kufubljo", model.location()); + Assertions.assertEquals("eofjaeqjh", model.tags().get("jbasvmsmjqulngs")); + Assertions.assertEquals("ijbpzvgnwzsymgl", model.properties().partnerProperties().organizationName()); + Assertions.assertEquals("uf", model.properties().partnerProperties().billingEmail()); + Assertions.assertEquals("yzkohdbihanuf", model.properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("fcbjysagithxqha", model.properties().partnerProperties().defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORSERVICE, + model.properties().partnerProperties().defaultWorkspace().product()); + Assertions.assertEquals("kxwczbyscnpqxuhi", + model.properties().partnerProperties().defaultWorkspace().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("iwbybrkxvdumjg", + model.properties().partnerProperties().defaultWorkspace().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("tfwvukxgaudc", + model.properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .publisherId()); + Assertions.assertEquals("snhsjcnyejhkryh", + model.properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .offerId()); + Assertions.assertEquals("zakljlahbc", model.properties().user().firstName()); + Assertions.assertEquals("ffdfdosygexpa", model.properties().user().lastName()); + Assertions.assertEquals("akhmsbzjhcrz", model.properties().user().emailAddress()); + Assertions.assertEquals("dphlxaolt", model.properties().user().upn()); + Assertions.assertEquals("trg", model.properties().user().phoneNumber()); + Assertions.assertEquals("bpf", model.properties().user().alternateEmail()); + Assertions.assertEquals("s", model.properties().user().address()); + Assertions.assertEquals("gvfcj", model.properties().companyDetails().companyName()); + Assertions.assertEquals("zoxxjtf", model.properties().companyDetails().officeAddress()); + Assertions.assertEquals("luwfzitonpeqfpjk", model.properties().companyDetails().country()); + Assertions.assertEquals("xofpdvhpfxxypi", model.properties().companyDetails().domain()); + Assertions.assertEquals("nmayhuybb", model.properties().companyDetails().businessType()); + Assertions.assertEquals(49478059, model.properties().companyDetails().numberOfEmployees()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceListResultTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceListResultTests.java new file mode 100644 index 0000000000000..114b1a882fc66 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceListResultTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.implementation.models.OrganizationResourceListResult; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import org.junit.jupiter.api.Assertions; + +public final class OrganizationResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OrganizationResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"partnerProperties\":{\"organizationName\":\"rvjx\",\"billingEmail\":\"jnspydp\",\"ownerEmail\":\"koen\",\"defaultWorkspace\":{\"name\":\"ou\",\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"offerDetails\":{\"publisherId\":\"dwtiukbldngkp\",\"offerId\":\"cipazyxoegukgjnp\"}},{\"offerDetails\":{\"publisherId\":\"ucgygevqz\",\"offerId\":\"typmrbpizcdrqjsd\"}},{\"offerDetails\":{\"publisherId\":\"ydnfyhxdeoejz\",\"offerId\":\"cwif\"}}]},\"partnerResourceId\":\"ttgzfbis\"},\"user\":{\"firstName\":\"bkh\",\"lastName\":\"deyeamdphagalpbu\",\"emailAddress\":\"gipwhonowkg\",\"upn\":\"wankixzbi\",\"phoneNumber\":\"eputtmrywnuzoqf\",\"alternateEmail\":\"yqzrnkcqvyxlw\",\"address\":\"lsicohoqqnwv\"},\"companyDetails\":{\"companyName\":\"avwhheunm\",\"officeAddress\":\"hgyxzkonoc\",\"country\":\"oklyaxuconuq\",\"domain\":\"fkbey\",\"businessType\":\"wrmjmwvvjektc\",\"numberOfEmployees\":1803945661},\"singleSignOn\":{\"type\":\"Saml\",\"state\":\"Disable\",\"enterpriseAppId\":\"s\",\"url\":\"rzpwvlqdqgbiq\",\"aadDomains\":[\"hkaetcktvfc\",\"vf\",\"nkymuctqhjfbebrj\"]},\"defaultWorkspaceId\":\"erfuwuttt\",\"workspaceCount\":2038091366,\"provisioningState\":\"Failed\"},\"location\":\"i\",\"tags\":{\"jky\":\"xepcyvahfn\",\"ljyoxgvcltb\":\"xjvuujqgidokg\",\"bijhtxfvgxbf\":\"sncghkjeszz\",\"ec\":\"mxnehmp\"},\"id\":\"godebfqkkrbmpu\",\"name\":\"gr\",\"type\":\"wflzlfbxzpuzy\"},{\"properties\":{\"partnerProperties\":{\"organizationName\":\"spnqzahmgkb\",\"billingEmail\":\"pyydhi\",\"ownerEmail\":\"nuqqkpikadrgvt\",\"defaultWorkspace\":{\"name\":\"agnb\",\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"offerDetails\":{\"publisherId\":\"ijggmebfsiar\",\"offerId\":\"utrc\"}},{\"offerDetails\":{\"publisherId\":\"pnazzm\",\"offerId\":\"jrunmpxtt\"}}]},\"partnerResourceId\":\"hrbnlankxmyskpbh\"},\"user\":{\"firstName\":\"btkcxywnytnrsyn\",\"lastName\":\"idybyxczf\",\"emailAddress\":\"haaxdbabphl\",\"upn\":\"qlfktsths\",\"phoneNumber\":\"ocmnyyazttbtwwrq\",\"alternateEmail\":\"edckzywbiexzfey\",\"address\":\"axibxujw\"},\"companyDetails\":{\"companyName\":\"walm\",\"officeAddress\":\"yoxa\",\"country\":\"dkzjancuxrh\",\"domain\":\"bavxbniwdjswzt\",\"businessType\":\"bpg\",\"numberOfEmployees\":1127167490},\"singleSignOn\":{\"type\":\"Saml\",\"state\":\"Enable\",\"enterpriseAppId\":\"xbzpfzab\",\"url\":\"cuh\",\"aadDomains\":[\"ctyqik\"]},\"defaultWorkspaceId\":\"bovpl\",\"workspaceCount\":1271650742,\"provisioningState\":\"Canceled\"},\"location\":\"yuguosvmkfssx\",\"tags\":{\"zkd\":\"kfplgmgsxnk\",\"i\":\"slpvlop\"},\"id\":\"ighxpk\",\"name\":\"wzbaiue\",\"type\":\"baumnyqupedeoj\"},{\"properties\":{\"partnerProperties\":{\"organizationName\":\"bckhsmtxpsi\",\"billingEmail\":\"btfhvpesaps\",\"ownerEmail\":\"rdqmhjjdhtldwkyz\",\"defaultWorkspace\":{\"name\":\"uutkncw\",\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"offerDetails\":{\"publisherId\":\"vlxotogtwrupqsx\",\"offerId\":\"nmic\"}},{\"offerDetails\":{\"publisherId\":\"kvceoveilovnotyf\",\"offerId\":\"fcnj\"}},{\"offerDetails\":{\"publisherId\":\"k\",\"offerId\":\"nxdhbt\"}},{\"offerDetails\":{\"publisherId\":\"kphywpnvjto\",\"offerId\":\"nermcl\"}}]},\"partnerResourceId\":\"lphox\"},\"user\":{\"firstName\":\"crpab\",\"lastName\":\"epsbjtazqu\",\"emailAddress\":\"ywpmueefjzwfqkq\",\"upn\":\"ids\",\"phoneNumber\":\"onobglaocqx\",\"alternateEmail\":\"cmgyud\",\"address\":\"tlmoyrx\"},\"companyDetails\":{\"companyName\":\"u\",\"officeAddress\":\"pz\",\"country\":\"xhdzhlrqjbhckf\",\"domain\":\"hrxsbk\",\"businessType\":\"pycanuzbpz\",\"numberOfEmployees\":2083738412},\"singleSignOn\":{\"type\":\"Saml\",\"state\":\"Disable\",\"enterpriseAppId\":\"rnwb\",\"url\":\"hhseyv\",\"aadDomains\":[\"rts\",\"hspkdeemao\",\"mx\",\"gkvtmelmqkrhah\"]},\"defaultWorkspaceId\":\"juahaquhcdhmdual\",\"workspaceCount\":115440556,\"provisioningState\":\"Canceled\"},\"location\":\"fadmws\",\"tags\":{\"gomz\":\"gvxp\"},\"id\":\"fmisg\",\"name\":\"bnbbeldawkz\",\"type\":\"ali\"}],\"nextLink\":\"rqhakauha\"}") + .toObject(OrganizationResourceListResult.class); + Assertions.assertEquals("i", model.value().get(0).location()); + Assertions.assertEquals("xepcyvahfn", model.value().get(0).tags().get("jky")); + Assertions.assertEquals("rvjx", model.value().get(0).properties().partnerProperties().organizationName()); + Assertions.assertEquals("jnspydp", model.value().get(0).properties().partnerProperties().billingEmail()); + Assertions.assertEquals("koen", model.value().get(0).properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("ou", model.value().get(0).properties().partnerProperties().defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORSERVICE, + model.value().get(0).properties().partnerProperties().defaultWorkspace().product()); + Assertions.assertEquals("dwtiukbldngkp", + model.value() + .get(0) + .properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .publisherId()); + Assertions.assertEquals("cipazyxoegukgjnp", + model.value() + .get(0) + .properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .offerId()); + Assertions.assertEquals("bkh", model.value().get(0).properties().user().firstName()); + Assertions.assertEquals("deyeamdphagalpbu", model.value().get(0).properties().user().lastName()); + Assertions.assertEquals("gipwhonowkg", model.value().get(0).properties().user().emailAddress()); + Assertions.assertEquals("wankixzbi", model.value().get(0).properties().user().upn()); + Assertions.assertEquals("eputtmrywnuzoqf", model.value().get(0).properties().user().phoneNumber()); + Assertions.assertEquals("yqzrnkcqvyxlw", model.value().get(0).properties().user().alternateEmail()); + Assertions.assertEquals("lsicohoqqnwv", model.value().get(0).properties().user().address()); + Assertions.assertEquals("avwhheunm", model.value().get(0).properties().companyDetails().companyName()); + Assertions.assertEquals("hgyxzkonoc", model.value().get(0).properties().companyDetails().officeAddress()); + Assertions.assertEquals("oklyaxuconuq", model.value().get(0).properties().companyDetails().country()); + Assertions.assertEquals("fkbey", model.value().get(0).properties().companyDetails().domain()); + Assertions.assertEquals("wrmjmwvvjektc", model.value().get(0).properties().companyDetails().businessType()); + Assertions.assertEquals(1803945661, model.value().get(0).properties().companyDetails().numberOfEmployees()); + Assertions.assertEquals("rqhakauha", model.nextLink()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceUpdateTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceUpdateTests.java new file mode 100644 index 0000000000000..d0a9a024e3c58 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationResourceUpdateTests.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerPropertiesUpdate; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPropertiesUpdate; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResourceUpdate; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class OrganizationResourceUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OrganizationResourceUpdate model = BinaryData.fromString( + "{\"tags\":{\"pngjcrcczsqpjhvm\":\"eyyvxyqjpkcat\",\"a\":\"ajvnysounqe\"},\"properties\":{\"partnerProperties\":{\"organizationName\":\"upfh\",\"billingEmail\":\"ltrpmopj\",\"ownerEmail\":\"matuok\"},\"user\":{\"firstName\":\"uiuaodsfcpkvxodp\",\"lastName\":\"zmyzydagf\",\"emailAddress\":\"xbezyiuokktwh\",\"upn\":\"xw\",\"phoneNumber\":\"wqsmbsur\",\"alternateEmail\":\"imoryocfsfksym\",\"address\":\"ys\"},\"companyDetails\":{\"companyName\":\"iuxhqyudxorr\",\"officeAddress\":\"b\",\"country\":\"czvyifq\",\"domain\":\"kdvjsll\",\"businessType\":\"vvdfwatkpnpul\",\"numberOfEmployees\":891101767}}}") + .toObject(OrganizationResourceUpdate.class); + Assertions.assertEquals("eyyvxyqjpkcat", model.tags().get("pngjcrcczsqpjhvm")); + Assertions.assertEquals("upfh", model.properties().partnerProperties().organizationName()); + Assertions.assertEquals("ltrpmopj", model.properties().partnerProperties().billingEmail()); + Assertions.assertEquals("matuok", model.properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("uiuaodsfcpkvxodp", model.properties().user().firstName()); + Assertions.assertEquals("zmyzydagf", model.properties().user().lastName()); + Assertions.assertEquals("xbezyiuokktwh", model.properties().user().emailAddress()); + Assertions.assertEquals("xw", model.properties().user().upn()); + Assertions.assertEquals("wqsmbsur", model.properties().user().phoneNumber()); + Assertions.assertEquals("imoryocfsfksym", model.properties().user().alternateEmail()); + Assertions.assertEquals("ys", model.properties().user().address()); + Assertions.assertEquals("iuxhqyudxorr", model.properties().companyDetails().companyName()); + Assertions.assertEquals("b", model.properties().companyDetails().officeAddress()); + Assertions.assertEquals("czvyifq", model.properties().companyDetails().country()); + Assertions.assertEquals("kdvjsll", model.properties().companyDetails().domain()); + Assertions.assertEquals("vvdfwatkpnpul", model.properties().companyDetails().businessType()); + Assertions.assertEquals(891101767, model.properties().companyDetails().numberOfEmployees()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationResourceUpdate model + = new OrganizationResourceUpdate().withTags(mapOf("pngjcrcczsqpjhvm", "eyyvxyqjpkcat", "a", "ajvnysounqe")) + .withProperties(new OrganizationPropertiesUpdate() + .withPartnerProperties(new OrganizationPartnerPropertiesUpdate().withOrganizationName("upfh") + .withBillingEmail("ltrpmopj") + .withOwnerEmail("matuok")) + .withUser(new UserDetails().withFirstName("uiuaodsfcpkvxodp") + .withLastName("zmyzydagf") + .withEmailAddress("xbezyiuokktwh") + .withUpn("xw") + .withPhoneNumber("wqsmbsur") + .withAlternateEmail("imoryocfsfksym") + .withAddress("ys")) + .withCompanyDetails(new CompanyDetails().withCompanyName("iuxhqyudxorr") + .withOfficeAddress("b") + .withCountry("czvyifq") + .withDomain("kdvjsll") + .withBusinessType("vvdfwatkpnpul") + .withNumberOfEmployees(891101767))); + model = BinaryData.fromObject(model).toObject(OrganizationResourceUpdate.class); + Assertions.assertEquals("eyyvxyqjpkcat", model.tags().get("pngjcrcczsqpjhvm")); + Assertions.assertEquals("upfh", model.properties().partnerProperties().organizationName()); + Assertions.assertEquals("ltrpmopj", model.properties().partnerProperties().billingEmail()); + Assertions.assertEquals("matuok", model.properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("uiuaodsfcpkvxodp", model.properties().user().firstName()); + Assertions.assertEquals("zmyzydagf", model.properties().user().lastName()); + Assertions.assertEquals("xbezyiuokktwh", model.properties().user().emailAddress()); + Assertions.assertEquals("xw", model.properties().user().upn()); + Assertions.assertEquals("wqsmbsur", model.properties().user().phoneNumber()); + Assertions.assertEquals("imoryocfsfksym", model.properties().user().alternateEmail()); + Assertions.assertEquals("ys", model.properties().user().address()); + Assertions.assertEquals("iuxhqyudxorr", model.properties().companyDetails().companyName()); + Assertions.assertEquals("b", model.properties().companyDetails().officeAddress()); + Assertions.assertEquals("czvyifq", model.properties().companyDetails().country()); + Assertions.assertEquals("kdvjsll", model.properties().companyDetails().domain()); + Assertions.assertEquals("vvdfwatkpnpul", model.properties().companyDetails().businessType()); + Assertions.assertEquals(891101767, model.properties().companyDetails().numberOfEmployees()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsCreateMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsCreateMockTests.java new file mode 100644 index 0000000000000..cbae0d76fa4ad --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsCreateMockTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.CompanyDetails; +import com.azure.resourcemanager.koreaiartemis.models.DefaultWorkspaceProperties; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationPartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationProperties; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResource; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OrganizationsCreateMockTests { + @Test + public void testCreate() throws Exception { + String responseStr + = "{\"properties\":{\"partnerProperties\":{\"organizationName\":\"oimwkslirc\",\"billingEmail\":\"zjxvydfcea\",\"ownerEmail\":\"vlhv\",\"defaultWorkspace\":{\"name\":\"gdyftumrtwna\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"offerDetails\":{\"publisherId\":\"biwkojgcyzt\",\"offerId\":\"fmznba\"}}]},\"partnerResourceId\":\"ph\"},\"user\":{\"firstName\":\"qnrnrpxehuwryk\",\"lastName\":\"aifmvikl\",\"emailAddress\":\"dvk\",\"upn\":\"ejd\",\"phoneNumber\":\"xcv\",\"alternateEmail\":\"rhnj\",\"address\":\"olvtnovqfzge\"},\"companyDetails\":{\"companyName\":\"ftul\",\"officeAddress\":\"tduceamt\",\"country\":\"zuo\",\"domain\":\"jw\",\"businessType\":\"wqiok\",\"numberOfEmployees\":373495652},\"singleSignOn\":{\"type\":\"OpenId\",\"state\":\"Initial\",\"enterpriseAppId\":\"sv\",\"url\":\"jpr\",\"aadDomains\":[\"cfzq\",\"jyxgtczh\",\"ydbsd\"]},\"defaultWorkspaceId\":\"m\",\"workspaceCount\":839107227,\"provisioningState\":\"Succeeded\"},\"location\":\"vbbxuripl\",\"tags\":{\"kgxywr\":\"htba\"},\"id\":\"kpyklyhp\",\"name\":\"uodpv\",\"type\":\"uudl\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + OrganizationResource response = manager.organizations() + .define("nnxk") + .withRegion("mrsreuzvxurisjnh") + .withExistingResourceGroup("wesgogczh") + .withTags(mapOf("hu", "xifqjzgxm", "cesutrgjupauut", "lw")) + .withProperties(new OrganizationProperties() + .withPartnerProperties(new OrganizationPartnerProperties().withOrganizationName("gnyhmossxkkg") + .withBillingEmail("h") + .withOwnerEmail("rghxjb") + .withDefaultWorkspace(new DefaultWorkspaceProperties().withName("hqxvcxgfrpdsofbs") + .withProduct(Product.AIFORSERVICE) + .withMarketplaceDetails(Arrays.asList( + new MarketplaceDetails() + .withOfferDetails(new OfferDetails().withPublisherId("vbuswd").withOfferId("z")), + new MarketplaceDetails().withOfferDetails( + new OfferDetails().withPublisherId("ybycnunvj").withOfferId("rtkfawnopq")), + new MarketplaceDetails() + .withOfferDetails(new OfferDetails().withPublisherId("ikyzirtxdy").withOfferId("x")))))) + .withUser(new UserDetails().withFirstName("ydxtqm") + .withLastName("ox") + .withEmailAddress("ggufhyaomtb") + .withUpn("havgrvk") + .withPhoneNumber("ovjzhpjbibgjmfx") + .withAlternateEmail("vfcluyovwxnbkfe") + .withAddress("xscyhwzdgirujbz")) + .withCompanyDetails(new CompanyDetails().withCompanyName("vzzbtdcq") + .withOfficeAddress("niyujv") + .withCountry("l") + .withDomain("shfssnrbgyef") + .withBusinessType("msgaoj") + .withNumberOfEmployees(1126923901))) + .create(); + + Assertions.assertEquals("vbbxuripl", response.location()); + Assertions.assertEquals("htba", response.tags().get("kgxywr")); + Assertions.assertEquals("oimwkslirc", response.properties().partnerProperties().organizationName()); + Assertions.assertEquals("zjxvydfcea", response.properties().partnerProperties().billingEmail()); + Assertions.assertEquals("vlhv", response.properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("gdyftumrtwna", response.properties().partnerProperties().defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORWORK, + response.properties().partnerProperties().defaultWorkspace().product()); + Assertions.assertEquals("biwkojgcyzt", + response.properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .publisherId()); + Assertions.assertEquals("fmznba", + response.properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .offerId()); + Assertions.assertEquals("qnrnrpxehuwryk", response.properties().user().firstName()); + Assertions.assertEquals("aifmvikl", response.properties().user().lastName()); + Assertions.assertEquals("dvk", response.properties().user().emailAddress()); + Assertions.assertEquals("ejd", response.properties().user().upn()); + Assertions.assertEquals("xcv", response.properties().user().phoneNumber()); + Assertions.assertEquals("rhnj", response.properties().user().alternateEmail()); + Assertions.assertEquals("olvtnovqfzge", response.properties().user().address()); + Assertions.assertEquals("ftul", response.properties().companyDetails().companyName()); + Assertions.assertEquals("tduceamt", response.properties().companyDetails().officeAddress()); + Assertions.assertEquals("zuo", response.properties().companyDetails().country()); + Assertions.assertEquals("jw", response.properties().companyDetails().domain()); + Assertions.assertEquals("wqiok", response.properties().companyDetails().businessType()); + Assertions.assertEquals(373495652, response.properties().companyDetails().numberOfEmployees()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 0000000000000..25cc4b2bdddad --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResource; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OrganizationsGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"partnerProperties\":{\"organizationName\":\"kopbminrf\",\"billingEmail\":\"woyuhhziuief\",\"ownerEmail\":\"zbhd\",\"defaultWorkspace\":{\"name\":\"smlmzqhoftrm\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"offerDetails\":{\"publisherId\":\"iahxicsl\",\"offerId\":\"aoqzpiyylhaln\"}}]},\"partnerResourceId\":\"hc\"},\"user\":{\"firstName\":\"ph\",\"lastName\":\"ivwitqscywugg\",\"emailAddress\":\"luhczbw\",\"upn\":\"hairsbrgzdwms\",\"phoneNumber\":\"ypqwdxggiccc\",\"alternateEmail\":\"qhuexm\",\"address\":\"tlstvlzywem\"},\"companyDetails\":{\"companyName\":\"ncsdtclusiyp\",\"officeAddress\":\"fgytguslfeadcyg\",\"country\":\"kyhejhzisxgf\",\"domain\":\"lolp\",\"businessType\":\"ksrpqv\",\"numberOfEmployees\":2128211402},\"singleSignOn\":{\"type\":\"Saml\",\"state\":\"Disable\",\"enterpriseAppId\":\"w\",\"url\":\"r\",\"aadDomains\":[\"wib\",\"rcdlbhshfwpr\"]},\"defaultWorkspaceId\":\"stwit\",\"workspaceCount\":1950928117,\"provisioningState\":\"Succeeded\"},\"location\":\"c\",\"tags\":{\"zxltjcvn\":\"cpnmdyodn\",\"xqi\":\"ltiugcxnavv\",\"unyowxwl\":\"y\"},\"id\":\"djrkvfgbvfvpd\",\"name\":\"odacizs\",\"type\":\"q\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + OrganizationResource response = manager.organizations() + .getByResourceGroupWithResponse("grtwae", "u", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("c", response.location()); + Assertions.assertEquals("cpnmdyodn", response.tags().get("zxltjcvn")); + Assertions.assertEquals("kopbminrf", response.properties().partnerProperties().organizationName()); + Assertions.assertEquals("woyuhhziuief", response.properties().partnerProperties().billingEmail()); + Assertions.assertEquals("zbhd", response.properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("smlmzqhoftrm", response.properties().partnerProperties().defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORWORK, + response.properties().partnerProperties().defaultWorkspace().product()); + Assertions.assertEquals("iahxicsl", + response.properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .publisherId()); + Assertions.assertEquals("aoqzpiyylhaln", + response.properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .offerId()); + Assertions.assertEquals("ph", response.properties().user().firstName()); + Assertions.assertEquals("ivwitqscywugg", response.properties().user().lastName()); + Assertions.assertEquals("luhczbw", response.properties().user().emailAddress()); + Assertions.assertEquals("hairsbrgzdwms", response.properties().user().upn()); + Assertions.assertEquals("ypqwdxggiccc", response.properties().user().phoneNumber()); + Assertions.assertEquals("qhuexm", response.properties().user().alternateEmail()); + Assertions.assertEquals("tlstvlzywem", response.properties().user().address()); + Assertions.assertEquals("ncsdtclusiyp", response.properties().companyDetails().companyName()); + Assertions.assertEquals("fgytguslfeadcyg", response.properties().companyDetails().officeAddress()); + Assertions.assertEquals("kyhejhzisxgf", response.properties().companyDetails().country()); + Assertions.assertEquals("lolp", response.properties().companyDetails().domain()); + Assertions.assertEquals("ksrpqv", response.properties().companyDetails().businessType()); + Assertions.assertEquals(2128211402, response.properties().companyDetails().numberOfEmployees()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListByResourceGroupMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListByResourceGroupMockTests.java new file mode 100644 index 0000000000000..d0ae01bdfb65f --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListByResourceGroupMockTests.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResource; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OrganizationsListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"partnerProperties\":{\"organizationName\":\"bdeibqipqk\",\"billingEmail\":\"hvxndzwmkrefajpj\",\"ownerEmail\":\"rwkq\",\"defaultWorkspace\":{\"name\":\"yhgbijtjivfx\",\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"offerDetails\":{\"publisherId\":\"bibsystawfsdjpvk\",\"offerId\":\"p\"}}]},\"partnerResourceId\":\"xbkzbzkdvncj\"},\"user\":{\"firstName\":\"udurgkakmokz\",\"lastName\":\"jk\",\"emailAddress\":\"fhmouwq\",\"upn\":\"zrfze\",\"phoneNumber\":\"ebizikayuh\",\"alternateEmail\":\"bjbsybb\",\"address\":\"r\"},\"companyDetails\":{\"companyName\":\"dgmfpgvmpipasl\",\"officeAddress\":\"aqfxss\",\"country\":\"u\",\"domain\":\"bdsrez\",\"businessType\":\"rhneuyowq\",\"numberOfEmployees\":638872994},\"singleSignOn\":{\"type\":\"Saml\",\"state\":\"Disable\",\"enterpriseAppId\":\"bi\",\"url\":\"gpikpzimejza\",\"aadDomains\":[\"zxiavrm\",\"zonokixrjqci\",\"gzpfrla\"]},\"defaultWorkspaceId\":\"zrnw\",\"workspaceCount\":409653705,\"provisioningState\":\"Succeeded\"},\"location\":\"pwp\",\"tags\":{\"zfjvfbgofe\":\"wbtlhflsjcdh\",\"iiojnal\":\"jagrqmqhldvr\"},\"id\":\"hfkvtvsexsowuel\",\"name\":\"qhhahhxvrhmzkwpj\",\"type\":\"wws\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.organizations().listByResourceGroup("hkr", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("pwp", response.iterator().next().location()); + Assertions.assertEquals("wbtlhflsjcdh", response.iterator().next().tags().get("zfjvfbgofe")); + Assertions.assertEquals("bdeibqipqk", + response.iterator().next().properties().partnerProperties().organizationName()); + Assertions.assertEquals("hvxndzwmkrefajpj", + response.iterator().next().properties().partnerProperties().billingEmail()); + Assertions.assertEquals("rwkq", response.iterator().next().properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("yhgbijtjivfx", + response.iterator().next().properties().partnerProperties().defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORSERVICE, + response.iterator().next().properties().partnerProperties().defaultWorkspace().product()); + Assertions.assertEquals("bibsystawfsdjpvk", + response.iterator() + .next() + .properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .publisherId()); + Assertions.assertEquals("p", + response.iterator() + .next() + .properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .offerId()); + Assertions.assertEquals("udurgkakmokz", response.iterator().next().properties().user().firstName()); + Assertions.assertEquals("jk", response.iterator().next().properties().user().lastName()); + Assertions.assertEquals("fhmouwq", response.iterator().next().properties().user().emailAddress()); + Assertions.assertEquals("zrfze", response.iterator().next().properties().user().upn()); + Assertions.assertEquals("ebizikayuh", response.iterator().next().properties().user().phoneNumber()); + Assertions.assertEquals("bjbsybb", response.iterator().next().properties().user().alternateEmail()); + Assertions.assertEquals("r", response.iterator().next().properties().user().address()); + Assertions.assertEquals("dgmfpgvmpipasl", + response.iterator().next().properties().companyDetails().companyName()); + Assertions.assertEquals("aqfxss", response.iterator().next().properties().companyDetails().officeAddress()); + Assertions.assertEquals("u", response.iterator().next().properties().companyDetails().country()); + Assertions.assertEquals("bdsrez", response.iterator().next().properties().companyDetails().domain()); + Assertions.assertEquals("rhneuyowq", response.iterator().next().properties().companyDetails().businessType()); + Assertions.assertEquals(638872994, + response.iterator().next().properties().companyDetails().numberOfEmployees()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListMockTests.java new file mode 100644 index 0000000000000..98c597538e592 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListMockTests.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.OrganizationResource; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OrganizationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"partnerProperties\":{\"organizationName\":\"ghftqsxhqxujxuk\",\"billingEmail\":\"dxdigr\",\"ownerEmail\":\"guufzd\",\"defaultWorkspace\":{\"name\":\"syqtfi\",\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"offerDetails\":{\"publisherId\":\"otzi\",\"offerId\":\"gamv\"}},{\"offerDetails\":{\"publisherId\":\"phoszqz\",\"offerId\":\"dphqamv\"}},{\"offerDetails\":{\"publisherId\":\"kfwynw\",\"offerId\":\"vtbvkayh\"}},{\"offerDetails\":{\"publisherId\":\"tnvyqiatkzwp\",\"offerId\":\"npwzcjaes\"}}]},\"partnerResourceId\":\"v\"},\"user\":{\"firstName\":\"cyajguqf\",\"lastName\":\"ygz\",\"emailAddress\":\"dnkfx\",\"upn\":\"emdwzrmuhapfc\",\"phoneNumber\":\"psqxq\",\"alternateEmail\":\"svuo\",\"address\":\"gc\"},\"companyDetails\":{\"companyName\":\"vezrypqlmfeo\",\"officeAddress\":\"rqwky\",\"country\":\"ob\",\"domain\":\"gxedkow\",\"businessType\":\"bqpc\",\"numberOfEmployees\":1318988279},\"singleSignOn\":{\"type\":\"OpenId\",\"state\":\"Disable\",\"enterpriseAppId\":\"njv\",\"url\":\"wxlp\",\"aadDomains\":[\"ftnkhtj\",\"y\",\"ngwfqatm\"]},\"defaultWorkspaceId\":\"htmdvy\",\"workspaceCount\":932898449,\"provisioningState\":\"Succeeded\"},\"location\":\"szywkbirryu\",\"tags\":{\"qqaatjinrvgou\":\"hkjoqr\",\"ool\":\"mfiibfggj\",\"qwjygvja\":\"rwxkvtkkgl\"},\"id\":\"vblm\",\"name\":\"vkzuhbxvvyhgso\",\"type\":\"byrqufeg\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.organizations().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("szywkbirryu", response.iterator().next().location()); + Assertions.assertEquals("hkjoqr", response.iterator().next().tags().get("qqaatjinrvgou")); + Assertions.assertEquals("ghftqsxhqxujxuk", + response.iterator().next().properties().partnerProperties().organizationName()); + Assertions.assertEquals("dxdigr", response.iterator().next().properties().partnerProperties().billingEmail()); + Assertions.assertEquals("guufzd", response.iterator().next().properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("syqtfi", + response.iterator().next().properties().partnerProperties().defaultWorkspace().name()); + Assertions.assertEquals(Product.AIFORSERVICE, + response.iterator().next().properties().partnerProperties().defaultWorkspace().product()); + Assertions.assertEquals("otzi", + response.iterator() + .next() + .properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .publisherId()); + Assertions.assertEquals("gamv", + response.iterator() + .next() + .properties() + .partnerProperties() + .defaultWorkspace() + .marketplaceDetails() + .get(0) + .offerDetails() + .offerId()); + Assertions.assertEquals("cyajguqf", response.iterator().next().properties().user().firstName()); + Assertions.assertEquals("ygz", response.iterator().next().properties().user().lastName()); + Assertions.assertEquals("dnkfx", response.iterator().next().properties().user().emailAddress()); + Assertions.assertEquals("emdwzrmuhapfc", response.iterator().next().properties().user().upn()); + Assertions.assertEquals("psqxq", response.iterator().next().properties().user().phoneNumber()); + Assertions.assertEquals("svuo", response.iterator().next().properties().user().alternateEmail()); + Assertions.assertEquals("gc", response.iterator().next().properties().user().address()); + Assertions.assertEquals("vezrypqlmfeo", response.iterator().next().properties().companyDetails().companyName()); + Assertions.assertEquals("rqwky", response.iterator().next().properties().companyDetails().officeAddress()); + Assertions.assertEquals("ob", response.iterator().next().properties().companyDetails().country()); + Assertions.assertEquals("gxedkow", response.iterator().next().properties().companyDetails().domain()); + Assertions.assertEquals("bqpc", response.iterator().next().properties().companyDetails().businessType()); + Assertions.assertEquals(1318988279, + response.iterator().next().properties().companyDetails().numberOfEmployees()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListWorkspacesWithResponseMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListWorkspacesWithResponseMockTests.java new file mode 100644 index 0000000000000..2fe6d69401bde --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/OrganizationsListWorkspacesWithResponseMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.ListWorkspacesResponse; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLifecycleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OrganizationsListWorkspacesWithResponseMockTests { + @Test + public void testListWorkspacesWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"partnerResourceId\":\"mhrixkwmyijejve\",\"name\":\"rh\",\"ownerEmail\":\"nai\",\"isDefault\":true,\"status\":\"archived\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"xhcexdrrvqahq\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"pwijnhy\",\"offerDetails\":{\"publisherId\":\"svfycxzbfv\",\"offerId\":\"owvrvmtgjqppyos\"}},{\"subscriptionId\":\"on\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"gfipnsxk\",\"offerDetails\":{\"publisherId\":\"cwaekrrjre\",\"offerId\":\"fxtsgum\"}},{\"subscriptionId\":\"glikkxwslolb\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"zlmvfelfktgp\",\"offerDetails\":{\"publisherId\":\"crpw\",\"offerId\":\"xeznoi\"}},{\"subscriptionId\":\"rnjwmw\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"saz\",\"offerDetails\":{\"publisherId\":\"jjoqkagf\",\"offerId\":\"sxtta\"}}],\"isManagedByLiftr\":true,\"armResourceId\":\"xnfaazpxdtnk\"},{\"partnerResourceId\":\"mkqjj\",\"name\":\"wuenvr\",\"ownerEmail\":\"yo\",\"isDefault\":false,\"status\":\"active\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"ysjkixqtnqttez\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"fiakpjpqqm\",\"offerDetails\":{\"publisherId\":\"edltmmjihyeozp\",\"offerId\":\"vwau\"}}],\"isManagedByLiftr\":true,\"armResourceId\":\"c\"},{\"partnerResourceId\":\"gupkvipmdscwxq\",\"name\":\"pevzhfst\",\"ownerEmail\":\"xhojuj\",\"isDefault\":true,\"status\":\"suspended\",\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"ixbjx\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"yl\",\"offerDetails\":{\"publisherId\":\"coolsttpkiwkkb\",\"offerId\":\"ujrywvtyl\"}},{\"subscriptionId\":\"pncur\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"iithtywu\",\"offerDetails\":{\"publisherId\":\"xcbihw\",\"offerId\":\"knfd\"}}],\"isManagedByLiftr\":false,\"armResourceId\":\"jchrdgoihxumw\"},{\"partnerResourceId\":\"ton\",\"name\":\"zj\",\"ownerEmail\":\"udfdlwgg\",\"isDefault\":false,\"status\":\"active\",\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"subscriptionId\":\"gseinq\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"x\",\"offerDetails\":{\"publisherId\":\"knpirgnepttwq\",\"offerId\":\"sniffc\"}},{\"subscriptionId\":\"qnrojlpijnkrxfrd\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"atiz\",\"offerDetails\":{\"publisherId\":\"ronasxift\",\"offerId\":\"zq\"}}],\"isManagedByLiftr\":false,\"armResourceId\":\"f\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ListWorkspacesResponse response = manager.organizations() + .listWorkspacesWithResponse("uvwzfbnh", "mctlpdngitv", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("mhrixkwmyijejve", response.value().get(0).partnerResourceId()); + Assertions.assertEquals("rh", response.value().get(0).name()); + Assertions.assertEquals("nai", response.value().get(0).ownerEmail()); + Assertions.assertTrue(response.value().get(0).isDefault()); + Assertions.assertEquals(WorkspaceLifecycleStatus.ARCHIVED, response.value().get(0).status()); + Assertions.assertEquals(Product.AIFORWORK, response.value().get(0).product()); + Assertions.assertEquals("xhcexdrrvqahq", response.value().get(0).marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("pwijnhy", response.value().get(0).marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("svfycxzbfv", + response.value().get(0).marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("owvrvmtgjqppyos", + response.value().get(0).marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertTrue(response.value().get(0).isManagedByLiftr()); + Assertions.assertEquals("xnfaazpxdtnk", response.value().get(0).armResourceId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSOperationGroupsActivateResourceMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSOperationGroupsActivateResourceMockTests.java new file mode 100644 index 0000000000000..1dc3c2a479aab --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSOperationGroupsActivateResourceMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.ActivateSaaSParameterRequest; +import com.azure.resourcemanager.koreaiartemis.models.SaaSResourceDetailsResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SaaSOperationGroupsActivateResourceMockTests { + @Test + public void testActivateResource() throws Exception { + String responseStr = "{\"saasId\":\"dxeclzedqbcvh\",\"id\":\"h\",\"name\":\"lodqkdlwwqfbu\",\"type\":\"lkxt\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SaaSResourceDetailsResponse response = manager.saaSOperationGroups() + .activateResource(new ActivateSaaSParameterRequest().withSaasGuid("zibt").withPublisherId("ostgkts"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("dxeclzedqbcvh", response.saasId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSResourceDetailsResponseInnerTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSResourceDetailsResponseInnerTests.java new file mode 100644 index 0000000000000..23f7626a48de2 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SaaSResourceDetailsResponseInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.fluent.models.SaaSResourceDetailsResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class SaaSResourceDetailsResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SaaSResourceDetailsResponseInner model + = BinaryData.fromString("{\"saasId\":\"efyw\",\"id\":\"pfvmwyhrfou\",\"name\":\"ft\",\"type\":\"akcp\"}") + .toObject(SaaSResourceDetailsResponseInner.class); + Assertions.assertEquals("efyw", model.saasId()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SingleSignOnPropertiesTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SingleSignOnPropertiesTests.java new file mode 100644 index 0000000000000..b5ff51bca1218 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/SingleSignOnPropertiesTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.SingleSignOnProperties; +import com.azure.resourcemanager.koreaiartemis.models.SingleSignOnStates; +import com.azure.resourcemanager.koreaiartemis.models.SingleSignOnType; +import org.junit.jupiter.api.Assertions; + +public final class SingleSignOnPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SingleSignOnProperties model = BinaryData.fromString( + "{\"type\":\"Saml\",\"state\":\"Enable\",\"enterpriseAppId\":\"tynnaamdectehfi\",\"url\":\"cj\",\"aadDomains\":[\"vhezrkgqhcj\",\"efovgmk\"]}") + .toObject(SingleSignOnProperties.class); + Assertions.assertEquals(SingleSignOnType.SAML, model.type()); + Assertions.assertEquals(SingleSignOnStates.ENABLE, model.state()); + Assertions.assertEquals("tynnaamdectehfi", model.enterpriseAppId()); + Assertions.assertEquals("cj", model.url()); + Assertions.assertEquals("vhezrkgqhcj", model.aadDomains().get(0)); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/UserDetailsTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/UserDetailsTests.java new file mode 100644 index 0000000000000..70a7c0bd8adbd --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/UserDetailsTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.UserDetails; +import org.junit.jupiter.api.Assertions; + +public final class UserDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserDetails model = BinaryData.fromString( + "{\"firstName\":\"cynpwlbjnp\",\"lastName\":\"cftadeh\",\"emailAddress\":\"ltyfsop\",\"upn\":\"suesnzw\",\"phoneNumber\":\"jbavorxzdm\",\"alternateEmail\":\"ctbqvudwx\",\"address\":\"dnvowg\"}") + .toObject(UserDetails.class); + Assertions.assertEquals("cynpwlbjnp", model.firstName()); + Assertions.assertEquals("cftadeh", model.lastName()); + Assertions.assertEquals("ltyfsop", model.emailAddress()); + Assertions.assertEquals("suesnzw", model.upn()); + Assertions.assertEquals("jbavorxzdm", model.phoneNumber()); + Assertions.assertEquals("ctbqvudwx", model.alternateEmail()); + Assertions.assertEquals("dnvowg", model.address()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserDetails model = new UserDetails().withFirstName("cynpwlbjnp") + .withLastName("cftadeh") + .withEmailAddress("ltyfsop") + .withUpn("suesnzw") + .withPhoneNumber("jbavorxzdm") + .withAlternateEmail("ctbqvudwx") + .withAddress("dnvowg"); + model = BinaryData.fromObject(model).toObject(UserDetails.class); + Assertions.assertEquals("cynpwlbjnp", model.firstName()); + Assertions.assertEquals("cftadeh", model.lastName()); + Assertions.assertEquals("ltyfsop", model.emailAddress()); + Assertions.assertEquals("suesnzw", model.upn()); + Assertions.assertEquals("jbavorxzdm", model.phoneNumber()); + Assertions.assertEquals("ctbqvudwx", model.alternateEmail()); + Assertions.assertEquals("dnvowg", model.address()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceDetailInnerTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceDetailInnerTests.java new file mode 100644 index 0000000000000..8686decfff7d3 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceDetailInnerTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceDetailInner; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLifecycleStatus; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceMarketplaceStatus; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProjectStatus; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceDetailInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceDetailInner model = BinaryData.fromString( + "{\"id\":\"xtrthz\",\"azureResourceId\":\"aytdwkqbrq\",\"organizationId\":\"bpaxhexiilivpdt\",\"partnerProperties\":{\"name\":\"irqtdqoa\",\"ownerEmail\":\"oruzfgsquyfxrxx\",\"retentionDays\":1104175771,\"default\":false,\"marketplaceDetails\":[{\"resourceId\":\"ramxjezwlwnw\",\"mpId\":\"uqlcvydy\",\"planId\":\"atdooaojkniod\",\"planName\":\"oebwnujhemms\",\"offerId\":\"vdkcrodtj\",\"publisherId\":\"fw\",\"termId\":\"fltkacjv\",\"status\":\"Subscribed\"},{\"resourceId\":\"dlfoakggkfp\",\"mpId\":\"gaowpulpqblylsyx\",\"planId\":\"qjnsjervtia\",\"planName\":\"sdszue\",\"offerId\":\"psbzkfzbeyvpn\",\"publisherId\":\"cvinvkjjxdxrbuuk\",\"termId\":\"lewyhmlwpaz\",\"status\":\"Subscribed\"}]},\"status\":\"archived\",\"projects\":[{\"id\":\"ncckw\",\"name\":\"fz\",\"description\":\"hxx\",\"createdBy\":\"uyqaxzfeqztppr\",\"status\":\"active\",\"agentCount\":1872827948,\"createdAt\":\"2021-11-23T15:22:41Z\",\"updatedAt\":\"2021-08-24T02:19:47Z\"}],\"createdAt\":\"2020-12-22T04:16:08Z\",\"updatedAt\":\"2021-08-29T23:56:41Z\"}") + .toObject(WorkspaceDetailInner.class); + Assertions.assertEquals("xtrthz", model.id()); + Assertions.assertEquals("aytdwkqbrq", model.azureResourceId()); + Assertions.assertEquals("bpaxhexiilivpdt", model.organizationId()); + Assertions.assertEquals("irqtdqoa", model.partnerProperties().name()); + Assertions.assertEquals("oruzfgsquyfxrxx", model.partnerProperties().ownerEmail()); + Assertions.assertEquals(1104175771, model.partnerProperties().retentionDays()); + Assertions.assertFalse(model.partnerProperties().defaultProperty()); + Assertions.assertEquals("ramxjezwlwnw", model.partnerProperties().marketplaceDetails().get(0).resourceId()); + Assertions.assertEquals("uqlcvydy", model.partnerProperties().marketplaceDetails().get(0).mpId()); + Assertions.assertEquals("atdooaojkniod", model.partnerProperties().marketplaceDetails().get(0).planId()); + Assertions.assertEquals("oebwnujhemms", model.partnerProperties().marketplaceDetails().get(0).planName()); + Assertions.assertEquals("vdkcrodtj", model.partnerProperties().marketplaceDetails().get(0).offerId()); + Assertions.assertEquals("fw", model.partnerProperties().marketplaceDetails().get(0).publisherId()); + Assertions.assertEquals("fltkacjv", model.partnerProperties().marketplaceDetails().get(0).termId()); + Assertions.assertEquals(WorkspaceMarketplaceStatus.SUBSCRIBED, + model.partnerProperties().marketplaceDetails().get(0).status()); + Assertions.assertEquals(WorkspaceLifecycleStatus.ARCHIVED, model.status()); + Assertions.assertEquals("ncckw", model.projects().get(0).id()); + Assertions.assertEquals("fz", model.projects().get(0).name()); + Assertions.assertEquals("hxx", model.projects().get(0).description()); + Assertions.assertEquals("uyqaxzfeqztppr", model.projects().get(0).createdBy()); + Assertions.assertEquals(WorkspaceProjectStatus.ACTIVE, model.projects().get(0).status()); + Assertions.assertEquals(1872827948, model.projects().get(0).agentCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-23T15:22:41Z"), model.projects().get(0).createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-24T02:19:47Z"), model.projects().get(0).updatedAt()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-22T04:16:08Z"), model.createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-29T23:56:41Z"), model.updatedAt()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceDetailPartnerPropertiesTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceDetailPartnerPropertiesTests.java new file mode 100644 index 0000000000000..63f39353a8235 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceDetailPartnerPropertiesTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceDetailPartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceMarketplaceStatus; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceDetailPartnerPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceDetailPartnerProperties model = BinaryData.fromString( + "{\"name\":\"altol\",\"ownerEmail\":\"ncwsob\",\"retentionDays\":1476249173,\"default\":true,\"marketplaceDetails\":[{\"resourceId\":\"dbnw\",\"mpId\":\"cf\",\"planId\":\"ucqdpfuvglsb\",\"planName\":\"ca\",\"offerId\":\"vxb\",\"publisherId\":\"vudutncor\",\"termId\":\"lxqtvcofudfl\",\"status\":\"PendingFulfillmentStart\"},{\"resourceId\":\"jub\",\"mpId\":\"dknnqvsazn\",\"planId\":\"n\",\"planName\":\"rudsg\",\"offerId\":\"a\",\"publisherId\":\"kycgrauwj\",\"termId\":\"taeburuvdm\",\"status\":\"PendingFulfillmentStart\"},{\"resourceId\":\"mz\",\"mpId\":\"xwabmqoe\",\"planId\":\"kif\",\"planName\":\"tpuqujmq\",\"offerId\":\"gkfbtndoaong\",\"publisherId\":\"cn\",\"termId\":\"jitcjedftwwaez\",\"status\":\"Unsubscribed\"},{\"resourceId\":\"v\",\"mpId\":\"c\",\"planId\":\"zfoqouicybxar\",\"planName\":\"szufoxciqopidoa\",\"offerId\":\"ciodhkhaz\",\"publisherId\":\"hnzbonl\",\"termId\":\"toego\",\"status\":\"PendingFulfillmentStart\"}]}") + .toObject(WorkspaceDetailPartnerProperties.class); + Assertions.assertEquals("altol", model.name()); + Assertions.assertEquals("ncwsob", model.ownerEmail()); + Assertions.assertEquals(1476249173, model.retentionDays()); + Assertions.assertTrue(model.defaultProperty()); + Assertions.assertEquals("dbnw", model.marketplaceDetails().get(0).resourceId()); + Assertions.assertEquals("cf", model.marketplaceDetails().get(0).mpId()); + Assertions.assertEquals("ucqdpfuvglsb", model.marketplaceDetails().get(0).planId()); + Assertions.assertEquals("ca", model.marketplaceDetails().get(0).planName()); + Assertions.assertEquals("vxb", model.marketplaceDetails().get(0).offerId()); + Assertions.assertEquals("vudutncor", model.marketplaceDetails().get(0).publisherId()); + Assertions.assertEquals("lxqtvcofudfl", model.marketplaceDetails().get(0).termId()); + Assertions.assertEquals(WorkspaceMarketplaceStatus.PENDING_FULFILLMENT_START, + model.marketplaceDetails().get(0).status()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceLinkedSaaSItemTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceLinkedSaaSItemTests.java new file mode 100644 index 0000000000000..d21438623e3b6 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceLinkedSaaSItemTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLinkedSaaSItem; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceLinkedSaaSItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceLinkedSaaSItem model + = BinaryData.fromString("{\"saaSResourceId\":\"syyceuzsoibjud\",\"isHiddenSaaS\":false}") + .toObject(WorkspaceLinkedSaaSItem.class); + Assertions.assertEquals("syyceuzsoibjud", model.saaSResourceId()); + Assertions.assertFalse(model.isHiddenSaaS()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceLinkedSaaSListResponseInnerTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceLinkedSaaSListResponseInnerTests.java new file mode 100644 index 0000000000000..c5096004e2948 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceLinkedSaaSListResponseInnerTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceLinkedSaaSListResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceLinkedSaaSListResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceLinkedSaaSListResponseInner model = BinaryData.fromString( + "{\"value\":[{\"saaSResourceId\":\"yffimrzrtuzqogs\",\"isHiddenSaaS\":false},{\"saaSResourceId\":\"evfdnwnwm\",\"isHiddenSaaS\":true}]}") + .toObject(WorkspaceLinkedSaaSListResponseInner.class); + Assertions.assertEquals("yffimrzrtuzqogs", model.value().get(0).saaSResourceId()); + Assertions.assertFalse(model.value().get(0).isHiddenSaaS()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceMarketplaceDetailsTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceMarketplaceDetailsTests.java new file mode 100644 index 0000000000000..d70e4aebecfa7 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceMarketplaceDetailsTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceMarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceMarketplaceStatus; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceMarketplaceDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceMarketplaceDetails model = BinaryData.fromString( + "{\"resourceId\":\"bwh\",\"mpId\":\"szzcmrvexztv\",\"planId\":\"t\",\"planName\":\"sfraoyzko\",\"offerId\":\"wtl\",\"publisherId\":\"guxawqaldsyuuxi\",\"termId\":\"rqf\",\"status\":\"Suspended\"}") + .toObject(WorkspaceMarketplaceDetails.class); + Assertions.assertEquals("bwh", model.resourceId()); + Assertions.assertEquals("szzcmrvexztv", model.mpId()); + Assertions.assertEquals("t", model.planId()); + Assertions.assertEquals("sfraoyzko", model.planName()); + Assertions.assertEquals("wtl", model.offerId()); + Assertions.assertEquals("guxawqaldsyuuxi", model.publisherId()); + Assertions.assertEquals("rqf", model.termId()); + Assertions.assertEquals(WorkspaceMarketplaceStatus.SUSPENDED, model.status()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacePartnerPropertiesTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacePartnerPropertiesTests.java new file mode 100644 index 0000000000000..c618a60a0e106 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacePartnerPropertiesTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.WorkspacePartnerProperties; +import org.junit.jupiter.api.Assertions; + +public final class WorkspacePartnerPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspacePartnerProperties model = BinaryData + .fromString("{\"name\":\"dvwvgpio\",\"ownerEmail\":\"wxrt\",\"partnerResourceId\":\"dxepxgyq\"}") + .toObject(WorkspacePartnerProperties.class); + Assertions.assertEquals("dvwvgpio", model.name()); + Assertions.assertEquals("wxrt", model.ownerEmail()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspacePartnerProperties model = new WorkspacePartnerProperties().withName("dvwvgpio").withOwnerEmail("wxrt"); + model = BinaryData.fromObject(model).toObject(WorkspacePartnerProperties.class); + Assertions.assertEquals("dvwvgpio", model.name()); + Assertions.assertEquals("wxrt", model.ownerEmail()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceProjectTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceProjectTests.java new file mode 100644 index 0000000000000..73ffde10ebcb5 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceProjectTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProject; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProjectStatus; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceProjectTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceProject model = BinaryData.fromString( + "{\"id\":\"yznkby\",\"name\":\"utwpfhp\",\"description\":\"m\",\"createdBy\":\"r\",\"status\":\"archived\",\"agentCount\":1595958724,\"createdAt\":\"2021-12-03T14:40:57Z\",\"updatedAt\":\"2021-01-13T07:02:52Z\"}") + .toObject(WorkspaceProject.class); + Assertions.assertEquals("yznkby", model.id()); + Assertions.assertEquals("utwpfhp", model.name()); + Assertions.assertEquals("m", model.description()); + Assertions.assertEquals("r", model.createdBy()); + Assertions.assertEquals(WorkspaceProjectStatus.ARCHIVED, model.status()); + Assertions.assertEquals(1595958724, model.agentCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T14:40:57Z"), model.createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-13T07:02:52Z"), model.updatedAt()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacePropertiesTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacePropertiesTests.java new file mode 100644 index 0000000000000..fda7ec47f0e65 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacePropertiesTests.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspacePartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class WorkspacePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceProperties model = BinaryData.fromString( + "{\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"subscriptionId\":\"reqnovvqfov\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"wsuwsyr\",\"offerDetails\":{\"publisherId\":\"ndsytgadg\",\"offerId\":\"r\",\"planId\":\"aeneqnzarrwl\",\"planName\":\"uijfqk\",\"termUnit\":\"e\",\"termId\":\"ipfpubji\"}},{\"subscriptionId\":\"wifto\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"puvks\",\"offerDetails\":{\"publisherId\":\"plsaknynfsynljph\",\"offerId\":\"op\",\"planId\":\"dlqiyntorzih\",\"planName\":\"osjswsr\",\"termUnit\":\"lyzrpzbchckqqzqi\",\"termId\":\"iysui\"}},{\"subscriptionId\":\"ynkedyatrwyhqmib\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"itsmypyyn\",\"offerDetails\":{\"publisherId\":\"cdpu\",\"offerId\":\"nzgmwznmabik\",\"planId\":\"orgjhxbldt\",\"planName\":\"wrlkdmtn\",\"termUnit\":\"ok\",\"termId\":\"llxdyhgs\"}},{\"subscriptionId\":\"cogjltdtbn\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"oocrkvcikhnv\",\"offerDetails\":{\"publisherId\":\"amqgxqquezikyw\",\"offerId\":\"gxk\",\"planId\":\"la\",\"planName\":\"elwuipi\",\"termUnit\":\"jzkzi\",\"termId\":\"vvcnayr\"}}],\"partnerProperties\":{\"name\":\"yrnxxmueedn\",\"ownerEmail\":\"dvstkw\",\"partnerResourceId\":\"tchealmf\"},\"isDefault\":false,\"status\":\"archived\",\"provisioningState\":\"Succeeded\"}") + .toObject(WorkspaceProperties.class); + Assertions.assertEquals(Product.AIFORSERVICE, model.product()); + Assertions.assertEquals("reqnovvqfov", model.marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("wsuwsyr", model.marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("ndsytgadg", model.marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("r", model.marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("aeneqnzarrwl", model.marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("uijfqk", model.marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("e", model.marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("ipfpubji", model.marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertEquals("yrnxxmueedn", model.partnerProperties().name()); + Assertions.assertEquals("dvstkw", model.partnerProperties().ownerEmail()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceProperties model = new WorkspaceProperties().withProduct(Product.AIFORSERVICE) + .withMarketplaceDetails(Arrays.asList( + new MarketplaceDetails().withSubscriptionId("reqnovvqfov") + .withSaasResourceId("wsuwsyr") + .withOfferDetails(new OfferDetails().withPublisherId("ndsytgadg") + .withOfferId("r") + .withPlanId("aeneqnzarrwl") + .withPlanName("uijfqk") + .withTermUnit("e") + .withTermId("ipfpubji")), + new MarketplaceDetails().withSubscriptionId("wifto") + .withSaasResourceId("puvks") + .withOfferDetails(new OfferDetails().withPublisherId("plsaknynfsynljph") + .withOfferId("op") + .withPlanId("dlqiyntorzih") + .withPlanName("osjswsr") + .withTermUnit("lyzrpzbchckqqzqi") + .withTermId("iysui")), + new MarketplaceDetails().withSubscriptionId("ynkedyatrwyhqmib") + .withSaasResourceId("itsmypyyn") + .withOfferDetails(new OfferDetails().withPublisherId("cdpu") + .withOfferId("nzgmwznmabik") + .withPlanId("orgjhxbldt") + .withPlanName("wrlkdmtn") + .withTermUnit("ok") + .withTermId("llxdyhgs")), + new MarketplaceDetails().withSubscriptionId("cogjltdtbn") + .withSaasResourceId("oocrkvcikhnv") + .withOfferDetails(new OfferDetails().withPublisherId("amqgxqquezikyw") + .withOfferId("gxk") + .withPlanId("la") + .withPlanName("elwuipi") + .withTermUnit("jzkzi") + .withTermId("vvcnayr")))) + .withPartnerProperties(new WorkspacePartnerProperties().withName("yrnxxmueedn").withOwnerEmail("dvstkw")); + model = BinaryData.fromObject(model).toObject(WorkspaceProperties.class); + Assertions.assertEquals(Product.AIFORSERVICE, model.product()); + Assertions.assertEquals("reqnovvqfov", model.marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("wsuwsyr", model.marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("ndsytgadg", model.marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("r", model.marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("aeneqnzarrwl", model.marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("uijfqk", model.marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("e", model.marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("ipfpubji", model.marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertEquals("yrnxxmueedn", model.partnerProperties().name()); + Assertions.assertEquals("dvstkw", model.partnerProperties().ownerEmail()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceResourceInnerTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceResourceInnerTests.java new file mode 100644 index 0000000000000..addaade9723bc --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceResourceInnerTests.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.fluent.models.WorkspaceResourceInner; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspacePartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceResourceInner model = BinaryData.fromString( + "{\"properties\":{\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"subscriptionId\":\"tmnubexkpzksmon\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"uxvypomgkopkwh\",\"offerDetails\":{\"publisherId\":\"jvp\",\"offerId\":\"jqg\",\"planId\":\"smocmbq\",\"planName\":\"vmkcx\",\"termUnit\":\"apvhelxprgly\",\"termId\":\"dd\"}},{\"subscriptionId\":\"cbcuejrjxgciqi\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"sxsdqrhzoymibm\",\"offerDetails\":{\"publisherId\":\"qyib\",\"offerId\":\"hwflu\",\"planId\":\"dtmhrkwofyyvoqa\",\"planName\":\"iexpbtgiwbwo\",\"termUnit\":\"washr\",\"termId\":\"tkcnqxwb\"}}],\"partnerProperties\":{\"name\":\"okulpiujwa\",\"ownerEmail\":\"ipqiiobyuqerpq\",\"partnerResourceId\":\"qwcciuqg\"},\"isDefault\":false,\"status\":\"suspended\",\"provisioningState\":\"Succeeded\"},\"id\":\"fbtkuwhhmhyk\",\"name\":\"joxafnndlpi\",\"type\":\"hkoymkcdyhbp\"}") + .toObject(WorkspaceResourceInner.class); + Assertions.assertEquals(Product.AIFORSERVICE, model.properties().product()); + Assertions.assertEquals("tmnubexkpzksmon", model.properties().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("uxvypomgkopkwh", model.properties().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("jvp", model.properties().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("jqg", model.properties().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("smocmbq", model.properties().marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("vmkcx", model.properties().marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("apvhelxprgly", + model.properties().marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("dd", model.properties().marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertEquals("okulpiujwa", model.properties().partnerProperties().name()); + Assertions.assertEquals("ipqiiobyuqerpq", model.properties().partnerProperties().ownerEmail()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceResourceInner model + = new WorkspaceResourceInner().withProperties(new WorkspaceProperties().withProduct(Product.AIFORSERVICE) + .withMarketplaceDetails(Arrays.asList( + new MarketplaceDetails().withSubscriptionId("tmnubexkpzksmon") + .withSaasResourceId("uxvypomgkopkwh") + .withOfferDetails(new OfferDetails().withPublisherId("jvp") + .withOfferId("jqg") + .withPlanId("smocmbq") + .withPlanName("vmkcx") + .withTermUnit("apvhelxprgly") + .withTermId("dd")), + new MarketplaceDetails().withSubscriptionId("cbcuejrjxgciqi") + .withSaasResourceId("sxsdqrhzoymibm") + .withOfferDetails(new OfferDetails().withPublisherId("qyib") + .withOfferId("hwflu") + .withPlanId("dtmhrkwofyyvoqa") + .withPlanName("iexpbtgiwbwo") + .withTermUnit("washr") + .withTermId("tkcnqxwb")))) + .withPartnerProperties( + new WorkspacePartnerProperties().withName("okulpiujwa").withOwnerEmail("ipqiiobyuqerpq"))); + model = BinaryData.fromObject(model).toObject(WorkspaceResourceInner.class); + Assertions.assertEquals(Product.AIFORSERVICE, model.properties().product()); + Assertions.assertEquals("tmnubexkpzksmon", model.properties().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("uxvypomgkopkwh", model.properties().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("jvp", model.properties().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("jqg", model.properties().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("smocmbq", model.properties().marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("vmkcx", model.properties().marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("apvhelxprgly", + model.properties().marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("dd", model.properties().marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertEquals("okulpiujwa", model.properties().partnerProperties().name()); + Assertions.assertEquals("ipqiiobyuqerpq", model.properties().partnerProperties().ownerEmail()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceResourceListResultTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceResourceListResultTests.java new file mode 100644 index 0000000000000..43ca4787d798e --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceResourceListResultTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.implementation.models.WorkspaceResourceListResult; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"subscriptionId\":\"pkukghi\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"xgwim\",\"offerDetails\":{\"publisherId\":\"njhf\",\"offerId\":\"xw\"}},{\"subscriptionId\":\"zk\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"rey\",\"offerDetails\":{\"publisherId\":\"kzikfjawneaivxwc\",\"offerId\":\"elpcirelsfeaenwa\"}},{\"subscriptionId\":\"atklddxbjhwuaa\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"osphyoul\",\"offerDetails\":{\"publisherId\":\"jrvxaglrv\",\"offerId\":\"mjwosytx\"}},{\"subscriptionId\":\"cskfcktqumiekk\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"khly\",\"offerDetails\":{\"publisherId\":\"jhdgqggebdunyga\",\"offerId\":\"qidbqfatpxllrxcy\"}}],\"partnerProperties\":{\"name\":\"moadsuvarmy\",\"ownerEmail\":\"mjsjqb\",\"partnerResourceId\":\"hyxxrwlycoduhpk\"},\"isDefault\":false,\"status\":\"active\",\"provisioningState\":\"Failed\"},\"id\":\"qnajxqugj\",\"name\":\"ky\",\"type\":\"ubeddg\"}],\"nextLink\":\"ofwq\"}") + .toObject(WorkspaceResourceListResult.class); + Assertions.assertEquals(Product.AIFORSERVICE, model.value().get(0).properties().product()); + Assertions.assertEquals("pkukghi", + model.value().get(0).properties().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("xgwim", + model.value().get(0).properties().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("njhf", + model.value().get(0).properties().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("xw", + model.value().get(0).properties().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("moadsuvarmy", model.value().get(0).properties().partnerProperties().name()); + Assertions.assertEquals("mjsjqb", model.value().get(0).properties().partnerProperties().ownerEmail()); + Assertions.assertEquals("ofwq", model.nextLink()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceSaaSDataTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceSaaSDataTests.java new file mode 100644 index 0000000000000..230bc925ec0cd --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspaceSaaSDataTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceSaaSData; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceSaaSDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceSaaSData model + = BinaryData.fromString("{\"saaSResourceIds\":[\"qal\",\"rmnjijpx\",\"cqqudf\",\"byxbaaabjy\"]}") + .toObject(WorkspaceSaaSData.class); + Assertions.assertEquals("qal", model.saaSResourceIds().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceSaaSData model + = new WorkspaceSaaSData().withSaaSResourceIds(Arrays.asList("qal", "rmnjijpx", "cqqudf", "byxbaaabjy")); + model = BinaryData.fromObject(model).toObject(WorkspaceSaaSData.class); + Assertions.assertEquals("qal", model.saaSResourceIds().get(0)); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesCreateOrUpdateMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesCreateOrUpdateMockTests.java new file mode 100644 index 0000000000000..01b2fa40c92d7 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesCreateOrUpdateMockTests.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.MarketplaceDetails; +import com.azure.resourcemanager.koreaiartemis.models.OfferDetails; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspacePartnerProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProperties; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspacesCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"product\":\"aiforservice\",\"marketplaceDetails\":[{\"subscriptionId\":\"b\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"kjlmx\",\"offerDetails\":{\"publisherId\":\"omdynhdwdigum\",\"offerId\":\"nraauzz\",\"planId\":\"jazysdzhezwwvaiq\",\"planName\":\"vv\",\"termUnit\":\"nk\",\"termId\":\"hqyikvy\"}}],\"partnerProperties\":{\"name\":\"auy\",\"ownerEmail\":\"luwmncst\",\"partnerResourceId\":\"jfybvpoekrsgsgb\"},\"isDefault\":true,\"status\":\"active\",\"provisioningState\":\"Succeeded\"},\"id\":\"dgkynscliqhzvhxn\",\"name\":\"omtkub\",\"type\":\"tppn\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceResource response = manager.workspaces() + .define("podbzevwrdnh") + .withExistingOrganization("tfpmvmemfnczdw", "vbalxlllc") + .withProperties(new WorkspaceProperties().withProduct(Product.AIFORWORK) + .withMarketplaceDetails(Arrays.asList( + new MarketplaceDetails().withSubscriptionId("jcswsmys") + .withSaasResourceId("qypfcv") + .withOfferDetails(new OfferDetails().withPublisherId("er") + .withOfferId("hp") + .withPlanId("mfpjbabw") + .withPlanName("fcxsspuunnoxy") + .withTermUnit("xgqddrih") + .withTermId("hoqca")), + new MarketplaceDetails().withSubscriptionId("wdaomdjvlpjxxkzb") + .withSaasResourceId("eivsiykzkdnc") + .withOfferDetails(new OfferDetails().withPublisherId("dxonbzoggculap") + .withOfferId("wyrpgogtqxepnyl") + .withPlanId("uajlyj") + .withPlanName("vofqzhvfc") + .withTermUnit("yfm") + .withTermId("uxrkjp")), + new MarketplaceDetails().withSubscriptionId("w") + .withSaasResourceId("iivwzjbhyzsxjrka") + .withOfferDetails(new OfferDetails().withPublisherId("btrnegvm") + .withOfferId("vuqeqvldspast") + .withPlanId("kkdmfl") + .withPlanName("stmjlxrri") + .withTermUnit("zapeewchpx") + .withTermId("twkuziycs")), + new MarketplaceDetails().withSubscriptionId("vu") + .withSaasResourceId("cktyh") + .withOfferDetails(new OfferDetails().withPublisherId("tqedcgzulwm") + .withOfferId("rqzz") + .withPlanId("jvpglydzgk") + .withPlanName("qeevt") + .withTermUnit("pryu") + .withTermId("wytpzdmovz")))) + .withPartnerProperties(new WorkspacePartnerProperties().withName("fvaawzqa").withOwnerEmail("lgzurig"))) + .create(); + + Assertions.assertEquals(Product.AIFORSERVICE, response.properties().product()); + Assertions.assertEquals("b", response.properties().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("kjlmx", response.properties().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("omdynhdwdigum", + response.properties().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("nraauzz", response.properties().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("jazysdzhezwwvaiq", + response.properties().marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("vv", response.properties().marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("nk", response.properties().marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("hqyikvy", response.properties().marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertEquals("auy", response.properties().partnerProperties().name()); + Assertions.assertEquals("luwmncst", response.properties().partnerProperties().ownerEmail()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetDetailsWithResponseMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetDetailsWithResponseMockTests.java new file mode 100644 index 0000000000000..db0ac8bb88547 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetDetailsWithResponseMockTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceDetail; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLifecycleStatus; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceMarketplaceStatus; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceProjectStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspacesGetDetailsWithResponseMockTests { + @Test + public void testGetDetailsWithResponse() throws Exception { + String responseStr + = "{\"id\":\"xkcgxxlxsffgcvi\",\"azureResourceId\":\"qzdwlvwlyoup\",\"organizationId\":\"gfbkjubdyh\",\"partnerProperties\":{\"name\":\"kfm\",\"ownerEmail\":\"nsgowzfttst\",\"retentionDays\":2104180974,\"default\":false,\"marketplaceDetails\":[{\"resourceId\":\"ahbqactxtgzuk\",\"mpId\":\"itmmqtgqqqxh\",\"planId\":\"n\",\"planName\":\"xcpjuisavokqdzf\",\"offerId\":\"azivjlfrqttbajl\",\"publisherId\":\"tnwxy\",\"termId\":\"pidkqqfkuvscxkdm\",\"status\":\"Unsubscribed\"}]},\"status\":\"archived\",\"projects\":[{\"id\":\"ibrxkp\",\"name\":\"loazuruocbgoo\",\"description\":\"te\",\"createdBy\":\"ybfhjxa\",\"status\":\"in-development\",\"agentCount\":1317019798,\"createdAt\":\"2021-06-04T07:26:43Z\",\"updatedAt\":\"2021-04-29T04:08:31Z\"},{\"id\":\"slordilmyww\",\"name\":\"kgkxn\",\"description\":\"dabg\",\"createdBy\":\"vudtjuewbcihx\",\"status\":\"deployed\",\"agentCount\":1985861684,\"createdAt\":\"2021-05-31T05:47:10Z\",\"updatedAt\":\"2021-04-15T08:04:43Z\"},{\"id\":\"j\",\"name\":\"xccybvpa\",\"description\":\"kkudzp\",\"createdBy\":\"gwjplmag\",\"status\":\"deployed\",\"agentCount\":1164278403,\"createdAt\":\"2021-12-10T03:49:04Z\",\"updatedAt\":\"2021-10-11T17:48:26Z\"},{\"id\":\"hpfkyrkdbdgi\",\"name\":\"gsj\",\"description\":\"nwqjnoba\",\"createdBy\":\"yhddvia\",\"status\":\"archived\",\"agentCount\":1955095413,\"createdAt\":\"2021-08-12T15:52:34Z\",\"updatedAt\":\"2021-09-06T17:32:09Z\"}],\"createdAt\":\"2021-04-14T23:17:33Z\",\"updatedAt\":\"2021-05-03T12:24:52Z\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceDetail response = manager.workspaces() + .getDetailsWithResponse("sks", "pi", "lqol", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("xkcgxxlxsffgcvi", response.id()); + Assertions.assertEquals("qzdwlvwlyoup", response.azureResourceId()); + Assertions.assertEquals("gfbkjubdyh", response.organizationId()); + Assertions.assertEquals("kfm", response.partnerProperties().name()); + Assertions.assertEquals("nsgowzfttst", response.partnerProperties().ownerEmail()); + Assertions.assertEquals(2104180974, response.partnerProperties().retentionDays()); + Assertions.assertFalse(response.partnerProperties().defaultProperty()); + Assertions.assertEquals("ahbqactxtgzuk", response.partnerProperties().marketplaceDetails().get(0).resourceId()); + Assertions.assertEquals("itmmqtgqqqxh", response.partnerProperties().marketplaceDetails().get(0).mpId()); + Assertions.assertEquals("n", response.partnerProperties().marketplaceDetails().get(0).planId()); + Assertions.assertEquals("xcpjuisavokqdzf", response.partnerProperties().marketplaceDetails().get(0).planName()); + Assertions.assertEquals("azivjlfrqttbajl", response.partnerProperties().marketplaceDetails().get(0).offerId()); + Assertions.assertEquals("tnwxy", response.partnerProperties().marketplaceDetails().get(0).publisherId()); + Assertions.assertEquals("pidkqqfkuvscxkdm", response.partnerProperties().marketplaceDetails().get(0).termId()); + Assertions.assertEquals(WorkspaceMarketplaceStatus.UNSUBSCRIBED, + response.partnerProperties().marketplaceDetails().get(0).status()); + Assertions.assertEquals(WorkspaceLifecycleStatus.ARCHIVED, response.status()); + Assertions.assertEquals("ibrxkp", response.projects().get(0).id()); + Assertions.assertEquals("loazuruocbgoo", response.projects().get(0).name()); + Assertions.assertEquals("te", response.projects().get(0).description()); + Assertions.assertEquals("ybfhjxa", response.projects().get(0).createdBy()); + Assertions.assertEquals(WorkspaceProjectStatus.IN_DEVELOPMENT, response.projects().get(0).status()); + Assertions.assertEquals(1317019798, response.projects().get(0).agentCount()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-04T07:26:43Z"), response.projects().get(0).createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-29T04:08:31Z"), response.projects().get(0).updatedAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-14T23:17:33Z"), response.createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-03T12:24:52Z"), response.updatedAt()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetWithResponseMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetWithResponseMockTests.java new file mode 100644 index 0000000000000..a3504d0ec98d7 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesGetWithResponseMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspacesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"okkqfqjbvleo\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"uiqtqzfavy\",\"offerDetails\":{\"publisherId\":\"nqqyba\",\"offerId\":\"yeua\",\"planId\":\"kq\",\"planName\":\"qgzsles\",\"termUnit\":\"bhernntiew\",\"termId\":\"cv\"}},{\"subscriptionId\":\"uwrbehwagoh\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"kmr\",\"offerDetails\":{\"publisherId\":\"emvvhm\",\"offerId\":\"tdrjfutacoebj\",\"planId\":\"wzcjznmwcpmgua\",\"planName\":\"raufactkahzova\",\"termUnit\":\"ziuxxpshnee\",\"termId\":\"lfg\"}}],\"partnerProperties\":{\"name\":\"lqubkwdlen\",\"ownerEmail\":\"sutujba\",\"partnerResourceId\":\"juohminyflnorw\"},\"isDefault\":true,\"status\":\"archived\",\"provisioningState\":\"Failed\"},\"id\":\"vxwmygd\",\"name\":\"pgpqchiszepnnb\",\"type\":\"crxgibb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceResource response = manager.workspaces() + .getWithResponse("qjfsmlmbtxhw", "fwsrtawcoezbrhu", "skh", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(Product.AIFORWORK, response.properties().product()); + Assertions.assertEquals("okkqfqjbvleo", response.properties().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("uiqtqzfavy", response.properties().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("nqqyba", + response.properties().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("yeua", response.properties().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("kq", response.properties().marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("qgzsles", response.properties().marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("bhernntiew", + response.properties().marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("cv", response.properties().marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertEquals("lqubkwdlen", response.properties().partnerProperties().name()); + Assertions.assertEquals("sutujba", response.properties().partnerProperties().ownerEmail()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListByOrganizationMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListByOrganizationMockTests.java new file mode 100644 index 0000000000000..0ada97d76d61c --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListByOrganizationMockTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.Product; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspacesListByOrganizationMockTests { + @Test + public void testListByOrganization() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"product\":\"aiforwork\",\"marketplaceDetails\":[{\"subscriptionId\":\"zlrphwzs\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"eyuqdunvmnnrwr\",\"offerDetails\":{\"publisherId\":\"i\",\"offerId\":\"rk\",\"planId\":\"lywjhh\",\"planName\":\"nhxmsi\",\"termUnit\":\"omi\",\"termId\":\"xggdufi\"}}],\"partnerProperties\":{\"name\":\"ndieuzaofj\",\"ownerEmail\":\"vcyy\",\"partnerResourceId\":\"fgdo\"},\"isDefault\":true,\"status\":\"archived\",\"provisioningState\":\"Failed\"},\"id\":\"ipwoqonmacjek\",\"name\":\"izsh\",\"type\":\"vcimpev\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.workspaces().listByOrganization("axconfozauo", "sukokwbqplhl", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(Product.AIFORWORK, response.iterator().next().properties().product()); + Assertions.assertEquals("zlrphwzs", + response.iterator().next().properties().marketplaceDetails().get(0).subscriptionId()); + Assertions.assertEquals("eyuqdunvmnnrwr", + response.iterator().next().properties().marketplaceDetails().get(0).saasResourceId()); + Assertions.assertEquals("i", + response.iterator().next().properties().marketplaceDetails().get(0).offerDetails().publisherId()); + Assertions.assertEquals("rk", + response.iterator().next().properties().marketplaceDetails().get(0).offerDetails().offerId()); + Assertions.assertEquals("lywjhh", + response.iterator().next().properties().marketplaceDetails().get(0).offerDetails().planId()); + Assertions.assertEquals("nhxmsi", + response.iterator().next().properties().marketplaceDetails().get(0).offerDetails().planName()); + Assertions.assertEquals("omi", + response.iterator().next().properties().marketplaceDetails().get(0).offerDetails().termUnit()); + Assertions.assertEquals("xggdufi", + response.iterator().next().properties().marketplaceDetails().get(0).offerDetails().termId()); + Assertions.assertEquals("ndieuzaofj", response.iterator().next().properties().partnerProperties().name()); + Assertions.assertEquals("vcyy", response.iterator().next().properties().partnerProperties().ownerEmail()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListLinkedSaaSWithResponseMockTests.java b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListLinkedSaaSWithResponseMockTests.java new file mode 100644 index 0000000000000..8422c4c5bbe23 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/src/test/java/com/azure/resourcemanager/koreaiartemis/generated/WorkspacesListLinkedSaaSWithResponseMockTests.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.resourcemanager.koreaiartemis.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.koreaiartemis.KoreAIArtemisManager; +import com.azure.resourcemanager.koreaiartemis.models.WorkspaceLinkedSaaSListResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspacesListLinkedSaaSWithResponseMockTests { + @Test + public void testListLinkedSaaSWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"saaSResourceId\":\"dvoqyt\",\"isHiddenSaaS\":false},{\"saaSResourceId\":\"owbb\",\"isHiddenSaaS\":true},{\"saaSResourceId\":\"avu\",\"isHiddenSaaS\":true},{\"saaSResourceId\":\"hjoxo\",\"isHiddenSaaS\":false}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + KoreAIArtemisManager manager = KoreAIArtemisManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceLinkedSaaSListResponse response = manager.workspaces() + .listLinkedSaaSWithResponse("gmblrri", "bywdxsmicc", "rwfscjfnynszquj", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("dvoqyt", response.value().get(0).saaSResourceId()); + Assertions.assertFalse(response.value().get(0).isHiddenSaaS()); + } +} diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/tsp-location.yaml b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/tsp-location.yaml new file mode 100644 index 0000000000000..e9cab08ef7a46 --- /dev/null +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/azure-native-integrations/resource-manager/Kore.AgentPlatform/AgentPlatform +commit: 41f831e9ce23a30c9edad54fffe8d29c7b0a6987 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/koreaiartemis/ci.yml b/sdk/koreaiartemis/ci.yml new file mode 100644 index 0000000000000..b86d764c2b606 --- /dev/null +++ b/sdk/koreaiartemis/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/koreaiartemis/ci.yml + - sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/ + exclude: + - sdk/koreaiartemis/pom.xml + - sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/koreaiartemis/ci.yml + - sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/ + exclude: + - sdk/koreaiartemis/pom.xml + - sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml + +parameters: + - name: release_azureresourcemanagerkoreaiartemis + displayName: azure-resourcemanager-koreaiartemis + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: koreaiartemis + Artifacts: + - name: azure-resourcemanager-koreaiartemis + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerkoreaiartemis + releaseInBatch: ${{ parameters.release_azureresourcemanagerkoreaiartemis }} diff --git a/sdk/koreaiartemis/pom.xml b/sdk/koreaiartemis/pom.xml new file mode 100644 index 0000000000000..1bf4ad2b0992e --- /dev/null +++ b/sdk/koreaiartemis/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-koreaiartemis-service + pom + 1.0.0 + + + azure-resourcemanager-koreaiartemis + + From 8d69b87102078c9157a95eb324d051ae42436d2e Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 30 Oct 2026 08:53:49 +0800 Subject: [PATCH 2/2] Update POM dependency versions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 79b59c62-0be8-4220-b468-7869e3f906db --- .../azure-resourcemanager-koreaiartemis/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml index d550594eb594a..0b5a382148d43 100644 --- a/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml +++ b/sdk/koreaiartemis/azure-resourcemanager-koreaiartemis/pom.xml @@ -61,17 +61,17 @@ com.azure azure-core - 1.60.0 + 1.61.0 com.azure azure-core-management - 1.19.8 + 1.20.0 com.azure azure-core-test - 1.27.0-beta.19 + 1.27.0-beta.20 test