From aedcd1c01c270daabff7afd0f9a6bfb56220f871 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 11 Jun 2026 15:50:19 +0000 Subject: [PATCH 1/2] Configurations: 'specification/napster/Napster.CompanionAPI.Management/tspconfig.yaml', API Version: 2025-12-24-preview, SDK Release Type: beta, and CommitSHA: 'f11bc1f38131d74b95a0c51b44f779f466cba762' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6424085 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 | 8 + .../README.md | 102 ++ .../SAMPLE.md | 385 +++++ .../pom.xml | 74 + .../NapsterOmniagentApiManager.java | 313 ++++ .../NapsterOmniagentApiManagementClient.java | 69 + .../fluent/OperationsClient.java | 40 + .../fluent/OrganizationsClient.java | 366 +++++ .../fluent/SaaSOperationGroupsClient.java | 70 + .../models/LatestLinkedSaaSResponseInner.java | 92 ++ .../fluent/models/OperationInner.java | 150 ++ .../models/OrganizationResourceInner.java | 210 +++ .../SaaSResourceDetailsResponseInner.java | 144 ++ .../fluent/models/package-info.java | 8 + .../fluent/package-info.java | 8 + .../LatestLinkedSaaSResponseImpl.java | 36 + ...erOmniagentApiManagementClientBuilder.java | 138 ++ ...psterOmniagentApiManagementClientImpl.java | 340 ++++ .../implementation/OperationImpl.java | 51 + .../implementation/OperationsClientImpl.java | 242 +++ .../implementation/OperationsImpl.java | 45 + .../OrganizationResourceImpl.java | 214 +++ .../OrganizationsClientImpl.java | 1416 +++++++++++++++++ .../implementation/OrganizationsImpl.java | 184 +++ .../implementation/ResourceManagerUtils.java | 195 +++ .../SaaSOperationGroupsClientImpl.java | 233 +++ .../SaaSOperationGroupsImpl.java | 53 + .../SaaSResourceDetailsResponseImpl.java | 49 + .../models/OperationListResult.java | 96 ++ .../OrganizationResourceListResult.java | 97 ++ .../implementation/package-info.java | 8 + .../models/ActionType.java | 46 + .../models/ActivateSaaSParameterRequest.java | 114 ++ .../models/LatestLinkedSaaSResponse.java | 33 + .../models/ManagedServiceIdentity.java | 154 ++ .../models/ManagedServiceIdentityType.java | 62 + .../models/MarketplaceDetails.java | 159 ++ .../models/MarketplaceSubscriptionStatus.java | 61 + .../models/OfferDetails.java | 226 +++ .../napsteromniagentapi/models/Operation.java | 58 + .../models/OperationDisplay.java | 128 ++ .../models/Operations.java | 35 + .../models/OrganizationProperties.java | 188 +++ .../models/OrganizationResource.java | 330 ++++ .../models/OrganizationResourceUpdate.java | 115 ++ .../models/Organizations.java | 211 +++ .../napsteromniagentapi/models/Origin.java | 57 + .../models/PartnerProperties.java | 86 + .../models/ResourceProvisioningState.java | 56 + .../napsteromniagentapi/models/SaaSData.java | 85 + .../models/SaaSOperationGroups.java | 35 + .../models/SaaSResourceDetailsResponse.java | 56 + .../models/SingleSignOnPropertiesV2.java | 200 +++ .../models/SingleSignOnStates.java | 56 + .../models/SingleSignOnType.java | 51 + .../models/UserAssignedIdentity.java | 89 ++ .../models/UserDetails.java | 197 +++ .../models/package-info.java | 8 + .../napsteromniagentapi/package-info.java | 8 + .../src/main/java/module-info.java | 16 + ...emanager-napsteromniagentapi_metadata.json | 1 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...urcemanager-napsteromniagentapi.properties | 1 + .../generated/OperationsListSamples.java | 36 + .../OrganizationsCreateOrUpdateSamples.java | 77 + .../generated/OrganizationsDeleteSamples.java | 23 + ...rganizationsGetByResourceGroupSamples.java | 24 + .../OrganizationsLatestLinkedSaaSSamples.java | 24 + .../OrganizationsLinkSaaSSamples.java | 28 + ...ganizationsListByResourceGroupSamples.java | 36 + .../generated/OrganizationsListSamples.java | 36 + .../generated/OrganizationsUpdateSamples.java | 48 + ...OperationGroupActivateResourceSamples.java | 42 + .../ActivateSaaSParameterRequestTests.java | 29 + .../LatestLinkedSaaSResponseInnerTests.java | 20 + .../ManagedServiceIdentityTests.java | 44 + .../generated/MarketplaceDetailsTests.java | 48 + .../generated/OfferDetailsTests.java | 41 + .../generated/OperationDisplayTests.java | 17 + .../generated/OperationInnerTests.java | 17 + .../generated/OperationListResultTests.java | 19 + .../generated/OperationsListMockTests.java | 36 + .../OrganizationPropertiesTests.java | 89 ++ .../OrganizationResourceInnerTests.java | 118 ++ .../OrganizationResourceListResultTests.java | 49 + .../OrganizationResourceUpdateTests.java | 50 + .../OrganizationsCreateOrUpdateMockTests.java | 112 ++ ...tByResourceGroupWithResponseMockTests.java | 63 + ...LatestLinkedSaaSWithResponseMockTests.java | 39 + .../OrganizationsLinkSaaSMockTests.java | 63 + ...nizationsListByResourceGroupMockTests.java | 69 + .../generated/OrganizationsListMockTests.java | 70 + .../generated/PartnerPropertiesTests.java | 25 + .../generated/SaaSDataTests.java | 24 + ...rationGroupsActivateResourceMockTests.java | 40 + ...SaaSResourceDetailsResponseInnerTests.java | 20 + .../SingleSignOnPropertiesV2Tests.java | 41 + .../generated/UserAssignedIdentityTests.java | 22 + .../generated/UserDetailsTests.java | 38 + .../tsp-location.yaml | 4 + sdk/napsteromniagentapi/ci.yml | 46 + sdk/napsteromniagentapi/pom.xml | 15 + 105 files changed, 10004 insertions(+) create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/CHANGELOG.md create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/README.md create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/SAMPLE.md create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/NapsterOmniagentApiManager.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/NapsterOmniagentApiManagementClient.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/OperationsClient.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/OrganizationsClient.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/SaaSOperationGroupsClient.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/LatestLinkedSaaSResponseInner.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/OperationInner.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/OrganizationResourceInner.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/SaaSResourceDetailsResponseInner.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/package-info.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/package-info.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/LatestLinkedSaaSResponseImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientBuilder.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationsClientImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationsImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationResourceImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsClientImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/ResourceManagerUtils.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSOperationGroupsClientImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSOperationGroupsImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSResourceDetailsResponseImpl.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/models/OperationListResult.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/models/OrganizationResourceListResult.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/package-info.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ActionType.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ActivateSaaSParameterRequest.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/LatestLinkedSaaSResponse.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentity.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentityType.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/MarketplaceDetails.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/MarketplaceSubscriptionStatus.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OfferDetails.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Operation.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OperationDisplay.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Operations.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationProperties.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationResource.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationResourceUpdate.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Organizations.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Origin.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/PartnerProperties.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ResourceProvisioningState.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSData.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSOperationGroups.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSResourceDetailsResponse.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnPropertiesV2.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnStates.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnType.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserAssignedIdentity.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserDetails.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/package-info.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/package-info.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/module-info.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/azure-resourcemanager-napsteromniagentapi_metadata.json create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-napsteromniagentapi/proxy-config.json create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-napsteromniagentapi/reflect-config.json create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/azure-resourcemanager-napsteromniagentapi.properties create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationsListSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsCreateOrUpdateSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsDeleteSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsGetByResourceGroupSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLatestLinkedSaaSSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLinkSaaSSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListByResourceGroupSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsUpdateSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSOperationGroupActivateResourceSamples.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/ActivateSaaSParameterRequestTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/LatestLinkedSaaSResponseInnerTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/ManagedServiceIdentityTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/MarketplaceDetailsTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OfferDetailsTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationDisplayTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationInnerTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationListResultTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationsListMockTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationPropertiesTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceInnerTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceListResultTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceUpdateTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsCreateOrUpdateMockTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLatestLinkedSaaSWithResponseMockTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLinkSaaSMockTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListByResourceGroupMockTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListMockTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/PartnerPropertiesTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSDataTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSOperationGroupsActivateResourceMockTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSResourceDetailsResponseInnerTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SingleSignOnPropertiesV2Tests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/UserAssignedIdentityTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/UserDetailsTests.java create mode 100644 sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/tsp-location.yaml create mode 100644 sdk/napsteromniagentapi/ci.yml create mode 100644 sdk/napsteromniagentapi/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index a76c71300518..30078fbce228 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -531,6 +531,7 @@ com.azure.resourcemanager:azure-resourcemanager-relationships;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-fileshares;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-monitor-slis;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-monitor-workspaces;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-napsteromniagentapi;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 51a0cef029f1..57e31d3d215a 100644 --- a/pom.xml +++ b/pom.xml @@ -179,6 +179,7 @@ sdk/msi sdk/mysql sdk/mysqlflexibleserver + sdk/napsteromniagentapi sdk/neonpostgres sdk/netapp sdk/network diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/CHANGELOG.md b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/CHANGELOG.md new file mode 100644 index 000000000000..7946a3ba1dac --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2026-06-11) + +- Azure Resource Manager NapsterOmniagentApi client library for Java. This package contains Microsoft Azure SDK for NapsterOmniagentApi Management SDK. Package api-version 2025-12-24-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-napsteromniagentapi Java SDK. diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/README.md b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/README.md new file mode 100644 index 000000000000..d80d9959802b --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager NapsterOmniagentApi client library for Java + +Azure Resource Manager NapsterOmniagentApi client library for Java. + +This package contains Microsoft Azure SDK for NapsterOmniagentApi Management SDK. Package api-version 2025-12-24-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-napsteromniagentapi;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-napsteromniagentapi + 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(); +NapsterOmniagentApiManager manager = NapsterOmniagentApiManager + .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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/SAMPLE.md b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/SAMPLE.md new file mode 100644 index 000000000000..71e21a739c13 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/SAMPLE.md @@ -0,0 +1,385 @@ +# Code snippets and samples + + +## Operations + +- [List](#operations_list) + +## Organizations + +- [CreateOrUpdate](#organizations_createorupdate) +- [Delete](#organizations_delete) +- [GetByResourceGroup](#organizations_getbyresourcegroup) +- [LatestLinkedSaaS](#organizations_latestlinkedsaas) +- [LinkSaaS](#organizations_linksaas) +- [List](#organizations_list) +- [ListByResourceGroup](#organizations_listbyresourcegroup) +- [Update](#organizations_update) + +## SaaSOperationGroup + +- [ActivateResource](#saasoperationgroup_activateresource) +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void operationsListMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-12-24-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void operationsListMinimumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_CreateOrUpdate + +```java +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.MarketplaceDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OfferDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.PartnerProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnPropertiesV2; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +import com.azure.resourcemanager.napsteromniagentapi.models.UserDetails; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Organizations CreateOrUpdate. + */ +public final class OrganizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_CreateOrUpdate_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsCreateOrUpdateMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations() + .define("contosoOrg") + .withRegion("eastus") + .withExistingResourceGroup("rgopenapi") + .withTags(mapOf()) + .withProperties(new OrganizationProperties().withMarketplace(new MarketplaceDetails() + .withSubscriptionId("a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d") + .withSaasResourceId( + "/subscriptions/a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d/resourceGroups/rgopenapi/providers/Microsoft.SaaS/resources/contosoSaaS") + .withOfferDetails(new OfferDetails().withPublisherId("contoso") + .withOfferId("contoso-saas-app") + .withPlanId("standard-plan") + .withPlanName("Standard Plan") + .withTermUnit("P1M") + .withTermId("monthly-term-001"))) + .withUser(new UserDetails().withFirstName("John") + .withLastName("Doe") + .withEmailAddress("john.doe@contoso.com") + .withUpn("john.doe@contoso.com") + .withPhoneNumber("+1-425-555-1234")) + .withPartnerProperties(new PartnerProperties().withApplication("Contoso App")) + .withSingleSignOnProperties(new SingleSignOnPropertiesV2().withType(SingleSignOnType.SAML) + .withState(SingleSignOnStates.INITIAL) + .withEnterpriseAppId("b2c3d4e5-f6a7-4b5c-8d9e-0f1a2b3c4d5e") + .withUrl("https://login.contoso.com") + .withAadDomains(Arrays.asList("contoso.com")))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .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: 2025-12-24-preview/Organizations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Delete_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsDeleteMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations().delete("rgopenapi", "contosoOrg", com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_GetByResourceGroup + +```java +/** + * Samples for Organizations GetByResourceGroup. + */ +public final class OrganizationsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Get_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsGetMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations() + .getByResourceGroupWithResponse("rgopenapi", "contosoOrg", com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_LatestLinkedSaaS + +```java +/** + * Samples for Organizations LatestLinkedSaaS. + */ +public final class OrganizationsLatestLinkedSaaSSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_LatestLinkedSaaS_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_LatestLinkedSaaS_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsLatestLinkedSaaSMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations() + .latestLinkedSaaSWithResponse("rgopenapi", "contosoOrg", com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_LinkSaaS + +```java +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSData; + +/** + * Samples for Organizations LinkSaaS. + */ +public final class OrganizationsLinkSaaSSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_LinkSaaS_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_LinkSaaS_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsLinkSaaSMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations() + .linkSaaS("rgopenapi", "contosoOrg", new SaaSData().withSaaSResourceId( + "/subscriptions/0F0FBCF9-8374-47FC-B189-B79B84033EA3/resourceGroups/rgopenapi/providers/Microsoft.SaaS/resources/contosoSaaS"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_List + +```java +/** + * Samples for Organizations List. + */ +public final class OrganizationsListSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_ListBySubscription_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsListBySubscriptionMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: Organizations_ListBySubscription_MinimumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsListBySubscriptionMinimumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager 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: 2025-12-24-preview/Organizations_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: Organizations_ListByResourceGroup_MinimumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsListByResourceGroupMinimumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations().listByResourceGroup("rgopenapi", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_ListByResourceGroup_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsListByResourceGroupMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations().listByResourceGroup("rgopenapi", com.azure.core.util.Context.NONE); + } +} +``` + +### Organizations_Update + +```java +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Organizations Update. + */ +public final class OrganizationsUpdateSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Update_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsUpdateMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + OrganizationResource resource = manager.organizations() + .getByResourceGroupWithResponse("rgopenapi", "contosoOrg", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .apply(); + } + + // 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; + } +} +``` + +### SaaSOperationGroup_ActivateResource + +```java +import com.azure.resourcemanager.napsteromniagentapi.models.ActivateSaaSParameterRequest; + +/** + * Samples for SaaSOperationGroup ActivateResource. + */ +public final class SaaSOperationGroupActivateResourceSamples { + /* + * x-ms-original-file: 2025-12-24-preview/SaaSOperationGroup_ActivateResource_MinimumSet_Gen.json + */ + /** + * Sample code: SaaSOperationGroup_ActivateResource_MinimumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void saaSOperationGroupActivateResourceMinimumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.saaSOperationGroups() + .activateResource(new ActivateSaaSParameterRequest().withSaasGuid("a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-12-24-preview/SaaSOperationGroup_ActivateResource_MaximumSet_Gen.json + */ + /** + * Sample code: SaaSOperationGroup_ActivateResource_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void saaSOperationGroupActivateResourceMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.saaSOperationGroups() + .activateResource(new ActivateSaaSParameterRequest().withSaasGuid("a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d") + .withPublisherId("contoso"), com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml new file mode 100644 index 000000000000..77dfc14ce7e1 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-napsteromniagentapi + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for NapsterOmniagentApi Management + This package contains Microsoft Azure SDK for NapsterOmniagentApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2025-12-24-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.58.1 + + + com.azure + azure-core-management + 1.19.5 + + + com.azure + azure-core-test + 1.27.0-beta.16 + test + + + com.azure + azure-identity + 1.18.3 + test + + + diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/NapsterOmniagentApiManager.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/NapsterOmniagentApiManager.java new file mode 100644 index 000000000000..2c4be9bc9c7d --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/NapsterOmniagentApiManager.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi; + +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.napsteromniagentapi.fluent.NapsterOmniagentApiManagementClient; +import com.azure.resourcemanager.napsteromniagentapi.implementation.NapsterOmniagentApiManagementClientBuilder; +import com.azure.resourcemanager.napsteromniagentapi.implementation.OperationsImpl; +import com.azure.resourcemanager.napsteromniagentapi.implementation.OrganizationsImpl; +import com.azure.resourcemanager.napsteromniagentapi.implementation.SaaSOperationGroupsImpl; +import com.azure.resourcemanager.napsteromniagentapi.models.Operations; +import com.azure.resourcemanager.napsteromniagentapi.models.Organizations; +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSOperationGroups; +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 NapsterOmniagentApiManager. + */ +public final class NapsterOmniagentApiManager { + private Operations operations; + + private Organizations organizations; + + private SaaSOperationGroups saaSOperationGroups; + + private final NapsterOmniagentApiManagementClient clientObject; + + private NapsterOmniagentApiManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new NapsterOmniagentApiManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of NapsterOmniagentApi service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the NapsterOmniagentApi service API instance. + */ + public static NapsterOmniagentApiManager 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 NapsterOmniagentApi service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the NapsterOmniagentApi service API instance. + */ + public static NapsterOmniagentApiManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new NapsterOmniagentApiManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create NapsterOmniagentApiManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new NapsterOmniagentApiManager.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-napsteromniagentapi.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 NapsterOmniagentApi service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the NapsterOmniagentApi service API instance. + */ + public NapsterOmniagentApiManager 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.napsteromniagentapi") + .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 NapsterOmniagentApiManager(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 wrapped service client NapsterOmniagentApiManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client NapsterOmniagentApiManagementClient. + */ + public NapsterOmniagentApiManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/NapsterOmniagentApiManagementClient.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/NapsterOmniagentApiManagementClient.java new file mode 100644 index 000000000000..741513fe64a5 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/NapsterOmniagentApiManagementClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for NapsterOmniagentApiManagementClient class. + */ +public interface NapsterOmniagentApiManagementClient { + /** + * 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(); +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/OperationsClient.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/OperationsClient.java new file mode 100644 index 000000000000..3221d5db4d07 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/OrganizationsClient.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/OrganizationsClient.java new file mode 100644 index 000000000000..ee387873d2f7 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/OrganizationsClient.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.fluent.models.LatestLinkedSaaSResponseInner; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResourceUpdate; +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSData; + +/** + * An instance of this class provides access to all the operations defined in OrganizationsClient. + */ +public interface OrganizationsClient { + /** + * Get a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String organizationname, Context context); + + /** + * Get a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner getByResourceGroup(String resourceGroupName, String organizationname); + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationResourceInner> + beginCreateOrUpdate(String resourceGroupName, String organizationname, OrganizationResourceInner resource); + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationResourceInner> beginCreateOrUpdate( + String resourceGroupName, String organizationname, OrganizationResourceInner resource, Context context); + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner createOrUpdate(String resourceGroupName, String organizationname, + OrganizationResourceInner resource); + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner createOrUpdate(String resourceGroupName, String organizationname, + OrganizationResourceInner resource, Context context); + + /** + * Update a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationResourceInner> beginUpdate(String resourceGroupName, + String organizationname, OrganizationResourceUpdate properties); + + /** + * Update a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationResourceInner> beginUpdate(String resourceGroupName, + String organizationname, OrganizationResourceUpdate properties, Context context); + + /** + * Update a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner update(String resourceGroupName, String organizationname, + OrganizationResourceUpdate properties); + + /** + * Update a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner update(String resourceGroupName, String organizationname, + OrganizationResourceUpdate properties, Context context); + + /** + * Delete a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource resources by 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 OrganizationResource resources by 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 OrganizationResource resources by subscription ID. + * + * @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 OrganizationResource resources by subscription 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 the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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, OrganizationResourceInner> beginLinkSaaS(String resourceGroupName, + String organizationname, SaaSData body); + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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, OrganizationResourceInner> beginLinkSaaS(String resourceGroupName, + String organizationname, SaaSData body, Context context); + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner linkSaaS(String resourceGroupName, String organizationname, SaaSData body); + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationResourceInner linkSaaS(String resourceGroupName, String organizationname, SaaSData body, + Context context); + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 of get latest linked SaaS resource operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response latestLinkedSaaSWithResponse(String resourceGroupName, + String organizationname, Context context); + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 of get latest linked SaaS resource operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LatestLinkedSaaSResponseInner latestLinkedSaaS(String resourceGroupName, String organizationname); +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/SaaSOperationGroupsClient.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/SaaSOperationGroupsClient.java new file mode 100644 index 000000000000..58bd05943487 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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.napsteromniagentapi.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/LatestLinkedSaaSResponseInner.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/LatestLinkedSaaSResponseInner.java new file mode 100644 index 000000000000..79bf0900e944 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/LatestLinkedSaaSResponseInner.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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 java.io.IOException; + +/** + * Response of get latest linked SaaS resource operation. + */ +@Immutable +public final class LatestLinkedSaaSResponseInner implements JsonSerializable { + /* + * SaaS resource id + */ + private String saaSResourceId; + + /* + * Flag indicating if the SaaS resource is hidden + */ + private Boolean isHiddenSaaS; + + /** + * Creates an instance of LatestLinkedSaaSResponseInner class. + */ + private LatestLinkedSaaSResponseInner() { + } + + /** + * Get the saaSResourceId property: SaaS resource id. + * + * @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 LatestLinkedSaaSResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LatestLinkedSaaSResponseInner 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 LatestLinkedSaaSResponseInner. + */ + public static LatestLinkedSaaSResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LatestLinkedSaaSResponseInner deserializedLatestLinkedSaaSResponseInner + = new LatestLinkedSaaSResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saaSResourceId".equals(fieldName)) { + deserializedLatestLinkedSaaSResponseInner.saaSResourceId = reader.getString(); + } else if ("isHiddenSaaS".equals(fieldName)) { + deserializedLatestLinkedSaaSResponseInner.isHiddenSaaS = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLatestLinkedSaaSResponseInner; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/OperationInner.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/OperationInner.java new file mode 100644 index 000000000000..a3ad304316da --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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.napsteromniagentapi.models.ActionType; +import com.azure.resourcemanager.napsteromniagentapi.models.OperationDisplay; +import com.azure.resourcemanager.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/OrganizationResourceInner.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/OrganizationResourceInner.java new file mode 100644 index 000000000000..104ab0dcdc39 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/OrganizationResourceInner.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Concrete tracked resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class OrganizationResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private OrganizationProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * 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 identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the OrganizationResourceInner object itself. + */ + public OrganizationResourceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + 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); + jsonWriter.writeJsonField("identity", this.identity); + 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 ("identity".equals(fieldName)) { + deserializedOrganizationResourceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOrganizationResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceInner; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/SaaSResourceDetailsResponseInner.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/SaaSResourceDetailsResponseInner.java new file mode 100644 index 000000000000..f7eee6a564b3 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/SaaSResourceDetailsResponseInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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 { + /* + * Id of the Marketplace 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: Id of the Marketplace 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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/package-info.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/package-info.java new file mode 100644 index 000000000000..eef4f0ef2c49 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for NapsterOmniagentApi. + */ +package com.azure.resourcemanager.napsteromniagentapi.fluent.models; diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/package-info.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/package-info.java new file mode 100644 index 000000000000..4894e9f742b4 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for NapsterOmniagentApi. + */ +package com.azure.resourcemanager.napsteromniagentapi.fluent; diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/LatestLinkedSaaSResponseImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/LatestLinkedSaaSResponseImpl.java new file mode 100644 index 000000000000..d0ccc67bc872 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/LatestLinkedSaaSResponseImpl.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.napsteromniagentapi.implementation; + +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.LatestLinkedSaaSResponseInner; +import com.azure.resourcemanager.napsteromniagentapi.models.LatestLinkedSaaSResponse; + +public final class LatestLinkedSaaSResponseImpl implements LatestLinkedSaaSResponse { + private LatestLinkedSaaSResponseInner innerObject; + + private final com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager serviceManager; + + LatestLinkedSaaSResponseImpl(LatestLinkedSaaSResponseInner innerObject, + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String saaSResourceId() { + return this.innerModel().saaSResourceId(); + } + + public Boolean isHiddenSaaS() { + return this.innerModel().isHiddenSaaS(); + } + + public LatestLinkedSaaSResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientBuilder.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientBuilder.java new file mode 100644 index 000000000000..771f09da4144 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientBuilder.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.napsteromniagentapi.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 NapsterOmniagentApiManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { NapsterOmniagentApiManagementClientImpl.class }) +public final class NapsterOmniagentApiManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the NapsterOmniagentApiManagementClientBuilder. + */ + public NapsterOmniagentApiManagementClientBuilder 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 NapsterOmniagentApiManagementClientBuilder. + */ + public NapsterOmniagentApiManagementClientBuilder 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 NapsterOmniagentApiManagementClientBuilder. + */ + public NapsterOmniagentApiManagementClientBuilder 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 NapsterOmniagentApiManagementClientBuilder. + */ + public NapsterOmniagentApiManagementClientBuilder 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 NapsterOmniagentApiManagementClientBuilder. + */ + public NapsterOmniagentApiManagementClientBuilder 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 NapsterOmniagentApiManagementClientBuilder. + */ + public NapsterOmniagentApiManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of NapsterOmniagentApiManagementClientImpl with the provided parameters. + * + * @return an instance of NapsterOmniagentApiManagementClientImpl. + */ + public NapsterOmniagentApiManagementClientImpl 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(); + NapsterOmniagentApiManagementClientImpl client = new NapsterOmniagentApiManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientImpl.java new file mode 100644 index 000000000000..75e3ad0e7ed3 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientImpl.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.napsteromniagentapi.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.napsteromniagentapi.fluent.NapsterOmniagentApiManagementClient; +import com.azure.resourcemanager.napsteromniagentapi.fluent.OperationsClient; +import com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient; +import com.azure.resourcemanager.napsteromniagentapi.fluent.SaaSOperationGroupsClient; +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 NapsterOmniagentApiManagementClientImpl type. + */ +@ServiceClient(builder = NapsterOmniagentApiManagementClientBuilder.class) +public final class NapsterOmniagentApiManagementClientImpl implements NapsterOmniagentApiManagementClient { + /** + * 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; + } + + /** + * Initializes an instance of NapsterOmniagentApiManagementClient 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. + */ + NapsterOmniagentApiManagementClientImpl(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 = "2025-12-24-preview"; + this.operations = new OperationsClientImpl(this); + this.organizations = new OrganizationsClientImpl(this); + this.saaSOperationGroups = new SaaSOperationGroupsClientImpl(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 ? null : 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(NapsterOmniagentApiManagementClientImpl.class); +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationImpl.java new file mode 100644 index 000000000000..f5459c5f46ae --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.implementation; + +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.OperationInner; +import com.azure.resourcemanager.napsteromniagentapi.models.ActionType; +import com.azure.resourcemanager.napsteromniagentapi.models.Operation; +import com.azure.resourcemanager.napsteromniagentapi.models.OperationDisplay; +import com.azure.resourcemanager.napsteromniagentapi.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager 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.napsteromniagentapi.NapsterOmniagentApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationsClientImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..355167bff5b7 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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.napsteromniagentapi.fluent.OperationsClient; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.OperationInner; +import com.azure.resourcemanager.napsteromniagentapi.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 NapsterOmniagentApiManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(NapsterOmniagentApiManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NapsterOmniagentApiManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "NapsterOmniagentApiManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Napster.CompanionAPI/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/Napster.CompanionAPI/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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationsImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationsImpl.java new file mode 100644 index 000000000000..1286849ca0a0 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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.napsteromniagentapi.fluent.OperationsClient; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.OperationInner; +import com.azure.resourcemanager.napsteromniagentapi.models.Operation; +import com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager 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.napsteromniagentapi.NapsterOmniagentApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationResourceImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationResourceImpl.java new file mode 100644 index 000000000000..30b977905a9a --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationResourceImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.napsteromniagentapi.models.LatestLinkedSaaSResponse; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResource; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResourceUpdate; +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSData; +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.napsteromniagentapi.NapsterOmniagentApiManager 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 ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + 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.napsteromniagentapi.NapsterOmniagentApiManager 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() + .createOrUpdate(resourceGroupName, organizationname, this.innerModel(), Context.NONE); + return this; + } + + public OrganizationResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizations() + .createOrUpdate(resourceGroupName, organizationname, this.innerModel(), context); + return this; + } + + OrganizationResourceImpl(String name, + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager 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.napsteromniagentapi.NapsterOmniagentApiManager 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 OrganizationResource linkSaaS(SaaSData body) { + return serviceManager.organizations().linkSaaS(resourceGroupName, organizationname, body); + } + + public OrganizationResource linkSaaS(SaaSData body, Context context) { + return serviceManager.organizations().linkSaaS(resourceGroupName, organizationname, body, context); + } + + public Response latestLinkedSaaSWithResponse(Context context) { + return serviceManager.organizations() + .latestLinkedSaaSWithResponse(resourceGroupName, organizationname, context); + } + + public LatestLinkedSaaSResponse latestLinkedSaaS() { + return serviceManager.organizations().latestLinkedSaaS(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 withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProperties.withIdentity(identity); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsClientImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsClientImpl.java new file mode 100644 index 000000000000..60f62eac5827 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsClientImpl.java @@ -0,0 +1,1416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.fluent.OrganizationsClient; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.LatestLinkedSaaSResponseInner; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.napsteromniagentapi.implementation.models.OrganizationResourceListResult; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResourceUpdate; +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSData; +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 NapsterOmniagentApiManagementClientImpl client; + + /** + * Initializes an instance of OrganizationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OrganizationsClientImpl(NapsterOmniagentApiManagementClientImpl client) { + this.service + = RestProxy.create(OrganizationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NapsterOmniagentApiManagementClientOrganizations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "NapsterOmniagentApiManagementClientOrganizations") + public interface OrganizationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Napster.CompanionAPI/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/Napster.CompanionAPI/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/Napster.CompanionAPI/organizations/{organizationname}") + @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, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") OrganizationResourceInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Napster.CompanionAPI/organizations/{organizationname}") + @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, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") OrganizationResourceInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Napster.CompanionAPI/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/Napster.CompanionAPI/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/Napster.CompanionAPI/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/Napster.CompanionAPI/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/Napster.CompanionAPI/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/Napster.CompanionAPI/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/Napster.CompanionAPI/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/Napster.CompanionAPI/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); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Napster.CompanionAPI/organizations/{organizationname}/linkSaaS") + @ExpectedResponses({ 200, 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, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SaaSData body, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Napster.CompanionAPI/organizations/{organizationname}/linkSaaS") + @ExpectedResponses({ 200, 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, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SaaSData body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Napster.CompanionAPI/organizations/{organizationname}/latestLinkedSaaS") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> latestLinkedSaaS(@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/Napster.CompanionAPI/organizations/{organizationname}/latestLinkedSaaS") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response latestLinkedSaaSSync(@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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource 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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource 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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource 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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner getByResourceGroup(String resourceGroupName, String organizationname) { + return getByResourceGroupWithResponse(resourceGroupName, organizationname, Context.NONE).getValue(); + } + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String organizationname, OrganizationResourceInner 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, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String organizationname, + OrganizationResourceInner 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, contentType, accept, resource, + Context.NONE); + } + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String organizationname, + OrganizationResourceInner 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, contentType, accept, resource, + context); + } + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String organizationname, OrganizationResourceInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, organizationname, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationResourceInner.class, OrganizationResourceInner.class, + this.client.getContext()); + } + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationResourceInner> + beginCreateOrUpdate(String resourceGroupName, String organizationname, OrganizationResourceInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, organizationname, resource); + return this.client.getLroResult(response, + OrganizationResourceInner.class, OrganizationResourceInner.class, Context.NONE); + } + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationResourceInner> beginCreateOrUpdate( + String resourceGroupName, String organizationname, OrganizationResourceInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, organizationname, resource, context); + return this.client.getLroResult(response, + OrganizationResourceInner.class, OrganizationResourceInner.class, context); + } + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String organizationname, + OrganizationResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, organizationname, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner createOrUpdate(String resourceGroupName, String organizationname, + OrganizationResourceInner resource) { + return beginCreateOrUpdate(resourceGroupName, organizationname, resource).getFinalResult(); + } + + /** + * Create a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner createOrUpdate(String resourceGroupName, String organizationname, + OrganizationResourceInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, organizationname, resource, context).getFinalResult(); + } + + /** + * Update a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type 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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type 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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type 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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type 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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner update(String resourceGroupName, String organizationname, + OrganizationResourceUpdate properties) { + return beginUpdate(resourceGroupName, organizationname, properties).getFinalResult(); + } + + /** + * Update a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner update(String resourceGroupName, String organizationname, + OrganizationResourceUpdate properties, Context context) { + return beginUpdate(resourceGroupName, organizationname, properties, context).getFinalResult(); + } + + /** + * Delete a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource resources by 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 OrganizationResource resources by 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 OrganizationResource resources by 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 OrganizationResource resources by 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 OrganizationResource resources by 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 OrganizationResource resources by 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 OrganizationResource resources by subscription ID. + * + * @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 OrganizationResource resources by subscription ID. + * + * @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 OrganizationResource resources by subscription ID. + * + * @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 OrganizationResource resources by subscription ID. + * + * @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 OrganizationResource resources by subscription ID. + * + * @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 OrganizationResource resources by subscription ID. + * + * @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)); + } + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> linkSaaSWithResponseAsync(String resourceGroupName, + String organizationname, SaaSData body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.linkSaaS(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationname, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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, + SaaSData body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.linkSaaSSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationname, contentType, accept, body, + Context.NONE); + } + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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, SaaSData body, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.linkSaaSSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationname, contentType, accept, body, context); + } + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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, OrganizationResourceInner> + beginLinkSaaSAsync(String resourceGroupName, String organizationname, SaaSData body) { + Mono>> mono = linkSaaSWithResponseAsync(resourceGroupName, organizationname, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationResourceInner.class, OrganizationResourceInner.class, + this.client.getContext()); + } + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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, OrganizationResourceInner> + beginLinkSaaS(String resourceGroupName, String organizationname, SaaSData body) { + Response response = linkSaaSWithResponse(resourceGroupName, organizationname, body); + return this.client.getLroResult(response, + OrganizationResourceInner.class, OrganizationResourceInner.class, Context.NONE); + } + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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, OrganizationResourceInner> + beginLinkSaaS(String resourceGroupName, String organizationname, SaaSData body, Context context) { + Response response = linkSaaSWithResponse(resourceGroupName, organizationname, body, context); + return this.client.getLroResult(response, + OrganizationResourceInner.class, OrganizationResourceInner.class, context); + } + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono linkSaaSAsync(String resourceGroupName, String organizationname, + SaaSData body) { + return beginLinkSaaSAsync(resourceGroupName, organizationname, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner linkSaaS(String resourceGroupName, String organizationname, SaaSData body) { + return beginLinkSaaS(resourceGroupName, organizationname, body).getFinalResult(); + } + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationResourceInner linkSaaS(String resourceGroupName, String organizationname, SaaSData body, + Context context) { + return beginLinkSaaS(resourceGroupName, organizationname, body, context).getFinalResult(); + } + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 of get latest linked SaaS resource operation along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> latestLinkedSaaSWithResponseAsync(String resourceGroupName, + String organizationname) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.latestLinkedSaaS(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationname, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 of get latest linked SaaS resource operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono latestLinkedSaaSAsync(String resourceGroupName, + String organizationname) { + return latestLinkedSaaSWithResponseAsync(resourceGroupName, organizationname) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 of get latest linked SaaS resource operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response latestLinkedSaaSWithResponse(String resourceGroupName, + String organizationname, Context context) { + final String accept = "application/json"; + return service.latestLinkedSaaSSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationname, accept, context); + } + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 of get latest linked SaaS resource operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LatestLinkedSaaSResponseInner latestLinkedSaaS(String resourceGroupName, String organizationname) { + return latestLinkedSaaSWithResponse(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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsImpl.java new file mode 100644 index 000000000000..cc53fd431321 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.fluent.OrganizationsClient; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.LatestLinkedSaaSResponseInner; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.napsteromniagentapi.models.LatestLinkedSaaSResponse; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResource; +import com.azure.resourcemanager.napsteromniagentapi.models.Organizations; +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSData; + +public final class OrganizationsImpl implements Organizations { + private static final ClientLogger LOGGER = new ClientLogger(OrganizationsImpl.class); + + private final OrganizationsClient innerClient; + + private final com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager serviceManager; + + public OrganizationsImpl(OrganizationsClient innerClient, + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager 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 OrganizationResource linkSaaS(String resourceGroupName, String organizationname, SaaSData body) { + OrganizationResourceInner inner = this.serviceClient().linkSaaS(resourceGroupName, organizationname, body); + if (inner != null) { + return new OrganizationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public OrganizationResource linkSaaS(String resourceGroupName, String organizationname, SaaSData body, + Context context) { + OrganizationResourceInner inner + = this.serviceClient().linkSaaS(resourceGroupName, organizationname, body, context); + if (inner != null) { + return new OrganizationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response latestLinkedSaaSWithResponse(String resourceGroupName, + String organizationname, Context context) { + Response inner + = this.serviceClient().latestLinkedSaaSWithResponse(resourceGroupName, organizationname, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LatestLinkedSaaSResponseImpl(inner.getValue(), this.manager())); + } + + public LatestLinkedSaaSResponse latestLinkedSaaS(String resourceGroupName, String organizationname) { + LatestLinkedSaaSResponseInner inner + = this.serviceClient().latestLinkedSaaS(resourceGroupName, organizationname); + if (inner != null) { + return new LatestLinkedSaaSResponseImpl(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.napsteromniagentapi.NapsterOmniagentApiManager manager() { + return this.serviceManager; + } + + public OrganizationResourceImpl define(String name) { + return new OrganizationResourceImpl(name, this.manager()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/ResourceManagerUtils.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..89b15cb30ebd --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSOperationGroupsClientImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSOperationGroupsClientImpl.java new file mode 100644 index 000000000000..e1195a211261 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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.napsteromniagentapi.fluent.SaaSOperationGroupsClient; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.napsteromniagentapi.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 NapsterOmniagentApiManagementClientImpl client; + + /** + * Initializes an instance of SaaSOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SaaSOperationGroupsClientImpl(NapsterOmniagentApiManagementClientImpl client) { + this.service = RestProxy.create(SaaSOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NapsterOmniagentApiManagementClientSaaSOperationGroups to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "NapsterOmniagentApiManagementClientSaaSOperationGroups") + public interface SaaSOperationGroupsService { + @Post("/subscriptions/{subscriptionId}/providers/Napster.CompanionAPI/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/Napster.CompanionAPI/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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSOperationGroupsImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSOperationGroupsImpl.java new file mode 100644 index 000000000000..16e1483ef1e9 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.napsteromniagentapi.fluent.SaaSOperationGroupsClient; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.napsteromniagentapi.models.ActivateSaaSParameterRequest; +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSOperationGroups; +import com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager serviceManager; + + public SaaSOperationGroupsImpl(SaaSOperationGroupsClient innerClient, + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager 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.napsteromniagentapi.NapsterOmniagentApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSResourceDetailsResponseImpl.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSResourceDetailsResponseImpl.java new file mode 100644 index 000000000000..311a204fc6e8 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSResourceDetailsResponse; + +public final class SaaSResourceDetailsResponseImpl implements SaaSResourceDetailsResponse { + private SaaSResourceDetailsResponseInner innerObject; + + private final com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager serviceManager; + + SaaSResourceDetailsResponseImpl(SaaSResourceDetailsResponseInner innerObject, + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager 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.napsteromniagentapi.NapsterOmniagentApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/models/OperationListResult.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..84320ffb3afc --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/models/OrganizationResourceListResult.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/models/OrganizationResourceListResult.java new file mode 100644 index 000000000000..2b7b58be4c81 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/package-info.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/package-info.java new file mode 100644 index 000000000000..37276883676b --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for NapsterOmniagentApi. + */ +package com.azure.resourcemanager.napsteromniagentapi.implementation; diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ActionType.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ActionType.java new file mode 100644 index 000000000000..802b1e652bb2 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ActivateSaaSParameterRequest.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ActivateSaaSParameterRequest.java new file mode 100644 index 000000000000..867118b3683f --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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 & PublishedId for Activate and Validate SaaS Resource. + */ +@Fluent +public final class ActivateSaaSParameterRequest implements JsonSerializable { + /* + * SaaS guid for Activate and Validate SaaS Resource + */ + private String saasGuid; + + /* + * Publisher Id for Napster resource + */ + private String publisherId; + + /** + * Creates an instance of ActivateSaaSParameterRequest class. + */ + public ActivateSaaSParameterRequest() { + } + + /** + * Get the saasGuid property: SaaS guid for Activate and Validate SaaS Resource. + * + * @return the saasGuid value. + */ + public String saasGuid() { + return this.saasGuid; + } + + /** + * Set the saasGuid property: SaaS guid for Activate and Validate SaaS Resource. + * + * @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 Napster resource. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Publisher Id for Napster resource. + * + * @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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/LatestLinkedSaaSResponse.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/LatestLinkedSaaSResponse.java new file mode 100644 index 000000000000..e3c5d330d6e8 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/LatestLinkedSaaSResponse.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.models; + +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.LatestLinkedSaaSResponseInner; + +/** + * An immutable client-side representation of LatestLinkedSaaSResponse. + */ +public interface LatestLinkedSaaSResponse { + /** + * Gets the saaSResourceId property: SaaS resource id. + * + * @return the saaSResourceId value. + */ + String saaSResourceId(); + + /** + * Gets the isHiddenSaaS property: Flag indicating if the SaaS resource is hidden. + * + * @return the isHiddenSaaS value. + */ + Boolean isHiddenSaaS(); + + /** + * Gets the inner com.azure.resourcemanager.napsteromniagentapi.fluent.models.LatestLinkedSaaSResponseInner object. + * + * @return the inner object. + */ + LatestLinkedSaaSResponseInner innerModel(); +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentity.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..6a68316a7102 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentity.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity 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 ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentityType.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..959293dd35d0 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * No managed identity. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User assigned managed identity. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * System and user assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/MarketplaceDetails.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/MarketplaceDetails.java new file mode 100644 index 000000000000..591d828863df --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/MarketplaceSubscriptionStatus.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/MarketplaceSubscriptionStatus.java new file mode 100644 index 000000000000..8484ca773b9b --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OfferDetails.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OfferDetails.java new file mode 100644 index 000000000000..23b22ce9581a --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Operation.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Operation.java new file mode 100644 index 000000000000..75393d8f85ff --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.models; + +import com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OperationDisplay.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OperationDisplay.java new file mode 100644 index 000000000000..406263be3008 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Operations.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Operations.java new file mode 100644 index 000000000000..d45d5e2133b8 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationProperties.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationProperties.java new file mode 100644 index 000000000000..972834ef4010 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationProperties.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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 specific to Organization. + */ +@Fluent +public final class OrganizationProperties implements JsonSerializable { + /* + * Marketplace details of the resource. + */ + private MarketplaceDetails marketplace; + + /* + * Details of the user. + */ + private UserDetails user; + + /* + * Provisioning state of the resource. + */ + private ResourceProvisioningState provisioningState; + + /* + * partner properties + */ + private PartnerProperties partnerProperties; + + /* + * Single sign-on properties + */ + private SingleSignOnPropertiesV2 singleSignOnProperties; + + /** + * Creates an instance of OrganizationProperties class. + */ + public OrganizationProperties() { + } + + /** + * Get the marketplace property: Marketplace details of the resource. + * + * @return the marketplace value. + */ + public MarketplaceDetails marketplace() { + return this.marketplace; + } + + /** + * Set the marketplace property: Marketplace details of the resource. + * + * @param marketplace the marketplace value to set. + * @return the OrganizationProperties object itself. + */ + public OrganizationProperties withMarketplace(MarketplaceDetails marketplace) { + this.marketplace = marketplace; + return this; + } + + /** + * Get the user property: Details of the user. + * + * @return the user value. + */ + public UserDetails user() { + return this.user; + } + + /** + * Set the user property: Details of the user. + * + * @param user the user value to set. + * @return the OrganizationProperties object itself. + */ + public OrganizationProperties withUser(UserDetails user) { + this.user = user; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the partnerProperties property: partner properties. + * + * @return the partnerProperties value. + */ + public PartnerProperties partnerProperties() { + return this.partnerProperties; + } + + /** + * Set the partnerProperties property: partner properties. + * + * @param partnerProperties the partnerProperties value to set. + * @return the OrganizationProperties object itself. + */ + public OrganizationProperties withPartnerProperties(PartnerProperties partnerProperties) { + this.partnerProperties = partnerProperties; + return this; + } + + /** + * Get the singleSignOnProperties property: Single sign-on properties. + * + * @return the singleSignOnProperties value. + */ + public SingleSignOnPropertiesV2 singleSignOnProperties() { + return this.singleSignOnProperties; + } + + /** + * Set the singleSignOnProperties property: Single sign-on properties. + * + * @param singleSignOnProperties the singleSignOnProperties value to set. + * @return the OrganizationProperties object itself. + */ + public OrganizationProperties withSingleSignOnProperties(SingleSignOnPropertiesV2 singleSignOnProperties) { + this.singleSignOnProperties = singleSignOnProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("marketplace", this.marketplace); + jsonWriter.writeJsonField("user", this.user); + jsonWriter.writeJsonField("partnerProperties", this.partnerProperties); + jsonWriter.writeJsonField("singleSignOnProperties", this.singleSignOnProperties); + 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 ("marketplace".equals(fieldName)) { + deserializedOrganizationProperties.marketplace = MarketplaceDetails.fromJson(reader); + } else if ("user".equals(fieldName)) { + deserializedOrganizationProperties.user = UserDetails.fromJson(reader); + } else if ("partnerProperties".equals(fieldName)) { + deserializedOrganizationProperties.partnerProperties = PartnerProperties.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedOrganizationProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else if ("singleSignOnProperties".equals(fieldName)) { + deserializedOrganizationProperties.singleSignOnProperties + = SingleSignOnPropertiesV2.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationProperties; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationResource.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationResource.java new file mode 100644 index 000000000000..d5a814b1e0e5 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationResource.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.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 identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * 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.napsteromniagentapi.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, DefinitionStages.WithIdentity { + /** + * 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); + } + + /** + * The stage of the OrganizationResource definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * 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.WithIdentity { + /** + * 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 identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * 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); + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @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 response. + */ + OrganizationResource linkSaaS(SaaSData body); + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @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 response. + */ + OrganizationResource linkSaaS(SaaSData body, Context context); + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @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 of get latest linked SaaS resource operation along with {@link Response}. + */ + Response latestLinkedSaaSWithResponse(Context context); + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @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 of get latest linked SaaS resource operation. + */ + LatestLinkedSaaSResponse latestLinkedSaaS(); +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationResourceUpdate.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationResourceUpdate.java new file mode 100644 index 000000000000..aab97e88bf3e --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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; + +/** + * The type used for update operations of the Organization Resource. + */ +@Fluent +public final class OrganizationResourceUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /** + * 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 identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the OrganizationResourceUpdate object itself. + */ + public OrganizationResourceUpdate withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + 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("identity", this.identity); + 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 ("identity".equals(fieldName)) { + deserializedOrganizationResourceUpdate.identity = ManagedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceUpdate; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Organizations.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Organizations.java new file mode 100644 index 000000000000..5133b5d32f23 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Organizations.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.napsteromniagentapi.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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String organizationname, + Context context); + + /** + * Get a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource. + */ + OrganizationResource getByResourceGroup(String resourceGroupName, String organizationname); + + /** + * Delete a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 a OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 OrganizationResource resources by 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 OrganizationResource resources by 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 OrganizationResource resources by subscription ID. + * + * @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 OrganizationResource resources by subscription 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 the response of a OrganizationResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 response. + */ + OrganizationResource linkSaaS(String resourceGroupName, String organizationname, SaaSData body); + + /** + * Links a new SaaS to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 response. + */ + OrganizationResource linkSaaS(String resourceGroupName, String organizationname, SaaSData body, Context context); + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 of get latest linked SaaS resource operation along with {@link Response}. + */ + Response latestLinkedSaaSWithResponse(String resourceGroupName, String organizationname, + Context context); + + /** + * Returns the latest SaaS linked to the Napster organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationname Name of the Organization resource. + * @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 of get latest linked SaaS resource operation. + */ + LatestLinkedSaaSResponse latestLinkedSaaS(String resourceGroupName, String organizationname); + + /** + * Get a OrganizationResource. + * + * @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 OrganizationResource along with {@link Response}. + */ + OrganizationResource getById(String id); + + /** + * Get a OrganizationResource. + * + * @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 OrganizationResource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a OrganizationResource. + * + * @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 OrganizationResource. + * + * @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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Origin.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Origin.java new file mode 100644 index 000000000000..c23174635db3 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/PartnerProperties.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/PartnerProperties.java new file mode 100644 index 000000000000..920bc9b71fe5 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/PartnerProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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's specific Properties. + */ +@Fluent +public final class PartnerProperties implements JsonSerializable { + /* + * Application name + */ + private String application; + + /** + * Creates an instance of PartnerProperties class. + */ + public PartnerProperties() { + } + + /** + * Get the application property: Application name. + * + * @return the application value. + */ + public String application() { + return this.application; + } + + /** + * Set the application property: Application name. + * + * @param application the application value to set. + * @return the PartnerProperties object itself. + */ + public PartnerProperties withApplication(String application) { + this.application = application; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("application", this.application); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartnerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartnerProperties 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 PartnerProperties. + */ + public static PartnerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartnerProperties deserializedPartnerProperties = new PartnerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("application".equals(fieldName)) { + deserializedPartnerProperties.application = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPartnerProperties; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ResourceProvisioningState.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ResourceProvisioningState.java new file mode 100644 index 000000000000..5f38737e19e3 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSData.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSData.java new file mode 100644 index 000000000000..18af6dc75093 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSData.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.napsteromniagentapi.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-related data properties. + */ +@Fluent +public final class SaaSData implements JsonSerializable { + /* + * SaaS resource id + */ + private String saaSResourceId; + + /** + * Creates an instance of SaaSData class. + */ + public SaaSData() { + } + + /** + * Get the saaSResourceId property: SaaS resource id. + * + * @return the saaSResourceId value. + */ + public String saaSResourceId() { + return this.saaSResourceId; + } + + /** + * Set the saaSResourceId property: SaaS resource id. + * + * @param saaSResourceId the saaSResourceId value to set. + * @return the SaaSData object itself. + */ + public SaaSData withSaaSResourceId(String saaSResourceId) { + this.saaSResourceId = saaSResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("saaSResourceId", this.saaSResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SaaSData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SaaSData 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 SaaSData. + */ + public static SaaSData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SaaSData deserializedSaaSData = new SaaSData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saaSResourceId".equals(fieldName)) { + deserializedSaaSData.saaSResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSaaSData; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSOperationGroups.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSOperationGroups.java new file mode 100644 index 000000000000..5e7ab68bce93 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSResourceDetailsResponse.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSResourceDetailsResponse.java new file mode 100644 index 000000000000..6c21c55c30f3 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.napsteromniagentapi.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: Id of the Marketplace 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.napsteromniagentapi.fluent.models.SaaSResourceDetailsResponseInner + * object. + * + * @return the inner object. + */ + SaaSResourceDetailsResponseInner innerModel(); +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnPropertiesV2.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnPropertiesV2.java new file mode 100644 index 000000000000..8a4ab3a2bae1 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnPropertiesV2.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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 specific to Single Sign On Resource. + */ +@Fluent +public final class SingleSignOnPropertiesV2 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 SingleSignOnPropertiesV2 class. + */ + public SingleSignOnPropertiesV2() { + } + + /** + * Get the type property: Type of Single Sign-On mechanism being used. + * + * @return the type value. + */ + public SingleSignOnType type() { + return this.type; + } + + /** + * Set the type property: Type of Single Sign-On mechanism being used. + * + * @param type the type value to set. + * @return the SingleSignOnPropertiesV2 object itself. + */ + public SingleSignOnPropertiesV2 withType(SingleSignOnType type) { + this.type = type; + return this; + } + + /** + * Get the state property: State of the Single Sign On for the resource. + * + * @return the state value. + */ + public SingleSignOnStates state() { + return this.state; + } + + /** + * Set the state property: State of the Single Sign On for the resource. + * + * @param state the state value to set. + * @return the SingleSignOnPropertiesV2 object itself. + */ + public SingleSignOnPropertiesV2 withState(SingleSignOnStates state) { + this.state = state; + return this; + } + + /** + * Get the enterpriseAppId property: AAD enterprise application Id used to setup SSO. + * + * @return the enterpriseAppId value. + */ + public String enterpriseAppId() { + return this.enterpriseAppId; + } + + /** + * Set the enterpriseAppId property: AAD enterprise application Id used to setup SSO. + * + * @param enterpriseAppId the enterpriseAppId value to set. + * @return the SingleSignOnPropertiesV2 object itself. + */ + public SingleSignOnPropertiesV2 withEnterpriseAppId(String enterpriseAppId) { + this.enterpriseAppId = enterpriseAppId; + return this; + } + + /** + * 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; + } + + /** + * Set the url property: URL for SSO to be used by the partner to redirect the user to their system. + * + * @param url the url value to set. + * @return the SingleSignOnPropertiesV2 object itself. + */ + public SingleSignOnPropertiesV2 withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the aadDomains property: List of AAD domains fetched from Microsoft Graph for user. + * + * @return the aadDomains value. + */ + public List aadDomains() { + return this.aadDomains; + } + + /** + * Set the aadDomains property: List of AAD domains fetched from Microsoft Graph for user. + * + * @param aadDomains the aadDomains value to set. + * @return the SingleSignOnPropertiesV2 object itself. + */ + public SingleSignOnPropertiesV2 withAadDomains(List aadDomains) { + this.aadDomains = aadDomains; + return this; + } + + /** + * {@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 SingleSignOnPropertiesV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingleSignOnPropertiesV2 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 SingleSignOnPropertiesV2. + */ + public static SingleSignOnPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingleSignOnPropertiesV2 deserializedSingleSignOnPropertiesV2 = new SingleSignOnPropertiesV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSingleSignOnPropertiesV2.type = SingleSignOnType.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedSingleSignOnPropertiesV2.state = SingleSignOnStates.fromString(reader.getString()); + } else if ("enterpriseAppId".equals(fieldName)) { + deserializedSingleSignOnPropertiesV2.enterpriseAppId = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedSingleSignOnPropertiesV2.url = reader.getString(); + } else if ("aadDomains".equals(fieldName)) { + List aadDomains = reader.readArray(reader1 -> reader1.getString()); + deserializedSingleSignOnPropertiesV2.aadDomains = aadDomains; + } else { + reader.skipChildren(); + } + } + + return deserializedSingleSignOnPropertiesV2; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnStates.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnStates.java new file mode 100644 index 000000000000..a58f4aaf37d9 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnType.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnType.java new file mode 100644 index 000000000000..4e17ee74e4ad --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserAssignedIdentity.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..d667be2608ed --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserAssignedIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private String principalId; + + /* + * The client ID of the assigned identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity 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 UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserDetails.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserDetails.java new file mode 100644 index 000000000000..6e1896c20c74 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserDetails.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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; + +/** + * User details for an organization. + */ +@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; + + /** + * 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; + } + + /** + * {@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); + 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 { + reader.skipChildren(); + } + } + + return deserializedUserDetails; + }); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/package-info.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/package-info.java new file mode 100644 index 000000000000..e0f1355832b5 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for NapsterOmniagentApi. + */ +package com.azure.resourcemanager.napsteromniagentapi.models; diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/package-info.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/package-info.java new file mode 100644 index 000000000000..6603ebe60b86 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/com/azure/resourcemanager/napsteromniagentapi/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for NapsterOmniagentApi. + */ +package com.azure.resourcemanager.napsteromniagentapi; diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/module-info.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/java/module-info.java new file mode 100644 index 000000000000..3cc01a406f96 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/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.napsteromniagentapi { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.napsteromniagentapi; + exports com.azure.resourcemanager.napsteromniagentapi.fluent; + exports com.azure.resourcemanager.napsteromniagentapi.fluent.models; + exports com.azure.resourcemanager.napsteromniagentapi.models; + + opens com.azure.resourcemanager.napsteromniagentapi.fluent.models to com.azure.core; + opens com.azure.resourcemanager.napsteromniagentapi.models to com.azure.core; + opens com.azure.resourcemanager.napsteromniagentapi.implementation.models to com.azure.core; +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/azure-resourcemanager-napsteromniagentapi_metadata.json b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/azure-resourcemanager-napsteromniagentapi_metadata.json new file mode 100644 index 000000000000..68b1f99a0d04 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/azure-resourcemanager-napsteromniagentapi_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Napster.CompanionAPI":"2025-12-24-preview"},"crossLanguagePackageId":"Napster.CompanionAPI","crossLanguageVersion":"e58d4753c777","crossLanguageDefinitions":{"com.azure.resourcemanager.napsteromniagentapi.fluent.NapsterOmniagentApiManagementClient":"Napster.CompanionAPI","com.azure.resourcemanager.napsteromniagentapi.fluent.OperationsClient":"Napster.CompanionAPI.Operations","com.azure.resourcemanager.napsteromniagentapi.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient":"Napster.CompanionAPI.Organizations","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.beginCreateOrUpdate":"Napster.CompanionAPI.Organizations.createOrUpdate","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.beginDelete":"Napster.CompanionAPI.Organizations.delete","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.beginLinkSaaS":"Napster.CompanionAPI.Organizations.linkSaaS","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.beginUpdate":"Napster.CompanionAPI.Organizations.update","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.createOrUpdate":"Napster.CompanionAPI.Organizations.createOrUpdate","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.delete":"Napster.CompanionAPI.Organizations.delete","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.getByResourceGroup":"Napster.CompanionAPI.Organizations.get","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.getByResourceGroupWithResponse":"Napster.CompanionAPI.Organizations.get","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.latestLinkedSaaS":"Napster.CompanionAPI.Organizations.latestLinkedSaaS","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.latestLinkedSaaSWithResponse":"Napster.CompanionAPI.Organizations.latestLinkedSaaS","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.linkSaaS":"Napster.CompanionAPI.Organizations.linkSaaS","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.list":"Napster.CompanionAPI.Organizations.listBySubscription","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.listByResourceGroup":"Napster.CompanionAPI.Organizations.listByResourceGroup","com.azure.resourcemanager.napsteromniagentapi.fluent.OrganizationsClient.update":"Napster.CompanionAPI.Organizations.update","com.azure.resourcemanager.napsteromniagentapi.fluent.SaaSOperationGroupsClient":"Napster.CompanionAPI.SaaSOperationGroup","com.azure.resourcemanager.napsteromniagentapi.fluent.SaaSOperationGroupsClient.activateResource":"Napster.CompanionAPI.SaaSOperationGroup.activateResource","com.azure.resourcemanager.napsteromniagentapi.fluent.SaaSOperationGroupsClient.beginActivateResource":"Napster.CompanionAPI.SaaSOperationGroup.activateResource","com.azure.resourcemanager.napsteromniagentapi.fluent.models.LatestLinkedSaaSResponseInner":"Napster.CompanionAPI.LatestLinkedSaaSResponse","com.azure.resourcemanager.napsteromniagentapi.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.napsteromniagentapi.fluent.models.OrganizationResourceInner":"Napster.CompanionAPI.OrganizationResource","com.azure.resourcemanager.napsteromniagentapi.fluent.models.SaaSResourceDetailsResponseInner":"Napster.CompanionAPI.SaaSResourceDetailsResponse","com.azure.resourcemanager.napsteromniagentapi.implementation.NapsterOmniagentApiManagementClientBuilder":"Napster.CompanionAPI","com.azure.resourcemanager.napsteromniagentapi.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.napsteromniagentapi.implementation.models.OrganizationResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.napsteromniagentapi.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.napsteromniagentapi.models.ActivateSaaSParameterRequest":"Napster.CompanionAPI.ActivateSaaSParameterRequest","com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.napsteromniagentapi.models.MarketplaceDetails":"LiftrBase.MarketplaceDetails","com.azure.resourcemanager.napsteromniagentapi.models.MarketplaceSubscriptionStatus":"LiftrBase.MarketplaceSubscriptionStatus","com.azure.resourcemanager.napsteromniagentapi.models.OfferDetails":"LiftrBase.OfferDetails","com.azure.resourcemanager.napsteromniagentapi.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.napsteromniagentapi.models.OrganizationProperties":"Napster.CompanionAPI.OrganizationProperties","com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResourceUpdate":"Napster.CompanionAPI.OrganizationResourceUpdate","com.azure.resourcemanager.napsteromniagentapi.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.napsteromniagentapi.models.PartnerProperties":"Napster.CompanionAPI.PartnerProperties","com.azure.resourcemanager.napsteromniagentapi.models.ResourceProvisioningState":"Azure.ResourceManager.ResourceProvisioningState","com.azure.resourcemanager.napsteromniagentapi.models.SaaSData":"Napster.CompanionAPI.SaaSData","com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnPropertiesV2":"LiftrBase.SingleSignOnPropertiesV2","com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates":"LiftrBase.SingleSignOnStates","com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType":"LiftrBase.SingleSignOnType","com.azure.resourcemanager.napsteromniagentapi.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.napsteromniagentapi.models.UserDetails":"LiftrBase.UserDetails"},"generatedFiles":["src/main/java/com/azure/resourcemanager/napsteromniagentapi/NapsterOmniagentApiManager.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/NapsterOmniagentApiManagementClient.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/OrganizationsClient.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/SaaSOperationGroupsClient.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/LatestLinkedSaaSResponseInner.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/OrganizationResourceInner.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/SaaSResourceDetailsResponseInner.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/fluent/package-info.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/LatestLinkedSaaSResponseImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/NapsterOmniagentApiManagementClientImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationResourceImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsClientImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/OrganizationsImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSOperationGroupsClientImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSOperationGroupsImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/SaaSResourceDetailsResponseImpl.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/models/OrganizationResourceListResult.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/implementation/package-info.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ActionType.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ActivateSaaSParameterRequest.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/LatestLinkedSaaSResponse.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/MarketplaceDetails.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/MarketplaceSubscriptionStatus.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OfferDetails.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Operation.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Operations.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationProperties.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationResource.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/OrganizationResourceUpdate.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Organizations.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/Origin.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/PartnerProperties.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/ResourceProvisioningState.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSData.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSOperationGroups.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SaaSResourceDetailsResponse.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnPropertiesV2.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnStates.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/SingleSignOnType.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/UserDetails.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/models/package-info.java","src/main/java/com/azure/resourcemanager/napsteromniagentapi/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-napsteromniagentapi/proxy-config.json b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-napsteromniagentapi/proxy-config.json new file mode 100644 index 000000000000..c7b13438da2c --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-napsteromniagentapi/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.napsteromniagentapi.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.napsteromniagentapi.implementation.OrganizationsClientImpl$OrganizationsService"],["com.azure.resourcemanager.napsteromniagentapi.implementation.SaaSOperationGroupsClientImpl$SaaSOperationGroupsService"]] \ No newline at end of file diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-napsteromniagentapi/reflect-config.json b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-napsteromniagentapi/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-napsteromniagentapi/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/azure-resourcemanager-napsteromniagentapi.properties b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/azure-resourcemanager-napsteromniagentapi.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/main/resources/azure-resourcemanager-napsteromniagentapi.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationsListSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationsListSamples.java new file mode 100644 index 000000000000..373a43b0b503 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationsListSamples.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.napsteromniagentapi.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void operationsListMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-12-24-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void operationsListMinimumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsCreateOrUpdateSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..64ab4464befa --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsCreateOrUpdateSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.generated; + +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.MarketplaceDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OfferDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.PartnerProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnPropertiesV2; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +import com.azure.resourcemanager.napsteromniagentapi.models.UserDetails; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Organizations CreateOrUpdate. + */ +public final class OrganizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_CreateOrUpdate_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsCreateOrUpdateMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations() + .define("contosoOrg") + .withRegion("eastus") + .withExistingResourceGroup("rgopenapi") + .withTags(mapOf()) + .withProperties(new OrganizationProperties().withMarketplace(new MarketplaceDetails() + .withSubscriptionId("a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d") + .withSaasResourceId( + "/subscriptions/a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d/resourceGroups/rgopenapi/providers/Microsoft.SaaS/resources/contosoSaaS") + .withOfferDetails(new OfferDetails().withPublisherId("contoso") + .withOfferId("contoso-saas-app") + .withPlanId("standard-plan") + .withPlanName("Standard Plan") + .withTermUnit("P1M") + .withTermId("monthly-term-001"))) + .withUser(new UserDetails().withFirstName("John") + .withLastName("Doe") + .withEmailAddress("john.doe@contoso.com") + .withUpn("john.doe@contoso.com") + .withPhoneNumber("+1-425-555-1234")) + .withPartnerProperties(new PartnerProperties().withApplication("Contoso App")) + .withSingleSignOnProperties(new SingleSignOnPropertiesV2().withType(SingleSignOnType.SAML) + .withState(SingleSignOnStates.INITIAL) + .withEnterpriseAppId("b2c3d4e5-f6a7-4b5c-8d9e-0f1a2b3c4d5e") + .withUrl("https://login.contoso.com") + .withAadDomains(Arrays.asList("contoso.com")))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsDeleteSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsDeleteSamples.java new file mode 100644 index 000000000000..e4e7aaf8bc19 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsDeleteSamples.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.napsteromniagentapi.generated; + +/** + * Samples for Organizations Delete. + */ +public final class OrganizationsDeleteSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Delete_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsDeleteMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations().delete("rgopenapi", "contosoOrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsGetByResourceGroupSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..70d605d1a473 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsGetByResourceGroupSamples.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.napsteromniagentapi.generated; + +/** + * Samples for Organizations GetByResourceGroup. + */ +public final class OrganizationsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Get_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsGetMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations() + .getByResourceGroupWithResponse("rgopenapi", "contosoOrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLatestLinkedSaaSSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLatestLinkedSaaSSamples.java new file mode 100644 index 000000000000..bc51fd582672 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLatestLinkedSaaSSamples.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.napsteromniagentapi.generated; + +/** + * Samples for Organizations LatestLinkedSaaS. + */ +public final class OrganizationsLatestLinkedSaaSSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_LatestLinkedSaaS_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_LatestLinkedSaaS_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsLatestLinkedSaaSMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations() + .latestLinkedSaaSWithResponse("rgopenapi", "contosoOrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLinkSaaSSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLinkSaaSSamples.java new file mode 100644 index 000000000000..664e8b1d4498 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLinkSaaSSamples.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.napsteromniagentapi.generated; + +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSData; + +/** + * Samples for Organizations LinkSaaS. + */ +public final class OrganizationsLinkSaaSSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_LinkSaaS_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_LinkSaaS_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsLinkSaaSMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations() + .linkSaaS("rgopenapi", "contosoOrg", new SaaSData().withSaaSResourceId( + "/subscriptions/0F0FBCF9-8374-47FC-B189-B79B84033EA3/resourceGroups/rgopenapi/providers/Microsoft.SaaS/resources/contosoSaaS"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListByResourceGroupSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..a81da03f90d4 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.generated; + +/** + * Samples for Organizations ListByResourceGroup. + */ +public final class OrganizationsListByResourceGroupSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: Organizations_ListByResourceGroup_MinimumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsListByResourceGroupMinimumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations().listByResourceGroup("rgopenapi", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_ListByResourceGroup_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsListByResourceGroupMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations().listByResourceGroup("rgopenapi", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListSamples.java new file mode 100644 index 000000000000..c82025796881 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.generated; + +/** + * Samples for Organizations List. + */ +public final class OrganizationsListSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_ListBySubscription_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsListBySubscriptionMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: Organizations_ListBySubscription_MinimumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsListBySubscriptionMinimumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.organizations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsUpdateSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsUpdateSamples.java new file mode 100644 index 000000000000..c6a36825be68 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsUpdateSamples.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.napsteromniagentapi.generated; + +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Organizations Update. + */ +public final class OrganizationsUpdateSamples { + /* + * x-ms-original-file: 2025-12-24-preview/Organizations_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Organizations_Update_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void organizationsUpdateMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + OrganizationResource resource = manager.organizations() + .getByResourceGroupWithResponse("rgopenapi", "contosoOrg", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf())) + .apply(); + } + + // 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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSOperationGroupActivateResourceSamples.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSOperationGroupActivateResourceSamples.java new file mode 100644 index 000000000000..e1b20d3e07fc --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/samples/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSOperationGroupActivateResourceSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.generated; + +import com.azure.resourcemanager.napsteromniagentapi.models.ActivateSaaSParameterRequest; + +/** + * Samples for SaaSOperationGroup ActivateResource. + */ +public final class SaaSOperationGroupActivateResourceSamples { + /* + * x-ms-original-file: 2025-12-24-preview/SaaSOperationGroup_ActivateResource_MinimumSet_Gen.json + */ + /** + * Sample code: SaaSOperationGroup_ActivateResource_MinimumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void saaSOperationGroupActivateResourceMinimumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.saaSOperationGroups() + .activateResource(new ActivateSaaSParameterRequest().withSaasGuid("a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-12-24-preview/SaaSOperationGroup_ActivateResource_MaximumSet_Gen.json + */ + /** + * Sample code: SaaSOperationGroup_ActivateResource_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to NapsterOmniagentApiManager. + */ + public static void saaSOperationGroupActivateResourceMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.napsteromniagentapi.NapsterOmniagentApiManager manager) { + manager.saaSOperationGroups() + .activateResource(new ActivateSaaSParameterRequest().withSaasGuid("a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d") + .withPublisherId("contoso"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/ActivateSaaSParameterRequestTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/ActivateSaaSParameterRequestTests.java new file mode 100644 index 000000000000..de6f313667a3 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/ActivateSaaSParameterRequestTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.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\":\"nehmpvecx\",\"publisherId\":\"debfqkkrbmpukgri\"}") + .toObject(ActivateSaaSParameterRequest.class); + Assertions.assertEquals("nehmpvecx", model.saasGuid()); + Assertions.assertEquals("debfqkkrbmpukgri", model.publisherId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ActivateSaaSParameterRequest model + = new ActivateSaaSParameterRequest().withSaasGuid("nehmpvecx").withPublisherId("debfqkkrbmpukgri"); + model = BinaryData.fromObject(model).toObject(ActivateSaaSParameterRequest.class); + Assertions.assertEquals("nehmpvecx", model.saasGuid()); + Assertions.assertEquals("debfqkkrbmpukgri", model.publisherId()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/LatestLinkedSaaSResponseInnerTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/LatestLinkedSaaSResponseInnerTests.java new file mode 100644 index 000000000000..5fc9334971c9 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/LatestLinkedSaaSResponseInnerTests.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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.LatestLinkedSaaSResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class LatestLinkedSaaSResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LatestLinkedSaaSResponseInner model + = BinaryData.fromString("{\"saaSResourceId\":\"xbf\",\"isHiddenSaaS\":true}") + .toObject(LatestLinkedSaaSResponseInner.class); + Assertions.assertEquals("xbf", model.saaSResourceId()); + Assertions.assertTrue(model.isHiddenSaaS()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/ManagedServiceIdentityTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..06f53fc6538b --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/ManagedServiceIdentityTests.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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"ujysvle\",\"tenantId\":\"vfqawrlyxwjkcpr\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"qguhmuo\":{\"principalId\":\"gjvtbv\",\"clientId\":\"sszdnru\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model + = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("qguhmuo", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + // 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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/MarketplaceDetailsTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/MarketplaceDetailsTests.java new file mode 100644 index 000000000000..be414a002a25 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.models.MarketplaceDetails; +import com.azure.resourcemanager.napsteromniagentapi.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\":\"cukjf\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"w\",\"offerDetails\":{\"publisherId\":\"klryplwck\",\"offerId\":\"asy\",\"planId\":\"nddhsgcbacph\",\"planName\":\"koty\",\"termUnit\":\"gou\",\"termId\":\"ndlik\"}}") + .toObject(MarketplaceDetails.class); + Assertions.assertEquals("cukjf", model.subscriptionId()); + Assertions.assertEquals("w", model.saasResourceId()); + Assertions.assertEquals("klryplwck", model.offerDetails().publisherId()); + Assertions.assertEquals("asy", model.offerDetails().offerId()); + Assertions.assertEquals("nddhsgcbacph", model.offerDetails().planId()); + Assertions.assertEquals("koty", model.offerDetails().planName()); + Assertions.assertEquals("gou", model.offerDetails().termUnit()); + Assertions.assertEquals("ndlik", model.offerDetails().termId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MarketplaceDetails model = new MarketplaceDetails().withSubscriptionId("cukjf") + .withSaasResourceId("w") + .withOfferDetails(new OfferDetails().withPublisherId("klryplwck") + .withOfferId("asy") + .withPlanId("nddhsgcbacph") + .withPlanName("koty") + .withTermUnit("gou") + .withTermId("ndlik")); + model = BinaryData.fromObject(model).toObject(MarketplaceDetails.class); + Assertions.assertEquals("cukjf", model.subscriptionId()); + Assertions.assertEquals("w", model.saasResourceId()); + Assertions.assertEquals("klryplwck", model.offerDetails().publisherId()); + Assertions.assertEquals("asy", model.offerDetails().offerId()); + Assertions.assertEquals("nddhsgcbacph", model.offerDetails().planId()); + Assertions.assertEquals("koty", model.offerDetails().planName()); + Assertions.assertEquals("gou", model.offerDetails().termUnit()); + Assertions.assertEquals("ndlik", model.offerDetails().termId()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OfferDetailsTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OfferDetailsTests.java new file mode 100644 index 000000000000..dca3b191c888 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.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\":\"yqkgfg\",\"offerId\":\"bmadgak\",\"planId\":\"s\",\"planName\":\"yb\",\"termUnit\":\"qedqytbciqfoufl\",\"termId\":\"nkzsmodmglou\"}") + .toObject(OfferDetails.class); + Assertions.assertEquals("yqkgfg", model.publisherId()); + Assertions.assertEquals("bmadgak", model.offerId()); + Assertions.assertEquals("s", model.planId()); + Assertions.assertEquals("yb", model.planName()); + Assertions.assertEquals("qedqytbciqfoufl", model.termUnit()); + Assertions.assertEquals("nkzsmodmglou", model.termId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfferDetails model = new OfferDetails().withPublisherId("yqkgfg") + .withOfferId("bmadgak") + .withPlanId("s") + .withPlanName("yb") + .withTermUnit("qedqytbciqfoufl") + .withTermId("nkzsmodmglou"); + model = BinaryData.fromObject(model).toObject(OfferDetails.class); + Assertions.assertEquals("yqkgfg", model.publisherId()); + Assertions.assertEquals("bmadgak", model.offerId()); + Assertions.assertEquals("s", model.planId()); + Assertions.assertEquals("yb", model.planName()); + Assertions.assertEquals("qedqytbciqfoufl", model.termUnit()); + Assertions.assertEquals("nkzsmodmglou", model.termId()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationDisplayTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..201982496559 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationInnerTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationInnerTests.java new file mode 100644 index 000000000000..ad5ac6281799 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationListResultTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationListResultTests.java new file mode 100644 index 000000000000..991b50241779 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationsListMockTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..765ac75e881d --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/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.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager; +import com.azure.resourcemanager.napsteromniagentapi.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\":\"gvtqagnbuynh\",\"isDataAction\":false,\"display\":{\"provider\":\"ebf\",\"resource\":\"arbu\",\"operation\":\"cvpnazzmhjrunmpx\",\"description\":\"dbhrbnlankxm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NapsterOmniagentApiManager manager = NapsterOmniagentApiManager.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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationPropertiesTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationPropertiesTests.java new file mode 100644 index 000000000000..4cf0e1ef8cad --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationPropertiesTests.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.models.MarketplaceDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OfferDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.PartnerProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnPropertiesV2; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +import com.azure.resourcemanager.napsteromniagentapi.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( + "{\"marketplace\":{\"subscriptionId\":\"rnfygxgispem\",\"subscriptionStatus\":\"Suspended\",\"saasResourceId\":\"kufubljo\",\"offerDetails\":{\"publisherId\":\"xqeofjaeqjhqjba\",\"offerId\":\"v\",\"planId\":\"mjqulngsn\",\"planName\":\"bybkzgcwrwclxx\",\"termUnit\":\"ljdousk\",\"termId\":\"vkocrcjdkwtn\"}},\"user\":{\"firstName\":\"bnjbiksqrglssain\",\"lastName\":\"jwnzlljfmp\",\"emailAddress\":\"ebvmgxsabkyqd\",\"upn\":\"jitcjczdzevn\",\"phoneNumber\":\"krwpdap\"},\"provisioningState\":\"Succeeded\",\"partnerProperties\":{\"application\":\"bdkvwrwjf\"},\"singleSignOnProperties\":{\"type\":\"Saml\",\"state\":\"Disable\",\"enterpriseAppId\":\"tjelt\",\"url\":\"ldhugjzzdatqxh\",\"aadDomains\":[\"geablgphuticndvk\",\"ozwyiftyhxhuro\",\"ftyxolniw\"]}}") + .toObject(OrganizationProperties.class); + Assertions.assertEquals("rnfygxgispem", model.marketplace().subscriptionId()); + Assertions.assertEquals("kufubljo", model.marketplace().saasResourceId()); + Assertions.assertEquals("xqeofjaeqjhqjba", model.marketplace().offerDetails().publisherId()); + Assertions.assertEquals("v", model.marketplace().offerDetails().offerId()); + Assertions.assertEquals("mjqulngsn", model.marketplace().offerDetails().planId()); + Assertions.assertEquals("bybkzgcwrwclxx", model.marketplace().offerDetails().planName()); + Assertions.assertEquals("ljdousk", model.marketplace().offerDetails().termUnit()); + Assertions.assertEquals("vkocrcjdkwtn", model.marketplace().offerDetails().termId()); + Assertions.assertEquals("bnjbiksqrglssain", model.user().firstName()); + Assertions.assertEquals("jwnzlljfmp", model.user().lastName()); + Assertions.assertEquals("ebvmgxsabkyqd", model.user().emailAddress()); + Assertions.assertEquals("jitcjczdzevn", model.user().upn()); + Assertions.assertEquals("krwpdap", model.user().phoneNumber()); + Assertions.assertEquals("bdkvwrwjf", model.partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.SAML, model.singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.DISABLE, model.singleSignOnProperties().state()); + Assertions.assertEquals("tjelt", model.singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("ldhugjzzdatqxh", model.singleSignOnProperties().url()); + Assertions.assertEquals("geablgphuticndvk", model.singleSignOnProperties().aadDomains().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationProperties model = new OrganizationProperties() + .withMarketplace(new MarketplaceDetails().withSubscriptionId("rnfygxgispem") + .withSaasResourceId("kufubljo") + .withOfferDetails(new OfferDetails().withPublisherId("xqeofjaeqjhqjba") + .withOfferId("v") + .withPlanId("mjqulngsn") + .withPlanName("bybkzgcwrwclxx") + .withTermUnit("ljdousk") + .withTermId("vkocrcjdkwtn"))) + .withUser(new UserDetails().withFirstName("bnjbiksqrglssain") + .withLastName("jwnzlljfmp") + .withEmailAddress("ebvmgxsabkyqd") + .withUpn("jitcjczdzevn") + .withPhoneNumber("krwpdap")) + .withPartnerProperties(new PartnerProperties().withApplication("bdkvwrwjf")) + .withSingleSignOnProperties(new SingleSignOnPropertiesV2().withType(SingleSignOnType.SAML) + .withState(SingleSignOnStates.DISABLE) + .withEnterpriseAppId("tjelt") + .withUrl("ldhugjzzdatqxh") + .withAadDomains(Arrays.asList("geablgphuticndvk", "ozwyiftyhxhuro", "ftyxolniw"))); + model = BinaryData.fromObject(model).toObject(OrganizationProperties.class); + Assertions.assertEquals("rnfygxgispem", model.marketplace().subscriptionId()); + Assertions.assertEquals("kufubljo", model.marketplace().saasResourceId()); + Assertions.assertEquals("xqeofjaeqjhqjba", model.marketplace().offerDetails().publisherId()); + Assertions.assertEquals("v", model.marketplace().offerDetails().offerId()); + Assertions.assertEquals("mjqulngsn", model.marketplace().offerDetails().planId()); + Assertions.assertEquals("bybkzgcwrwclxx", model.marketplace().offerDetails().planName()); + Assertions.assertEquals("ljdousk", model.marketplace().offerDetails().termUnit()); + Assertions.assertEquals("vkocrcjdkwtn", model.marketplace().offerDetails().termId()); + Assertions.assertEquals("bnjbiksqrglssain", model.user().firstName()); + Assertions.assertEquals("jwnzlljfmp", model.user().lastName()); + Assertions.assertEquals("ebvmgxsabkyqd", model.user().emailAddress()); + Assertions.assertEquals("jitcjczdzevn", model.user().upn()); + Assertions.assertEquals("krwpdap", model.user().phoneNumber()); + Assertions.assertEquals("bdkvwrwjf", model.partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.SAML, model.singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.DISABLE, model.singleSignOnProperties().state()); + Assertions.assertEquals("tjelt", model.singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("ldhugjzzdatqxh", model.singleSignOnProperties().url()); + Assertions.assertEquals("geablgphuticndvk", model.singleSignOnProperties().aadDomains().get(0)); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceInnerTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceInnerTests.java new file mode 100644 index 000000000000..f575611c5fbc --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceInnerTests.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.MarketplaceDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OfferDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.PartnerProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnPropertiesV2; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +import com.azure.resourcemanager.napsteromniagentapi.models.UserAssignedIdentity; +import com.azure.resourcemanager.napsteromniagentapi.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\":{\"marketplace\":{\"subscriptionId\":\"jbpzvgnwzsymg\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"cyzkohdbihanuf\",\"offerDetails\":{\"publisherId\":\"fcbjysagithxqha\",\"offerId\":\"ifpikxwczby\",\"planId\":\"npqxuh\",\"planName\":\"y\",\"termUnit\":\"iwbybrkxvdumjg\",\"termId\":\"fwvuk\"}},\"user\":{\"firstName\":\"audccsnhs\",\"lastName\":\"nyejhkryhtnap\",\"emailAddress\":\"wlokjyem\",\"upn\":\"vnipjox\",\"phoneNumber\":\"nchgej\"},\"provisioningState\":\"Failed\",\"partnerProperties\":{\"application\":\"dmailzydehojw\"},\"singleSignOnProperties\":{\"type\":\"OpenId\",\"state\":\"Initial\",\"enterpriseAppId\":\"npmqnjaqwixjspro\",\"url\":\"cputegjvwmfdats\",\"aadDomains\":[\"vpjhulsuuv\",\"kjozkrwfnd\",\"odjpslwejd\",\"vwryoqpso\"]}},\"identity\":{\"principalId\":\"tazak\",\"tenantId\":\"lahbcryff\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"hlxaolthqtr\":{\"principalId\":\"ygexpaojakhmsb\",\"clientId\":\"hcrzevd\"},\"tfell\":{\"principalId\":\"jbp\",\"clientId\":\"fsinzgvfcjrwzoxx\"}}},\"location\":\"fziton\",\"tags\":{\"vhpfxxypininmay\":\"fpjkjlxofp\",\"oginuvamiheognar\":\"uybbkpodep\"},\"id\":\"zxtheotusivyevcc\",\"name\":\"qi\",\"type\":\"nhungbw\"}") + .toObject(OrganizationResourceInner.class); + Assertions.assertEquals("fziton", model.location()); + Assertions.assertEquals("fpjkjlxofp", model.tags().get("vhpfxxypininmay")); + Assertions.assertEquals("jbpzvgnwzsymg", model.properties().marketplace().subscriptionId()); + Assertions.assertEquals("cyzkohdbihanuf", model.properties().marketplace().saasResourceId()); + Assertions.assertEquals("fcbjysagithxqha", model.properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("ifpikxwczby", model.properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("npqxuh", model.properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("y", model.properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("iwbybrkxvdumjg", model.properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("fwvuk", model.properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("audccsnhs", model.properties().user().firstName()); + Assertions.assertEquals("nyejhkryhtnap", model.properties().user().lastName()); + Assertions.assertEquals("wlokjyem", model.properties().user().emailAddress()); + Assertions.assertEquals("vnipjox", model.properties().user().upn()); + Assertions.assertEquals("nchgej", model.properties().user().phoneNumber()); + Assertions.assertEquals("dmailzydehojw", model.properties().partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.OPEN_ID, model.properties().singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.INITIAL, model.properties().singleSignOnProperties().state()); + Assertions.assertEquals("npmqnjaqwixjspro", model.properties().singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("cputegjvwmfdats", model.properties().singleSignOnProperties().url()); + Assertions.assertEquals("vpjhulsuuv", model.properties().singleSignOnProperties().aadDomains().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationResourceInner model = new OrganizationResourceInner().withLocation("fziton") + .withTags(mapOf("vhpfxxypininmay", "fpjkjlxofp", "oginuvamiheognar", "uybbkpodep")) + .withProperties(new OrganizationProperties() + .withMarketplace(new MarketplaceDetails().withSubscriptionId("jbpzvgnwzsymg") + .withSaasResourceId("cyzkohdbihanuf") + .withOfferDetails(new OfferDetails().withPublisherId("fcbjysagithxqha") + .withOfferId("ifpikxwczby") + .withPlanId("npqxuh") + .withPlanName("y") + .withTermUnit("iwbybrkxvdumjg") + .withTermId("fwvuk"))) + .withUser(new UserDetails().withFirstName("audccsnhs") + .withLastName("nyejhkryhtnap") + .withEmailAddress("wlokjyem") + .withUpn("vnipjox") + .withPhoneNumber("nchgej")) + .withPartnerProperties(new PartnerProperties().withApplication("dmailzydehojw")) + .withSingleSignOnProperties(new SingleSignOnPropertiesV2().withType(SingleSignOnType.OPEN_ID) + .withState(SingleSignOnStates.INITIAL) + .withEnterpriseAppId("npmqnjaqwixjspro") + .withUrl("cputegjvwmfdats") + .withAadDomains(Arrays.asList("vpjhulsuuv", "kjozkrwfnd", "odjpslwejd", "vwryoqpso")))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities( + mapOf("hlxaolthqtr", new UserAssignedIdentity(), "tfell", new UserAssignedIdentity()))); + model = BinaryData.fromObject(model).toObject(OrganizationResourceInner.class); + Assertions.assertEquals("fziton", model.location()); + Assertions.assertEquals("fpjkjlxofp", model.tags().get("vhpfxxypininmay")); + Assertions.assertEquals("jbpzvgnwzsymg", model.properties().marketplace().subscriptionId()); + Assertions.assertEquals("cyzkohdbihanuf", model.properties().marketplace().saasResourceId()); + Assertions.assertEquals("fcbjysagithxqha", model.properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("ifpikxwczby", model.properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("npqxuh", model.properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("y", model.properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("iwbybrkxvdumjg", model.properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("fwvuk", model.properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("audccsnhs", model.properties().user().firstName()); + Assertions.assertEquals("nyejhkryhtnap", model.properties().user().lastName()); + Assertions.assertEquals("wlokjyem", model.properties().user().emailAddress()); + Assertions.assertEquals("vnipjox", model.properties().user().upn()); + Assertions.assertEquals("nchgej", model.properties().user().phoneNumber()); + Assertions.assertEquals("dmailzydehojw", model.properties().partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.OPEN_ID, model.properties().singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.INITIAL, model.properties().singleSignOnProperties().state()); + Assertions.assertEquals("npmqnjaqwixjspro", model.properties().singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("cputegjvwmfdats", model.properties().singleSignOnProperties().url()); + Assertions.assertEquals("vpjhulsuuv", model.properties().singleSignOnProperties().aadDomains().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + } + + // 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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceListResultTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceListResultTests.java new file mode 100644 index 000000000000..41799de98e04 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceListResultTests.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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.implementation.models.OrganizationResourceListResult; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +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\":{\"marketplace\":{\"subscriptionId\":\"bnmo\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"shurzafbljjgpbto\",\"offerDetails\":{\"publisherId\":\"c\",\"offerId\":\"mkljavb\",\"planId\":\"dtqajzyulpkudj\",\"planName\":\"lkhbz\",\"termUnit\":\"epgzgqexz\",\"termId\":\"c\"}},\"user\":{\"firstName\":\"c\",\"lastName\":\"ierhhbcsglummaj\",\"emailAddress\":\"aodxo\",\"upn\":\"bdxkqpxokaj\",\"phoneNumber\":\"npime\"},\"provisioningState\":\"Canceled\",\"partnerProperties\":{\"application\":\"txgcpodgmaajr\"},\"singleSignOnProperties\":{\"type\":\"Saml\",\"state\":\"Enable\",\"enterpriseAppId\":\"rlovmclwhijcoej\",\"url\":\"bzaqsqsycbkbfk\",\"aadDomains\":[\"dkexxppofm\",\"axcfjpgddtocjjx\"]}},\"identity\":{\"principalId\":\"mouexhdzx\",\"tenantId\":\"qeojnxqbzvddntw\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"glmjth\":{\"principalId\":\"btwnpzaoqvuhrhcf\",\"clientId\":\"yd\"},\"uigdtopbobjog\":{\"principalId\":\"kw\",\"clientId\":\"eicxmqciwqvhkhi\"},\"a\":{\"principalId\":\"e\",\"clientId\":\"a\"}}},\"location\":\"rzayv\",\"tags\":{\"ln\":\"gvdfgiotkftutq\",\"qmi\":\"xlefgugnxkrx\"},\"id\":\"tthzrvqd\",\"name\":\"abhjybi\",\"type\":\"ehoqfbowskan\"},{\"properties\":{\"marketplace\":{\"subscriptionId\":\"zlcuiywgqywgndrv\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"gpphrcgyn\",\"offerDetails\":{\"publisherId\":\"ocpecfvmmco\",\"offerId\":\"fsxlzevgbmqjqa\",\"planId\":\"y\",\"planName\":\"ivkwlzuvccfwnfnb\",\"termUnit\":\"fionl\",\"termId\":\"x\"}},\"user\":{\"firstName\":\"qgtz\",\"lastName\":\"pnqbqqwxrjfe\",\"emailAddress\":\"lnwsubisn\",\"upn\":\"mpmngnzscxaqwoo\",\"phoneNumber\":\"cbonqvpk\"},\"provisioningState\":\"Failed\",\"partnerProperties\":{\"application\":\"xnj\"},\"singleSignOnProperties\":{\"type\":\"Saml\",\"state\":\"Initial\",\"enterpriseAppId\":\"heoflokeyyienjbd\",\"url\":\"tgrhpdjpjumas\",\"aadDomains\":[\"jpqyegu\"]}},\"identity\":{\"principalId\":\"b\",\"tenantId\":\"hejjz\",\"type\":\"None\",\"userAssignedIdentities\":{\"cftadeh\":{\"principalId\":\"gwdslfhotwm\",\"clientId\":\"npwlbjnpg\"},\"ej\":{\"principalId\":\"ltyfsop\",\"clientId\":\"suesnzw\"},\"ndnvo\":{\"principalId\":\"vorxzdmohct\",\"clientId\":\"vudwx\"}}},\"location\":\"ujjugwdkcglh\",\"tags\":{\"yggdtjixh\":\"zj\",\"evfyexfwhybcib\":\"kuofqweykhme\"},\"id\":\"yvdcsitynnaa\",\"name\":\"dectehfiqsc\",\"type\":\"eypvhezrkg\"},{\"properties\":{\"marketplace\":{\"subscriptionId\":\"jrefovgmkqsle\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"yqjpkcatt\",\"offerDetails\":{\"publisherId\":\"ngj\",\"offerId\":\"rcczsqpjhvmd\",\"planId\":\"v\",\"planName\":\"sounqecanoaeu\",\"termUnit\":\"hy\",\"termId\":\"trpmo\"}},\"user\":{\"firstName\":\"mcmatuokthfuiu\",\"lastName\":\"dsfcpkvxodpuoz\",\"emailAddress\":\"zydagfuaxbezyiuo\",\"upn\":\"twhrdxwzywqsm\",\"phoneNumber\":\"ureximoryocfs\"},\"provisioningState\":\"Failed\",\"partnerProperties\":{\"application\":\"ymddys\"},\"singleSignOnProperties\":{\"type\":\"Saml\",\"state\":\"Initial\",\"enterpriseAppId\":\"hqyudxorrqnbpoc\",\"url\":\"yifqrvkdvjsllrmv\",\"aadDomains\":[\"watkpnpulexxb\"]}},\"identity\":{\"principalId\":\"truwiqzb\",\"tenantId\":\"vsovmyokac\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ajiwkuo\":{\"principalId\":\"hzdobpxjmflbvvnc\",\"clientId\":\"kcciwwzjuqkhr\"}}},\"location\":\"skghsauuimj\",\"tags\":{\"ugidyjrr\":\"ied\",\"v\":\"byao\",\"onpc\":\"xc\",\"eggzfb\":\"hocohslkev\"},\"id\":\"hfmvfaxkffe\",\"name\":\"ithlvmezyvshxm\",\"type\":\"sbbzo\"},{\"properties\":{\"marketplace\":{\"subscriptionId\":\"grxwbu\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"xjnspy\",\"offerDetails\":{\"publisherId\":\"ptkoenkoukn\",\"offerId\":\"udwtiukbl\",\"planId\":\"gkpocipazyxoe\",\"planName\":\"kgjn\",\"termUnit\":\"ucgygevqz\",\"termId\":\"yp\"}},\"user\":{\"firstName\":\"bpizcdrqjsdpydn\",\"lastName\":\"hxdeoejz\",\"emailAddress\":\"w\",\"upn\":\"sjttgzfbish\",\"phoneNumber\":\"khaj\"},\"provisioningState\":\"Failed\",\"partnerProperties\":{\"application\":\"eamdp\"},\"singleSignOnProperties\":{\"type\":\"Saml\",\"state\":\"Enable\",\"enterpriseAppId\":\"buxwgip\",\"url\":\"onowk\",\"aadDomains\":[\"wankixzbi\",\"jeputtmrywn\",\"zoqftiyqzrnkcqvy\",\"lwh\"]}},\"identity\":{\"principalId\":\"icohoqqnwvl\",\"tenantId\":\"avwhheunm\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"szfkbe\":{\"principalId\":\"xzko\",\"clientId\":\"cukoklyaxuconu\"},\"frzpwvlqdqgb\":{\"principalId\":\"ewrmjmwvvjektc\",\"clientId\":\"enhwlrs\"}}},\"location\":\"ylihkaetckt\",\"tags\":{\"m\":\"ivfsnk\",\"jf\":\"ctq\",\"fuwutttxf\":\"ebrjcxe\",\"hfnljkyq\":\"jrbirphxepcyv\"},\"id\":\"j\",\"name\":\"uujqgidokgjljyo\",\"type\":\"gvcl\"}],\"nextLink\":\"gsncghkjeszz\"}") + .toObject(OrganizationResourceListResult.class); + Assertions.assertEquals("rzayv", model.value().get(0).location()); + Assertions.assertEquals("gvdfgiotkftutq", model.value().get(0).tags().get("ln")); + Assertions.assertEquals("bnmo", model.value().get(0).properties().marketplace().subscriptionId()); + Assertions.assertEquals("shurzafbljjgpbto", model.value().get(0).properties().marketplace().saasResourceId()); + Assertions.assertEquals("c", model.value().get(0).properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("mkljavb", model.value().get(0).properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("dtqajzyulpkudj", + model.value().get(0).properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("lkhbz", model.value().get(0).properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("epgzgqexz", model.value().get(0).properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("c", model.value().get(0).properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("c", model.value().get(0).properties().user().firstName()); + Assertions.assertEquals("ierhhbcsglummaj", model.value().get(0).properties().user().lastName()); + Assertions.assertEquals("aodxo", model.value().get(0).properties().user().emailAddress()); + Assertions.assertEquals("bdxkqpxokaj", model.value().get(0).properties().user().upn()); + Assertions.assertEquals("npime", model.value().get(0).properties().user().phoneNumber()); + Assertions.assertEquals("txgcpodgmaajr", model.value().get(0).properties().partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.SAML, + model.value().get(0).properties().singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.ENABLE, + model.value().get(0).properties().singleSignOnProperties().state()); + Assertions.assertEquals("rlovmclwhijcoej", + model.value().get(0).properties().singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("bzaqsqsycbkbfk", model.value().get(0).properties().singleSignOnProperties().url()); + Assertions.assertEquals("dkexxppofm", + model.value().get(0).properties().singleSignOnProperties().aadDomains().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("gsncghkjeszz", model.nextLink()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceUpdateTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceUpdateTests.java new file mode 100644 index 000000000000..9b8444cc3fa0 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationResourceUpdateTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResourceUpdate; +import com.azure.resourcemanager.napsteromniagentapi.models.UserAssignedIdentity; +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\":{\"x\":\"zga\",\"hr\":\"fizuckyf\"},\"identity\":{\"principalId\":\"fvzwdzuhty\",\"tenantId\":\"isdkfthwxmnteiw\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ezcxtbzsgfyccsne\":{\"principalId\":\"mijcmmxdcufufs\",\"clientId\":\"ymzidn\"},\"osfqpteehzzv\":{\"principalId\":\"dwzjeiach\",\"clientId\":\"osfln\"},\"dqxhcrmnohjtckwh\":{\"principalId\":\"yqrimzin\",\"clientId\":\"swjdkirso\"},\"vsnb\":{\"principalId\":\"oifiyipjxsqwpgr\",\"clientId\":\"znorcj\"}}}}") + .toObject(OrganizationResourceUpdate.class); + Assertions.assertEquals("zga", model.tags().get("x")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationResourceUpdate model + = new OrganizationResourceUpdate().withTags(mapOf("x", "zga", "hr", "fizuckyf")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("ezcxtbzsgfyccsne", new UserAssignedIdentity(), "osfqpteehzzv", + new UserAssignedIdentity(), "dqxhcrmnohjtckwh", new UserAssignedIdentity(), "vsnb", + new UserAssignedIdentity()))); + model = BinaryData.fromObject(model).toObject(OrganizationResourceUpdate.class); + Assertions.assertEquals("zga", model.tags().get("x")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + } + + // 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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsCreateOrUpdateMockTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..bc7d1fc796a4 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsCreateOrUpdateMockTests.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.MarketplaceDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OfferDetails; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResource; +import com.azure.resourcemanager.napsteromniagentapi.models.PartnerProperties; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnPropertiesV2; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +import com.azure.resourcemanager.napsteromniagentapi.models.UserAssignedIdentity; +import com.azure.resourcemanager.napsteromniagentapi.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 OrganizationsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"marketplace\":{\"subscriptionId\":\"xvy\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"kopkwhojvpajqgx\",\"offerDetails\":{\"publisherId\":\"smocmbq\",\"offerId\":\"qvmkcxo\",\"planId\":\"pvhelxprg\",\"planName\":\"atddc\",\"termUnit\":\"bcuejrjxgci\",\"termId\":\"brh\"}},\"user\":{\"firstName\":\"xsdqrhzoymibmrqy\",\"lastName\":\"ahwfluszdtmhrk\",\"emailAddress\":\"fyyvoq\",\"upn\":\"piexpbtgiw\",\"phoneNumber\":\"oenwashr\"},\"provisioningState\":\"Succeeded\",\"partnerProperties\":{\"application\":\"kcnqxwbpo\"},\"singleSignOnProperties\":{\"type\":\"Saml\",\"state\":\"Enable\",\"enterpriseAppId\":\"jwaa\",\"url\":\"pqiiobyuqe\",\"aadDomains\":[\"lp\",\"wcciuqgbdbu\",\"auvfbtkuwhhmhyk\"]}},\"identity\":{\"principalId\":\"xafnndlpichko\",\"tenantId\":\"kcdyhbpk\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"s\":{\"principalId\":\"eqnovvqfovl\",\"clientId\":\"ywsuwsy\"},\"nzar\":{\"principalId\":\"sytgadgvraea\",\"clientId\":\"e\"},\"iftohqkvpu\":{\"principalId\":\"lquuijfqkacewii\",\"clientId\":\"pubjibw\"}}},\"location\":\"sgplsakn\",\"tags\":{\"iyntorzihle\":\"synljphuopxodl\",\"yzrpzbchckqqzq\":\"sjswsrms\",\"ysuiizynkedya\":\"ox\"},\"id\":\"rwyhqmibzyhwitsm\",\"name\":\"pyy\",\"type\":\"pcdpumnz\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NapsterOmniagentApiManager manager = NapsterOmniagentApiManager.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("vwiwubmwmbesld") + .withRegion("dldwmgxc") + .withExistingResourceGroup("mwabnetshhszhedp") + .withTags(mapOf("niyqslui", "lpmutwuoegrpkhj", "mpaxmodfvuefywsb", "pdggkzzlvm", "rfouyftaakcpw", "fvmwy")) + .withProperties(new OrganizationProperties() + .withMarketplace(new MarketplaceDetails().withSubscriptionId("wtppjflcxogaoko") + .withSaasResourceId("sikvmkqzeqqkdlt") + .withOfferDetails(new OfferDetails().withPublisherId("zxmhhvhgu") + .withOfferId("eodkwobda") + .withPlanId("tibqdxbxwakb") + .withPlanName("qxn") + .withTermUnit("kzgxhurip") + .withTermId("podxunkb"))) + .withUser(new UserDetails().withFirstName("xmubyyntwlrbq") + .withLastName("oievseotgqrlltm") + .withEmailAddress("lauwzizxbmpgcjef") + .withUpn("muvp") + .withPhoneNumber("tdum")) + .withPartnerProperties(new PartnerProperties().withApplication("pxebmnzbt")) + .withSingleSignOnProperties(new SingleSignOnPropertiesV2().withType(SingleSignOnType.OPEN_ID) + .withState(SingleSignOnStates.INITIAL) + .withEnterpriseAppId("kfgohdneue") + .withUrl("phsdyhto") + .withAadDomains(Arrays.asList("kd", "wwquuvxzxclvithh", "zonosgg")))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("ewkfvhqcrai", new UserAssignedIdentity(), "gafcnihgwqapnedg", + new UserAssignedIdentity(), "pcjwv", new UserAssignedIdentity()))) + .create(); + + Assertions.assertEquals("sgplsakn", response.location()); + Assertions.assertEquals("synljphuopxodl", response.tags().get("iyntorzihle")); + Assertions.assertEquals("xvy", response.properties().marketplace().subscriptionId()); + Assertions.assertEquals("kopkwhojvpajqgx", response.properties().marketplace().saasResourceId()); + Assertions.assertEquals("smocmbq", response.properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("qvmkcxo", response.properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("pvhelxprg", response.properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("atddc", response.properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("bcuejrjxgci", response.properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("brh", response.properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("xsdqrhzoymibmrqy", response.properties().user().firstName()); + Assertions.assertEquals("ahwfluszdtmhrk", response.properties().user().lastName()); + Assertions.assertEquals("fyyvoq", response.properties().user().emailAddress()); + Assertions.assertEquals("piexpbtgiw", response.properties().user().upn()); + Assertions.assertEquals("oenwashr", response.properties().user().phoneNumber()); + Assertions.assertEquals("kcnqxwbpo", response.properties().partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.SAML, response.properties().singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.ENABLE, response.properties().singleSignOnProperties().state()); + Assertions.assertEquals("jwaa", response.properties().singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("pqiiobyuqe", response.properties().singleSignOnProperties().url()); + Assertions.assertEquals("lp", response.properties().singleSignOnProperties().aadDomains().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); + } + + // 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/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..01168d02e2f2 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResource; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +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\":{\"marketplace\":{\"subscriptionId\":\"axdbabph\",\"subscriptionStatus\":\"Unsubscribed\",\"saasResourceId\":\"lfktsths\",\"offerDetails\":{\"publisherId\":\"cocmnyyaztt\",\"offerId\":\"twwrqp\",\"planId\":\"dckzywbiexz\",\"planName\":\"yueaxibxujwb\",\"termUnit\":\"walm\",\"termId\":\"yoxa\"}},\"user\":{\"firstName\":\"dkzjancuxrh\",\"lastName\":\"bavxbniwdjswzt\",\"emailAddress\":\"bpg\",\"upn\":\"ytxhp\",\"phoneNumber\":\"bzpfzab\"},\"provisioningState\":\"Failed\",\"partnerProperties\":{\"application\":\"uhxwtctyqiklbbov\"},\"singleSignOnProperties\":{\"type\":\"OpenId\",\"state\":\"Enable\",\"enterpriseAppId\":\"vgyuguos\",\"url\":\"kfssxqukkf\",\"aadDomains\":[\"mg\",\"xnkjzkdesl\",\"vlopwiyighx\"]}},\"identity\":{\"principalId\":\"wzbaiue\",\"tenantId\":\"a\",\"type\":\"None\",\"userAssignedIdentities\":{\"pskrdqmh\":{\"principalId\":\"upedeojnabckhs\",\"clientId\":\"xpsiebtfhvpes\"},\"scwsv\":{\"principalId\":\"dhtldwkyz\",\"clientId\":\"utknc\"},\"kvceoveilovnotyf\":{\"principalId\":\"otogtwrupqs\",\"clientId\":\"nmic\"},\"oqnermclfpl\":{\"principalId\":\"cnjbkcnxdhbt\",\"clientId\":\"phywpnvj\"}}},\"location\":\"oxuscrpabgyepsbj\",\"tags\":{\"kqujidsuyono\":\"qugxywpmueefjzwf\"},\"id\":\"glaocq\",\"name\":\"tcc\",\"type\":\"g\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NapsterOmniagentApiManager manager = NapsterOmniagentApiManager.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("henbtkcxywnytn", "synlqidybyxczfc", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("oxuscrpabgyepsbj", response.location()); + Assertions.assertEquals("qugxywpmueefjzwf", response.tags().get("kqujidsuyono")); + Assertions.assertEquals("axdbabph", response.properties().marketplace().subscriptionId()); + Assertions.assertEquals("lfktsths", response.properties().marketplace().saasResourceId()); + Assertions.assertEquals("cocmnyyaztt", response.properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("twwrqp", response.properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("dckzywbiexz", response.properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("yueaxibxujwb", response.properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("walm", response.properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("yoxa", response.properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("dkzjancuxrh", response.properties().user().firstName()); + Assertions.assertEquals("bavxbniwdjswzt", response.properties().user().lastName()); + Assertions.assertEquals("bpg", response.properties().user().emailAddress()); + Assertions.assertEquals("ytxhp", response.properties().user().upn()); + Assertions.assertEquals("bzpfzab", response.properties().user().phoneNumber()); + Assertions.assertEquals("uhxwtctyqiklbbov", response.properties().partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.OPEN_ID, response.properties().singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.ENABLE, response.properties().singleSignOnProperties().state()); + Assertions.assertEquals("vgyuguos", response.properties().singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("kfssxqukkf", response.properties().singleSignOnProperties().url()); + Assertions.assertEquals("mg", response.properties().singleSignOnProperties().aadDomains().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLatestLinkedSaaSWithResponseMockTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLatestLinkedSaaSWithResponseMockTests.java new file mode 100644 index 000000000000..98b61968aba2 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLatestLinkedSaaSWithResponseMockTests.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.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager; +import com.azure.resourcemanager.napsteromniagentapi.models.LatestLinkedSaaSResponse; +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 OrganizationsLatestLinkedSaaSWithResponseMockTests { + @Test + public void testLatestLinkedSaaSWithResponse() throws Exception { + String responseStr = "{\"saaSResourceId\":\"mweriofzpy\",\"isHiddenSaaS\":false}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NapsterOmniagentApiManager manager = NapsterOmniagentApiManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + LatestLinkedSaaSResponse response = manager.organizations() + .latestLinkedSaaSWithResponse("erscdntne", "fiwjmygtdssls", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("mweriofzpy", response.saaSResourceId()); + Assertions.assertFalse(response.isHiddenSaaS()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLinkSaaSMockTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLinkSaaSMockTests.java new file mode 100644 index 000000000000..885c8b45abc6 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsLinkSaaSMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResource; +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSData; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +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 OrganizationsLinkSaaSMockTests { + @Test + public void testLinkSaaS() throws Exception { + String responseStr + = "{\"properties\":{\"marketplace\":{\"subscriptionId\":\"fqbuaceopzf\",\"subscriptionStatus\":\"Subscribed\",\"saasResourceId\":\"uaopppcqeq\",\"offerDetails\":{\"publisherId\":\"ol\",\"offerId\":\"dahzxctobg\",\"planId\":\"dmoizpostmg\",\"planName\":\"fbunrmfqjhhk\",\"termUnit\":\"pvjymjhxxjyng\",\"termId\":\"ivkrtsw\"}},\"user\":{\"firstName\":\"qzvszjf\",\"lastName\":\"vjfdx\",\"emailAddress\":\"vetvt\",\"upn\":\"aqtdoqmcbx\",\"phoneNumber\":\"vxysl\"},\"provisioningState\":\"Succeeded\",\"partnerProperties\":{\"application\":\"sfxobl\"},\"singleSignOnProperties\":{\"type\":\"Saml\",\"state\":\"Disable\",\"enterpriseAppId\":\"pe\",\"url\":\"wfbkrvrns\",\"aadDomains\":[\"q\",\"ohxcrsbfova\",\"rruvwbhsq\",\"sub\"]}},\"identity\":{\"principalId\":\"birx\",\"tenantId\":\"ybsrfbjfdtwss\",\"type\":\"None\",\"userAssignedIdentities\":{\"q\":{\"principalId\":\"vjz\",\"clientId\":\"xilzznf\"},\"jrybnwjewgdrjer\":{\"principalId\":\"wpmqt\",\"clientId\":\"uoujmkcjhwqy\"},\"ndoygmifthnzdnd\":{\"principalId\":\"aen\",\"clientId\":\"eh\"},\"bgycduiertgccym\":{\"principalId\":\"gnayqigynduh\",\"clientId\":\"hqlkthumaqo\"}}},\"location\":\"olpsslqlf\",\"tags\":{\"bglzpswi\":\"n\",\"cwyhzdxssa\":\"d\",\"od\":\"bzmnvdfznud\"},\"id\":\"xzb\",\"name\":\"cblylpstdbhhxsr\",\"type\":\"dzu\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NapsterOmniagentApiManager manager = NapsterOmniagentApiManager.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() + .linkSaaS("t", "oellwp", new SaaSData().withSaaSResourceId("d"), com.azure.core.util.Context.NONE); + + Assertions.assertEquals("olpsslqlf", response.location()); + Assertions.assertEquals("n", response.tags().get("bglzpswi")); + Assertions.assertEquals("fqbuaceopzf", response.properties().marketplace().subscriptionId()); + Assertions.assertEquals("uaopppcqeq", response.properties().marketplace().saasResourceId()); + Assertions.assertEquals("ol", response.properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("dahzxctobg", response.properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("dmoizpostmg", response.properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("fbunrmfqjhhk", response.properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("pvjymjhxxjyng", response.properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("ivkrtsw", response.properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("qzvszjf", response.properties().user().firstName()); + Assertions.assertEquals("vjfdx", response.properties().user().lastName()); + Assertions.assertEquals("vetvt", response.properties().user().emailAddress()); + Assertions.assertEquals("aqtdoqmcbx", response.properties().user().upn()); + Assertions.assertEquals("vxysl", response.properties().user().phoneNumber()); + Assertions.assertEquals("sfxobl", response.properties().partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.SAML, response.properties().singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.DISABLE, response.properties().singleSignOnProperties().state()); + Assertions.assertEquals("pe", response.properties().singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("wfbkrvrns", response.properties().singleSignOnProperties().url()); + Assertions.assertEquals("q", response.properties().singleSignOnProperties().aadDomains().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListByResourceGroupMockTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListByResourceGroupMockTests.java new file mode 100644 index 000000000000..048ba062f491 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListByResourceGroupMockTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResource; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +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\":{\"marketplace\":{\"subscriptionId\":\"u\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"ntxhdzhlrqjbhck\",\"offerDetails\":{\"publisherId\":\"rlhrxs\",\"offerId\":\"kyv\",\"planId\":\"ca\",\"planName\":\"z\",\"termUnit\":\"zka\",\"termId\":\"uwbc\"}},\"user\":{\"firstName\":\"wbme\",\"lastName\":\"seyvj\",\"emailAddress\":\"rts\",\"upn\":\"spkdee\",\"phoneNumber\":\"ofmxagkvtmelmqkr\"},\"provisioningState\":\"Succeeded\",\"partnerProperties\":{\"application\":\"vljua\"},\"singleSignOnProperties\":{\"type\":\"OpenId\",\"state\":\"Disable\",\"enterpriseAppId\":\"dhmdua\",\"url\":\"exq\",\"aadDomains\":[\"adm\",\"sr\"]}},\"identity\":{\"principalId\":\"vxpvgomz\",\"tenantId\":\"misgwbnb\",\"type\":\"None\",\"userAssignedIdentities\":{\"uhashsfwx\":{\"principalId\":\"wkz\",\"clientId\":\"liourqhak\"},\"ovbvmeueciv\":{\"principalId\":\"owzxcu\",\"clientId\":\"cjooxdjebwpucwwf\"},\"it\":{\"principalId\":\"zceuojgjrw\",\"clientId\":\"eiotwmcdytdx\"}}},\"location\":\"rjaw\",\"tags\":{\"fbkp\":\"gxhnisk\",\"lwn\":\"cg\"},\"id\":\"nhjdauw\",\"name\":\"vylwzbtdhxuj\",\"type\":\"nbmpowuwprzq\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NapsterOmniagentApiManager manager = NapsterOmniagentApiManager.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("udxytlmoyrx", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("rjaw", response.iterator().next().location()); + Assertions.assertEquals("gxhnisk", response.iterator().next().tags().get("fbkp")); + Assertions.assertEquals("u", response.iterator().next().properties().marketplace().subscriptionId()); + Assertions.assertEquals("ntxhdzhlrqjbhck", + response.iterator().next().properties().marketplace().saasResourceId()); + Assertions.assertEquals("rlhrxs", + response.iterator().next().properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("kyv", response.iterator().next().properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("ca", response.iterator().next().properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("z", response.iterator().next().properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("zka", response.iterator().next().properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("uwbc", response.iterator().next().properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("wbme", response.iterator().next().properties().user().firstName()); + Assertions.assertEquals("seyvj", response.iterator().next().properties().user().lastName()); + Assertions.assertEquals("rts", response.iterator().next().properties().user().emailAddress()); + Assertions.assertEquals("spkdee", response.iterator().next().properties().user().upn()); + Assertions.assertEquals("ofmxagkvtmelmqkr", response.iterator().next().properties().user().phoneNumber()); + Assertions.assertEquals("vljua", response.iterator().next().properties().partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.OPEN_ID, + response.iterator().next().properties().singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.DISABLE, + response.iterator().next().properties().singleSignOnProperties().state()); + Assertions.assertEquals("dhmdua", + response.iterator().next().properties().singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("exq", response.iterator().next().properties().singleSignOnProperties().url()); + Assertions.assertEquals("adm", + response.iterator().next().properties().singleSignOnProperties().aadDomains().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListMockTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListMockTests.java new file mode 100644 index 000000000000..02c2b8a6d333 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/OrganizationsListMockTests.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.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager; +import com.azure.resourcemanager.napsteromniagentapi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.napsteromniagentapi.models.OrganizationResource; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +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\":{\"marketplace\":{\"subscriptionId\":\"ualupjmkh\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"saasResourceId\":\"bcswsrt\",\"offerDetails\":{\"publisherId\":\"riplrbpbewtg\",\"offerId\":\"fgb\",\"planId\":\"gw\",\"planName\":\"vlvqhjkbegi\",\"termUnit\":\"nmxiebwwaloayqc\",\"termId\":\"rtzju\"}},\"user\":{\"firstName\":\"wyzmhtxon\",\"lastName\":\"ts\",\"emailAddress\":\"jcbpwxqpsrknft\",\"upn\":\"vriuhprwmdyvx\",\"phoneNumber\":\"ayriwwroyqbexrm\"},\"provisioningState\":\"Failed\",\"partnerProperties\":{\"application\":\"bycnojvkn\"},\"singleSignOnProperties\":{\"type\":\"OpenId\",\"state\":\"Enable\",\"enterpriseAppId\":\"zvahapjy\",\"url\":\"pvgqzcjrvxdjzlm\",\"aadDomains\":[\"kvugfhzovawjvzun\",\"uthnnprnxipeilpj\",\"uaejxdultsk\"]}},\"identity\":{\"principalId\":\"tdzumveekgpw\",\"tenantId\":\"uh\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"elnsmvbxw\":{\"principalId\":\"jyofdxluusdtto\",\"clientId\":\"aboekqv\"},\"ixisxyawjoy\":{\"principalId\":\"sflhhca\",\"clientId\":\"n\"}}},\"location\":\"cslyjpk\",\"tags\":{\"lixhnrztfol\":\"zyexzn\",\"dtpnapnyiropuhp\":\"bnxknalaulppg\",\"gqgitxmedjvcsl\":\"gvpgy\"},\"id\":\"n\",\"name\":\"wwncwzzhxgk\",\"type\":\"rmgucnap\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NapsterOmniagentApiManager manager = NapsterOmniagentApiManager.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("cslyjpk", response.iterator().next().location()); + Assertions.assertEquals("zyexzn", response.iterator().next().tags().get("lixhnrztfol")); + Assertions.assertEquals("ualupjmkh", response.iterator().next().properties().marketplace().subscriptionId()); + Assertions.assertEquals("bcswsrt", response.iterator().next().properties().marketplace().saasResourceId()); + Assertions.assertEquals("riplrbpbewtg", + response.iterator().next().properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("fgb", response.iterator().next().properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("gw", response.iterator().next().properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("vlvqhjkbegi", + response.iterator().next().properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("nmxiebwwaloayqc", + response.iterator().next().properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("rtzju", response.iterator().next().properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("wyzmhtxon", response.iterator().next().properties().user().firstName()); + Assertions.assertEquals("ts", response.iterator().next().properties().user().lastName()); + Assertions.assertEquals("jcbpwxqpsrknft", response.iterator().next().properties().user().emailAddress()); + Assertions.assertEquals("vriuhprwmdyvx", response.iterator().next().properties().user().upn()); + Assertions.assertEquals("ayriwwroyqbexrm", response.iterator().next().properties().user().phoneNumber()); + Assertions.assertEquals("bycnojvkn", response.iterator().next().properties().partnerProperties().application()); + Assertions.assertEquals(SingleSignOnType.OPEN_ID, + response.iterator().next().properties().singleSignOnProperties().type()); + Assertions.assertEquals(SingleSignOnStates.ENABLE, + response.iterator().next().properties().singleSignOnProperties().state()); + Assertions.assertEquals("zvahapjy", + response.iterator().next().properties().singleSignOnProperties().enterpriseAppId()); + Assertions.assertEquals("pvgqzcjrvxdjzlm", + response.iterator().next().properties().singleSignOnProperties().url()); + Assertions.assertEquals("kvugfhzovawjvzun", + response.iterator().next().properties().singleSignOnProperties().aadDomains().get(0)); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/PartnerPropertiesTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/PartnerPropertiesTests.java new file mode 100644 index 000000000000..3673e579ef60 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/PartnerPropertiesTests.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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.models.PartnerProperties; +import org.junit.jupiter.api.Assertions; + +public final class PartnerPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PartnerProperties model + = BinaryData.fromString("{\"application\":\"mbmbexppbh\"}").toObject(PartnerProperties.class); + Assertions.assertEquals("mbmbexppbh", model.application()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PartnerProperties model = new PartnerProperties().withApplication("mbmbexppbh"); + model = BinaryData.fromObject(model).toObject(PartnerProperties.class); + Assertions.assertEquals("mbmbexppbh", model.application()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSDataTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSDataTests.java new file mode 100644 index 000000000000..d38640fc5522 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSDataTests.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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.models.SaaSData; +import org.junit.jupiter.api.Assertions; + +public final class SaaSDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SaaSData model = BinaryData.fromString("{\"saaSResourceId\":\"ijhtxf\"}").toObject(SaaSData.class); + Assertions.assertEquals("ijhtxf", model.saaSResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SaaSData model = new SaaSData().withSaaSResourceId("ijhtxf"); + model = BinaryData.fromObject(model).toObject(SaaSData.class); + Assertions.assertEquals("ijhtxf", model.saaSResourceId()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSOperationGroupsActivateResourceMockTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSOperationGroupsActivateResourceMockTests.java new file mode 100644 index 000000000000..8f43aa7f309d --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSOperationGroupsActivateResourceMockTests.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.napsteromniagentapi.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.napsteromniagentapi.NapsterOmniagentApiManager; +import com.azure.resourcemanager.napsteromniagentapi.models.ActivateSaaSParameterRequest; +import com.azure.resourcemanager.napsteromniagentapi.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\":\"wwrlkdmtncv\",\"id\":\"otllxdyhgsyo\",\"name\":\"ogjltdtbnnhad\",\"type\":\"ocrkvcikh\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NapsterOmniagentApiManager manager = NapsterOmniagentApiManager.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("mwzn").withPublisherId("biknsorgjhxbld"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("wwrlkdmtncv", response.saasId()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSResourceDetailsResponseInnerTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSResourceDetailsResponseInnerTests.java new file mode 100644 index 000000000000..299af8fd95bf --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SaaSResourceDetailsResponseInnerTests.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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.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\":\"lzlfbxzpuz\",\"id\":\"ispnqzahmgkbrp\",\"name\":\"y\",\"type\":\"hibnuqqkpika\"}") + .toObject(SaaSResourceDetailsResponseInner.class); + Assertions.assertEquals("lzlfbxzpuz", model.saasId()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SingleSignOnPropertiesV2Tests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SingleSignOnPropertiesV2Tests.java new file mode 100644 index 000000000000..3db4d1364fb3 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/SingleSignOnPropertiesV2Tests.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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnPropertiesV2; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnStates; +import com.azure.resourcemanager.napsteromniagentapi.models.SingleSignOnType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SingleSignOnPropertiesV2Tests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SingleSignOnPropertiesV2 model = BinaryData.fromString( + "{\"type\":\"Saml\",\"state\":\"Disable\",\"enterpriseAppId\":\"lfp\",\"url\":\"s\",\"aadDomains\":[\"bquxigjy\",\"gzjaoyfhrtxilne\"]}") + .toObject(SingleSignOnPropertiesV2.class); + Assertions.assertEquals(SingleSignOnType.SAML, model.type()); + Assertions.assertEquals(SingleSignOnStates.DISABLE, model.state()); + Assertions.assertEquals("lfp", model.enterpriseAppId()); + Assertions.assertEquals("s", model.url()); + Assertions.assertEquals("bquxigjy", model.aadDomains().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SingleSignOnPropertiesV2 model = new SingleSignOnPropertiesV2().withType(SingleSignOnType.SAML) + .withState(SingleSignOnStates.DISABLE) + .withEnterpriseAppId("lfp") + .withUrl("s") + .withAadDomains(Arrays.asList("bquxigjy", "gzjaoyfhrtxilne")); + model = BinaryData.fromObject(model).toObject(SingleSignOnPropertiesV2.class); + Assertions.assertEquals(SingleSignOnType.SAML, model.type()); + Assertions.assertEquals(SingleSignOnStates.DISABLE, model.state()); + Assertions.assertEquals("lfp", model.enterpriseAppId()); + Assertions.assertEquals("s", model.url()); + Assertions.assertEquals("bquxigjy", model.aadDomains().get(0)); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/UserAssignedIdentityTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..b40bfa59949a --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/UserAssignedIdentityTests.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.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"f\",\"clientId\":\"wzwbnguitn\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/UserDetailsTests.java b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/UserDetailsTests.java new file mode 100644 index 000000000000..e79a3fb33d45 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/src/test/java/com/azure/resourcemanager/napsteromniagentapi/generated/UserDetailsTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.napsteromniagentapi.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.napsteromniagentapi.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\":\"b\",\"lastName\":\"tmut\",\"emailAddress\":\"qktapspwgcuert\",\"upn\":\"kdosvqw\",\"phoneNumber\":\"mdgbbjfdd\"}") + .toObject(UserDetails.class); + Assertions.assertEquals("b", model.firstName()); + Assertions.assertEquals("tmut", model.lastName()); + Assertions.assertEquals("qktapspwgcuert", model.emailAddress()); + Assertions.assertEquals("kdosvqw", model.upn()); + Assertions.assertEquals("mdgbbjfdd", model.phoneNumber()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserDetails model = new UserDetails().withFirstName("b") + .withLastName("tmut") + .withEmailAddress("qktapspwgcuert") + .withUpn("kdosvqw") + .withPhoneNumber("mdgbbjfdd"); + model = BinaryData.fromObject(model).toObject(UserDetails.class); + Assertions.assertEquals("b", model.firstName()); + Assertions.assertEquals("tmut", model.lastName()); + Assertions.assertEquals("qktapspwgcuert", model.emailAddress()); + Assertions.assertEquals("kdosvqw", model.upn()); + Assertions.assertEquals("mdgbbjfdd", model.phoneNumber()); + } +} diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/tsp-location.yaml b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/tsp-location.yaml new file mode 100644 index 000000000000..063d271d0778 --- /dev/null +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/napster/Napster.CompanionAPI.Management +commit: f11bc1f38131d74b95a0c51b44f779f466cba762 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/napsteromniagentapi/ci.yml b/sdk/napsteromniagentapi/ci.yml new file mode 100644 index 000000000000..d23bf912d4bd --- /dev/null +++ b/sdk/napsteromniagentapi/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/napsteromniagentapi/ci.yml + - sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/ + exclude: + - sdk/napsteromniagentapi/pom.xml + - sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/napsteromniagentapi/ci.yml + - sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/ + exclude: + - sdk/napsteromniagentapi/pom.xml + - sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml + +parameters: + - name: release_azureresourcemanagernapsteromniagentapi + displayName: azure-resourcemanager-napsteromniagentapi + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: napsteromniagentapi + Artifacts: + - name: azure-resourcemanager-napsteromniagentapi + groupId: com.azure.resourcemanager + safeName: azureresourcemanagernapsteromniagentapi + releaseInBatch: ${{ parameters.release_azureresourcemanagernapsteromniagentapi }} diff --git a/sdk/napsteromniagentapi/pom.xml b/sdk/napsteromniagentapi/pom.xml new file mode 100644 index 000000000000..b7185198f9bd --- /dev/null +++ b/sdk/napsteromniagentapi/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-napsteromniagentapi-service + pom + 1.0.0 + + + azure-resourcemanager-napsteromniagentapi + + From 94948f0470b6cb4e7e1c8785a80d2422aaad8bf7 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 15 Jun 2026 10:46:36 +0800 Subject: [PATCH 2/2] Update versions in POM for PR #49470 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-resourcemanager-napsteromniagentapi/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml index 77dfc14ce7e1..dfe9d4fe5c1e 100644 --- a/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml +++ b/sdk/napsteromniagentapi/azure-resourcemanager-napsteromniagentapi/pom.xml @@ -67,7 +67,7 @@ com.azure azure-identity - 1.18.3 + 1.18.4 test