From 77e334856058fff0f2aa853a68ebe88403c6cad8 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 12 Mar 2026 22:35:11 +0000 Subject: [PATCH] Configurations: 'specification/applink/AppLink.Management/tspconfig.yaml', API Version: 2025-04-01-preview, SDK Release Type: beta, and CommitSHA: 'b37b0676411ff84913d5358998668b867ac75a0f' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6004233 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 + .../azure-resourcemanager-applink/README.md | 102 ++ .../azure-resourcemanager-applink/SAMPLE.md | 471 +++++++ .../azure-resourcemanager-applink/pom.xml | 74 ++ .../applink/ApplinkManager.java | 346 ++++++ .../applink/fluent/AppLinkMembersClient.java | 266 ++++ .../applink/fluent/AppLinksClient.java | 266 ++++ .../fluent/ApplinkManagementClient.java | 83 ++ .../fluent/AvailableVersionsClient.java | 42 + .../applink/fluent/OperationsClient.java | 40 + .../fluent/UpgradeHistoriesClient.java | 47 + .../applink/fluent/models/AppLinkInner.java | 210 ++++ .../fluent/models/AppLinkMemberInner.java | 181 +++ .../fluent/models/AvailableVersionInner.java | 144 +++ .../applink/fluent/models/OperationInner.java | 150 +++ .../fluent/models/UpgradeHistoryInner.java | 144 +++ .../applink/fluent/models/package-info.java | 9 + .../applink/fluent/package-info.java | 9 + .../applink/implementation/AppLinkImpl.java | 173 +++ .../implementation/AppLinkMemberImpl.java | 167 +++ .../AppLinkMembersClientImpl.java | 974 +++++++++++++++ .../implementation/AppLinkMembersImpl.java | 153 +++ .../implementation/AppLinksClientImpl.java | 1088 +++++++++++++++++ .../applink/implementation/AppLinksImpl.java | 141 +++ .../ApplinkManagementClientBuilder.java | 138 +++ .../ApplinkManagementClientImpl.java | 372 ++++++ .../implementation/AvailableVersionImpl.java | 50 + .../AvailableVersionsClientImpl.java | 286 +++++ .../implementation/AvailableVersionsImpl.java | 46 + .../applink/implementation/OperationImpl.java | 50 + .../implementation/OperationsClientImpl.java | 242 ++++ .../implementation/OperationsImpl.java | 45 + .../implementation/ResourceManagerUtils.java | 195 +++ .../UpgradeHistoriesClientImpl.java | 286 +++++ .../implementation/UpgradeHistoriesImpl.java | 49 + .../implementation/UpgradeHistoryImpl.java | 50 + .../models/AppLinkListResult.java | 95 ++ .../models/AppLinkMemberListResult.java | 95 ++ .../models/AvailableVersionListResult.java | 96 ++ .../models/OperationListResult.java | 96 ++ .../models/UpgradeHistoryListResult.java | 96 ++ .../applink/implementation/package-info.java | 9 + .../applink/models/ActionType.java | 46 + .../applink/models/AppLink.java | 299 +++++ .../applink/models/AppLinkMember.java | 266 ++++ .../models/AppLinkMemberProperties.java | 215 ++++ .../applink/models/AppLinkMembers.java | 144 +++ .../applink/models/AppLinkProperties.java | 73 ++ .../applink/models/AppLinks.java | 157 +++ .../applink/models/AvailableVersion.java | 55 + .../models/AvailableVersionProperties.java | 126 ++ .../applink/models/AvailableVersions.java | 37 + .../applink/models/ClusterType.java | 46 + .../applink/models/ConnectivityProfile.java | 113 ++ .../models/EastWestGatewayProfile.java | 87 ++ .../models/EastWestGatewayVisibility.java | 51 + .../models/FullyManagedUpgradeProfile.java | 88 ++ .../applink/models/FullyManagedVersions.java | 79 ++ .../models/ManagedServiceIdentity.java | 154 +++ .../models/ManagedServiceIdentityType.java | 62 + .../applink/models/Metadata.java | 86 ++ .../applink/models/MetricsProfile.java | 73 ++ .../applink/models/ObservabilityProfile.java | 85 ++ .../applink/models/Operation.java | 58 + .../applink/models/OperationDisplay.java | 128 ++ .../applink/models/Operations.java | 35 + .../applink/models/Origin.java | 57 + .../applink/models/PrivateConnectProfile.java | 86 ++ .../applink/models/ProvisioningState.java | 76 ++ .../applink/models/ReleaseChannelInfo.java | 92 ++ .../models/SelfManagedUpgradeProfile.java | 86 ++ .../applink/models/SelfManagedVersions.java | 77 ++ .../applink/models/UpgradeHistories.java | 42 + .../applink/models/UpgradeHistory.java | 55 + .../models/UpgradeHistoryProperties.java | 167 +++ .../applink/models/UpgradeMode.java | 51 + .../applink/models/UpgradeProfile.java | 142 +++ .../applink/models/UpgradeReleaseChannel.java | 51 + .../applink/models/UserAssignedIdentity.java | 89 ++ .../applink/models/VersionInfo.java | 94 ++ .../applink/models/package-info.java | 9 + .../resourcemanager/applink/package-info.java | 9 + .../src/main/java/module-info.java | 16 + ...zure-resourcemanager-applink_metadata.json | 1 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + .../azure-resourcemanager-applink.properties | 1 + .../AppLinkMembersCreateOrUpdateSamples.java | 64 + .../AppLinkMembersDeleteSamples.java | 22 + .../generated/AppLinkMembersGetSamples.java | 23 + .../AppLinkMembersListByAppLinkSamples.java | 22 + .../AppLinkMembersUpdateSamples.java | 55 + .../AppLinksCreateOrUpdateSamples.java | 47 + .../generated/AppLinksDeleteSamples.java | 22 + .../AppLinksGetByResourceGroupSamples.java | 23 + .../AppLinksListByResourceGroupSamples.java | 22 + .../generated/AppLinksListSamples.java | 22 + .../generated/AppLinksUpdateSamples.java | 52 + ...vailableVersionsListByLocationSamples.java | 35 + .../generated/OperationsListSamples.java | 22 + ...deHistoriesListByAppLinkMemberSamples.java | 23 + .../applink/generated/AppLinkInnerTests.java | 53 + .../generated/AppLinkListResultTests.java | 23 + .../generated/AppLinkMemberInnerTests.java | 86 ++ .../AppLinkMemberListResultTests.java | 36 + .../AppLinkMemberPropertiesTests.java | 64 + ...AppLinkMembersCreateOrUpdateMockTests.java | 92 ++ ...ppLinkMembersGetWithResponseMockTests.java | 55 + .../AppLinkMembersListByAppLinkMockTests.java | 56 + .../generated/AppLinkPropertiesTests.java | 22 + .../AppLinksCreateOrUpdateMockTests.java | 65 + ...tByResourceGroupWithResponseMockTests.java | 42 + .../AppLinksListByResourceGroupMockTests.java | 42 + .../generated/AppLinksListMockTests.java | 41 + .../generated/AvailableVersionInnerTests.java | 25 + .../AvailableVersionListResultTests.java | 26 + .../AvailableVersionPropertiesTests.java | 23 + ...ilableVersionsListByLocationMockTests.java | 47 + .../generated/ConnectivityProfileTests.java | 34 + .../EastWestGatewayProfileTests.java | 26 + .../FullyManagedUpgradeProfileTests.java | 27 + .../generated/FullyManagedVersionsTests.java | 20 + .../ManagedServiceIdentityTests.java | 44 + .../applink/generated/MetadataTests.java | 24 + .../generated/MetricsProfileTests.java | 22 + .../generated/ObservabilityProfileTests.java | 23 + .../generated/OperationDisplayTests.java | 17 + .../generated/OperationInnerTests.java | 17 + .../generated/OperationListResultTests.java | 19 + .../generated/OperationsListMockTests.java | 36 + .../generated/PrivateConnectProfileTests.java | 25 + .../generated/ReleaseChannelInfoTests.java | 19 + .../SelfManagedUpgradeProfileTests.java | 25 + .../generated/SelfManagedVersionsTests.java | 20 + ...HistoriesListByAppLinkMemberMockTests.java | 45 + .../generated/UpgradeHistoryInnerTests.java | 24 + .../UpgradeHistoryListResultTests.java | 27 + .../UpgradeHistoryPropertiesTests.java | 24 + .../generated/UpgradeProfileTests.java | 37 + .../generated/UserAssignedIdentityTests.java | 23 + .../applink/generated/VersionInfoTests.java | 19 + .../tsp-location.yaml | 4 + sdk/applink/ci.yml | 46 + sdk/applink/pom.xml | 15 + 146 files changed, 13266 insertions(+) create mode 100644 sdk/applink/azure-resourcemanager-applink/CHANGELOG.md create mode 100644 sdk/applink/azure-resourcemanager-applink/README.md create mode 100644 sdk/applink/azure-resourcemanager-applink/SAMPLE.md create mode 100644 sdk/applink/azure-resourcemanager-applink/pom.xml create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/ApplinkManager.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AppLinkMembersClient.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AppLinksClient.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/ApplinkManagementClient.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AvailableVersionsClient.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/OperationsClient.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/UpgradeHistoriesClient.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkInner.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkMemberInner.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AvailableVersionInner.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/OperationInner.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/UpgradeHistoryInner.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/package-info.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/package-info.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMemberImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersClientImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksClientImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientBuilder.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsClientImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationsClientImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationsImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ResourceManagerUtils.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesClientImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoryImpl.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkListResult.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkMemberListResult.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AvailableVersionListResult.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/OperationListResult.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/UpgradeHistoryListResult.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/package-info.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ActionType.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLink.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMember.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMemberProperties.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMembers.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkProperties.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinks.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersion.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersionProperties.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersions.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ClusterType.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ConnectivityProfile.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayProfile.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayVisibility.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/FullyManagedUpgradeProfile.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/FullyManagedVersions.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ManagedServiceIdentity.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ManagedServiceIdentityType.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Metadata.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/MetricsProfile.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ObservabilityProfile.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Operation.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/OperationDisplay.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Operations.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Origin.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/PrivateConnectProfile.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ProvisioningState.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ReleaseChannelInfo.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/SelfManagedUpgradeProfile.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/SelfManagedVersions.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistories.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistory.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistoryProperties.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeMode.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeProfile.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeReleaseChannel.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UserAssignedIdentity.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/VersionInfo.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/package-info.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/package-info.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/java/module-info.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/azure-resourcemanager-applink_metadata.json create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-applink/proxy-config.json create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-applink/reflect-config.json create mode 100644 sdk/applink/azure-resourcemanager-applink/src/main/resources/azure-resourcemanager-applink.properties create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersCreateOrUpdateSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersDeleteSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersGetSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersListByAppLinkSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersUpdateSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksCreateOrUpdateSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksDeleteSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksGetByResourceGroupSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksListByResourceGroupSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksListSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksUpdateSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AvailableVersionsListByLocationSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/OperationsListSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/UpgradeHistoriesListByAppLinkMemberSamples.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkInnerTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkListResultTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberInnerTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberListResultTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberPropertiesTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersCreateOrUpdateMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersGetWithResponseMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersListByAppLinkMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkPropertiesTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksCreateOrUpdateMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksGetByResourceGroupWithResponseMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksListByResourceGroupMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksListMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionInnerTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionListResultTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionPropertiesTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionsListByLocationMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ConnectivityProfileTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/EastWestGatewayProfileTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/FullyManagedUpgradeProfileTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/FullyManagedVersionsTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ManagedServiceIdentityTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/MetadataTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/MetricsProfileTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ObservabilityProfileTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationDisplayTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationInnerTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationListResultTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationsListMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/PrivateConnectProfileTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ReleaseChannelInfoTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/SelfManagedUpgradeProfileTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/SelfManagedVersionsTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoriesListByAppLinkMemberMockTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryInnerTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryListResultTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryPropertiesTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeProfileTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UserAssignedIdentityTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/VersionInfoTests.java create mode 100644 sdk/applink/azure-resourcemanager-applink/tsp-location.yaml create mode 100644 sdk/applink/ci.yml create mode 100644 sdk/applink/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 1e333b14eb26..776e46e96493 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -521,6 +521,7 @@ com.azure.resourcemanager:azure-resourcemanager-virtualenclaves;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-edgeactions;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-computebulkactions;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-artifactsigning;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-applink;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 1b11a324806d..cbd17de611fb 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,7 @@ sdk/appconfiguration-v2 sdk/appcontainers sdk/applicationinsights + sdk/applink sdk/appplatform sdk/appservice sdk/arizeaiobservabilityeval diff --git a/sdk/applink/azure-resourcemanager-applink/CHANGELOG.md b/sdk/applink/azure-resourcemanager-applink/CHANGELOG.md new file mode 100644 index 000000000000..bca013e8c83c --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2026-03-12) + +- Azure Resource Manager applink client library for Java. This package contains Microsoft Azure SDK for applink Management SDK. Microsoft.AppLink Resource Provider management API. Package api-version 2025-08-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-applink Java SDK. diff --git a/sdk/applink/azure-resourcemanager-applink/README.md b/sdk/applink/azure-resourcemanager-applink/README.md new file mode 100644 index 000000000000..2c2fdccddcec --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager applink client library for Java + +Azure Resource Manager applink client library for Java. + +This package contains Microsoft Azure SDK for applink Management SDK. Microsoft.AppLink Resource Provider management API. Package api-version 2025-08-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-applink;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-applink + 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(); +ApplinkManager manager = ApplinkManager + .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/applink/azure-resourcemanager-applink/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/applink/azure-resourcemanager-applink/SAMPLE.md b/sdk/applink/azure-resourcemanager-applink/SAMPLE.md new file mode 100644 index 000000000000..4536b121da61 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/SAMPLE.md @@ -0,0 +1,471 @@ +# Code snippets and samples + + +## AppLinkMembers + +- [CreateOrUpdate](#applinkmembers_createorupdate) +- [Delete](#applinkmembers_delete) +- [Get](#applinkmembers_get) +- [ListByAppLink](#applinkmembers_listbyapplink) +- [Update](#applinkmembers_update) + +## AppLinks + +- [CreateOrUpdate](#applinks_createorupdate) +- [Delete](#applinks_delete) +- [GetByResourceGroup](#applinks_getbyresourcegroup) +- [List](#applinks_list) +- [ListByResourceGroup](#applinks_listbyresourcegroup) +- [Update](#applinks_update) + +## AvailableVersions + +- [ListByLocation](#availableversions_listbylocation) + +## Operations + +- [List](#operations_list) + +## UpgradeHistories + +- [ListByAppLinkMember](#upgradehistories_listbyapplinkmember) +### AppLinkMembers_CreateOrUpdate + +```java +import com.azure.resourcemanager.applink.models.AppLinkMemberProperties; +import com.azure.resourcemanager.applink.models.ClusterType; +import com.azure.resourcemanager.applink.models.ConnectivityProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.FullyManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.Metadata; +import com.azure.resourcemanager.applink.models.PrivateConnectProfile; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppLinkMembers CreateOrUpdate. + */ +public final class AppLinkMembersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_CreateOrUpdate.json + */ + /** + * Sample code: AppLinkMembers_CreateOrUpdate. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersCreateOrUpdate(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinkMembers() + .define("member-01") + .withRegion("westus2") + .withExistingAppLink("test_rg", "applink-test-01") + .withTags(mapOf("key2913", "fakeTokenPlaceholder")) + .withProperties(new AppLinkMemberProperties().withClusterType(ClusterType.AKS) + .withMetadata(new Metadata().withResourceId( + "/subscriptions/bc7e0da9-5e4c-4a91-9252-9658837006cf/resourcegroups/applink-rg/providers/Microsoft.ContainerService/managedClusters/applink-member1")) + .withUpgradeProfile(new UpgradeProfile().withMode(UpgradeMode.FULLY_MANAGED) + .withFullyManagedUpgradeProfile( + new FullyManagedUpgradeProfile().withReleaseChannel(UpgradeReleaseChannel.STABLE))) + .withConnectivityProfile(new ConnectivityProfile() + .withEastWestGateway( + new EastWestGatewayProfile().withVisibility(EastWestGatewayVisibility.INTERNAL)) + .withPrivateConnect(new PrivateConnectProfile().withSubnetResourceId( + "/subscriptions/bc7e0da9-5e4c-4a91-9252-9658837006cf/resourceGroups/applink-vnet-rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1")))) + .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; + } +} +``` + +### AppLinkMembers_Delete + +```java +/** + * Samples for AppLinkMembers Delete. + */ +public final class AppLinkMembersDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_Delete.json + */ + /** + * Sample code: AppLinkMembers_Delete. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersDelete(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinkMembers().delete("test_rg", "applink-test-01", "member-01", com.azure.core.util.Context.NONE); + } +} +``` + +### AppLinkMembers_Get + +```java +/** + * Samples for AppLinkMembers Get. + */ +public final class AppLinkMembersGetSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_Get.json + */ + /** + * Sample code: AppLinkMembers_Get. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersGet(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinkMembers() + .getWithResponse("test_rg", "applink-test-01", "member-01", com.azure.core.util.Context.NONE); + } +} +``` + +### AppLinkMembers_ListByAppLink + +```java +/** + * Samples for AppLinkMembers ListByAppLink. + */ +public final class AppLinkMembersListByAppLinkSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_ListByAppLink.json + */ + /** + * Sample code: AppLinkMembers_ListByAppLink. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersListByAppLink(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinkMembers().listByAppLink("test_rg", "applink-test-01", com.azure.core.util.Context.NONE); + } +} +``` + +### AppLinkMembers_Update + +```java +import com.azure.resourcemanager.applink.models.AppLinkMember; +import com.azure.resourcemanager.applink.models.AppLinkMemberProperties; +import com.azure.resourcemanager.applink.models.ConnectivityProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.SelfManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeProfile; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppLinkMembers Update. + */ +public final class AppLinkMembersUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_Update.json + */ + /** + * Sample code: AppLinkMembers_Update. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersUpdate(com.azure.resourcemanager.applink.ApplinkManager manager) { + AppLinkMember resource = manager.appLinkMembers() + .getWithResponse("test_rg", "applink-test-01", "member-01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key7952", "fakeTokenPlaceholder")) + .withProperties(new AppLinkMemberProperties() + .withUpgradeProfile(new UpgradeProfile().withMode(UpgradeMode.SELF_MANAGED) + .withSelfManagedUpgradeProfile(new SelfManagedUpgradeProfile().withVersion("1.26"))) + .withConnectivityProfile(new ConnectivityProfile().withEastWestGateway( + new EastWestGatewayProfile().withVisibility(EastWestGatewayVisibility.INTERNAL)))) + .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; + } +} +``` + +### AppLinks_CreateOrUpdate + +```java +import com.azure.resourcemanager.applink.models.AppLinkProperties; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentity; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppLinks CreateOrUpdate. + */ +public final class AppLinksCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_CreateOrUpdate.json + */ + /** + * Sample code: AppLinks_CreateOrUpdate. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksCreateOrUpdate(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks() + .define("applink-test-01") + .withRegion("westus2") + .withExistingResourceGroup("test_rg") + .withTags(mapOf("key2913", "fakeTokenPlaceholder")) + .withProperties(new AppLinkProperties()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .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; + } +} +``` + +### AppLinks_Delete + +```java +/** + * Samples for AppLinks Delete. + */ +public final class AppLinksDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_Delete.json + */ + /** + * Sample code: AppLinks_Delete. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksDelete(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks().delete("test_rg", "applink-test-01", com.azure.core.util.Context.NONE); + } +} +``` + +### AppLinks_GetByResourceGroup + +```java +/** + * Samples for AppLinks GetByResourceGroup. + */ +public final class AppLinksGetByResourceGroupSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_Get.json + */ + /** + * Sample code: AppLinks_Get. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksGet(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks() + .getByResourceGroupWithResponse("test_rg", "applink-test-01", com.azure.core.util.Context.NONE); + } +} +``` + +### AppLinks_List + +```java +/** + * Samples for AppLinks List. + */ +public final class AppLinksListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_ListBySubscription.json + */ + /** + * Sample code: AppLinks_ListBySubscription. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksListBySubscription(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AppLinks_ListByResourceGroup + +```java +/** + * Samples for AppLinks ListByResourceGroup. + */ +public final class AppLinksListByResourceGroupSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_ListByResourceGroup.json + */ + /** + * Sample code: AppLinks_ListByResourceGroup. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksListByResourceGroup(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks().listByResourceGroup("test_rg", com.azure.core.util.Context.NONE); + } +} +``` + +### AppLinks_Update + +```java +import com.azure.resourcemanager.applink.models.AppLink; +import com.azure.resourcemanager.applink.models.AppLinkProperties; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentity; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.applink.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppLinks Update. + */ +public final class AppLinksUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_Update.json + */ + /** + * Sample code: AppLinks_Update. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksUpdate(com.azure.resourcemanager.applink.ApplinkManager manager) { + AppLink resource = manager.appLinks() + .getByResourceGroupWithResponse("test_rg", "applink-test-01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("environment", "production", "cost-center", "platform")) + .withProperties(new AppLinkProperties()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/test_rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/applink-identity", + new UserAssignedIdentity()))) + .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; + } +} +``` + +### AvailableVersions_ListByLocation + +```java +/** + * Samples for AvailableVersions ListByLocation. + */ +public final class AvailableVersionsListByLocationSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AvailableVersions_ListByLocationWithFilter.json + */ + /** + * Sample code: AvailableVersions_ListByLocationWithFilter. + * + * @param manager Entry point to ApplinkManager. + */ + public static void + availableVersionsListByLocationWithFilter(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.availableVersions().listByLocation("westus2", "1.28", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-08-01-preview/AvailableVersions_ListByLocation.json + */ + /** + * Sample code: AvailableVersions_ListByLocation. + * + * @param manager Entry point to ApplinkManager. + */ + public static void availableVersionsListByLocation(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.availableVersions().listByLocation("westus2", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to ApplinkManager. + */ + public static void operationsList(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### UpgradeHistories_ListByAppLinkMember + +```java +/** + * Samples for UpgradeHistories ListByAppLinkMember. + */ +public final class UpgradeHistoriesListByAppLinkMemberSamples { + /* + * x-ms-original-file: 2025-08-01-preview/UpgradeHistories_ListByAppLinkMember.json + */ + /** + * Sample code: UpgradeHistories_ListByAppLinkMember. + * + * @param manager Entry point to ApplinkManager. + */ + public static void upgradeHistoriesListByAppLinkMember(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.upgradeHistories() + .listByAppLinkMember("test_rg", "applink-test-01", "member-01", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/applink/azure-resourcemanager-applink/pom.xml b/sdk/applink/azure-resourcemanager-applink/pom.xml new file mode 100644 index 000000000000..11158cf90b57 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/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-applink + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for applink Management + This package contains Microsoft Azure SDK for applink Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft.AppLink Resource Provider management API. Package api-version 2025-08-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.57.1 + + + com.azure + azure-core-management + 1.19.3 + + + com.azure + azure-core-test + 1.27.0-beta.14 + test + + + com.azure + azure-identity + 1.18.2 + test + + + diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/ApplinkManager.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/ApplinkManager.java new file mode 100644 index 000000000000..2ced66752571 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/ApplinkManager.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink; + +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.applink.fluent.ApplinkManagementClient; +import com.azure.resourcemanager.applink.implementation.AppLinkMembersImpl; +import com.azure.resourcemanager.applink.implementation.AppLinksImpl; +import com.azure.resourcemanager.applink.implementation.ApplinkManagementClientBuilder; +import com.azure.resourcemanager.applink.implementation.AvailableVersionsImpl; +import com.azure.resourcemanager.applink.implementation.OperationsImpl; +import com.azure.resourcemanager.applink.implementation.UpgradeHistoriesImpl; +import com.azure.resourcemanager.applink.models.AppLinkMembers; +import com.azure.resourcemanager.applink.models.AppLinks; +import com.azure.resourcemanager.applink.models.AvailableVersions; +import com.azure.resourcemanager.applink.models.Operations; +import com.azure.resourcemanager.applink.models.UpgradeHistories; +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 ApplinkManager. + * Microsoft.AppLink Resource Provider management API. + */ +public final class ApplinkManager { + private Operations operations; + + private AppLinks appLinks; + + private AppLinkMembers appLinkMembers; + + private UpgradeHistories upgradeHistories; + + private AvailableVersions availableVersions; + + private final ApplinkManagementClient clientObject; + + private ApplinkManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new ApplinkManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of applink service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the applink service API instance. + */ + public static ApplinkManager 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 applink service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the applink service API instance. + */ + public static ApplinkManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ApplinkManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ApplinkManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ApplinkManager.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-applink.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 applink service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the applink service API instance. + */ + public ApplinkManager 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.applink") + .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 ApplinkManager(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 AppLinks. It manages AppLink. + * + * @return Resource collection API of AppLinks. + */ + public AppLinks appLinks() { + if (this.appLinks == null) { + this.appLinks = new AppLinksImpl(clientObject.getAppLinks(), this); + } + return appLinks; + } + + /** + * Gets the resource collection API of AppLinkMembers. It manages AppLinkMember. + * + * @return Resource collection API of AppLinkMembers. + */ + public AppLinkMembers appLinkMembers() { + if (this.appLinkMembers == null) { + this.appLinkMembers = new AppLinkMembersImpl(clientObject.getAppLinkMembers(), this); + } + return appLinkMembers; + } + + /** + * Gets the resource collection API of UpgradeHistories. + * + * @return Resource collection API of UpgradeHistories. + */ + public UpgradeHistories upgradeHistories() { + if (this.upgradeHistories == null) { + this.upgradeHistories = new UpgradeHistoriesImpl(clientObject.getUpgradeHistories(), this); + } + return upgradeHistories; + } + + /** + * Gets the resource collection API of AvailableVersions. + * + * @return Resource collection API of AvailableVersions. + */ + public AvailableVersions availableVersions() { + if (this.availableVersions == null) { + this.availableVersions = new AvailableVersionsImpl(clientObject.getAvailableVersions(), this); + } + return availableVersions; + } + + /** + * Gets wrapped service client ApplinkManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client ApplinkManagementClient. + */ + public ApplinkManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AppLinkMembersClient.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AppLinkMembersClient.java new file mode 100644 index 000000000000..bf93d2c5bdb9 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AppLinkMembersClient.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.models.AppLinkMemberInner; + +/** + * An instance of this class provides access to all the operations defined in AppLinkMembersClient. + */ +public interface AppLinkMembersClient { + /** + * Get an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String appLinkName, String appLinkMemberName, + Context context); + + /** + * Get an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkMemberInner get(String resourceGroupName, String appLinkName, String appLinkMemberName); + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppLinkMemberInner> beginCreateOrUpdate(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner resource); + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppLinkMemberInner> beginCreateOrUpdate(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner resource, Context context); + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkMemberInner createOrUpdate(String resourceGroupName, String appLinkName, String appLinkMemberName, + AppLinkMemberInner resource); + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkMemberInner createOrUpdate(String resourceGroupName, String appLinkName, String appLinkMemberName, + AppLinkMemberInner resource, Context context); + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppLinkMemberInner> beginUpdate(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner properties); + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppLinkMemberInner> beginUpdate(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner properties, Context context); + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkMemberInner update(String resourceGroupName, String appLinkName, String appLinkMemberName, + AppLinkMemberInner properties); + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkMemberInner update(String resourceGroupName, String appLinkName, String appLinkMemberName, + AppLinkMemberInner properties, Context context); + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, + String appLinkMemberName); + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, + String appLinkMemberName, Context context); + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, String appLinkMemberName); + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, String appLinkMemberName, Context context); + + /** + * List AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAppLink(String resourceGroupName, String appLinkName); + + /** + * List AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAppLink(String resourceGroupName, String appLinkName, Context context); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AppLinksClient.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AppLinksClient.java new file mode 100644 index 000000000000..a7d42eb5a6f7 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AppLinksClient.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.models.AppLinkInner; + +/** + * An instance of this class provides access to all the operations defined in AppLinksClient. + */ +public interface AppLinksClient { + /** + * Get an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String appLinkName, + Context context); + + /** + * Get an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkInner getByResourceGroup(String resourceGroupName, String appLinkName); + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppLinkInner> beginCreateOrUpdate(String resourceGroupName, String appLinkName, + AppLinkInner resource); + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppLinkInner> beginCreateOrUpdate(String resourceGroupName, String appLinkName, + AppLinkInner resource, Context context); + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkInner createOrUpdate(String resourceGroupName, String appLinkName, AppLinkInner resource); + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkInner createOrUpdate(String resourceGroupName, String appLinkName, AppLinkInner resource, Context context); + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppLinkInner> beginUpdate(String resourceGroupName, String appLinkName, + AppLinkInner properties); + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppLinkInner> beginUpdate(String resourceGroupName, String appLinkName, + AppLinkInner properties, Context context); + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkInner update(String resourceGroupName, String appLinkName, AppLinkInner properties); + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppLinkInner update(String resourceGroupName, String appLinkName, AppLinkInner properties, Context context); + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName); + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName, Context context); + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName); + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName, Context context); + + /** + * List AppLink 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 AppLink list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AppLink 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 AppLink list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List AppLink resources by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List AppLink resources by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/ApplinkManagementClient.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/ApplinkManagementClient.java new file mode 100644 index 000000000000..9c94a231c682 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/ApplinkManagementClient.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for ApplinkManagementClient class. + */ +public interface ApplinkManagementClient { + /** + * 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 AppLinksClient object to access its operations. + * + * @return the AppLinksClient object. + */ + AppLinksClient getAppLinks(); + + /** + * Gets the AppLinkMembersClient object to access its operations. + * + * @return the AppLinkMembersClient object. + */ + AppLinkMembersClient getAppLinkMembers(); + + /** + * Gets the UpgradeHistoriesClient object to access its operations. + * + * @return the UpgradeHistoriesClient object. + */ + UpgradeHistoriesClient getUpgradeHistories(); + + /** + * Gets the AvailableVersionsClient object to access its operations. + * + * @return the AvailableVersionsClient object. + */ + AvailableVersionsClient getAvailableVersions(); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AvailableVersionsClient.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AvailableVersionsClient.java new file mode 100644 index 000000000000..91179c5992c9 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/AvailableVersionsClient.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.applink.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.applink.fluent.models.AvailableVersionInner; + +/** + * An instance of this class provides access to all the operations defined in AvailableVersionsClient. + */ +public interface AvailableVersionsClient { + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @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 AvailableVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location); + + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @param kubernetesVersion Kubernetes version to filter profiles. + * @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 AvailableVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location, String kubernetesVersion, Context context); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/OperationsClient.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/OperationsClient.java new file mode 100644 index 000000000000..8fb47e974b19 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/UpgradeHistoriesClient.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/UpgradeHistoriesClient.java new file mode 100644 index 000000000000..f49e292b25ef --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/UpgradeHistoriesClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.models.UpgradeHistoryInner; + +/** + * An instance of this class provides access to all the operations defined in UpgradeHistoriesClient. + */ +public interface UpgradeHistoriesClient { + /** + * List UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAppLinkMember(String resourceGroupName, String appLinkName, + String appLinkMemberName); + + /** + * List UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAppLinkMember(String resourceGroupName, String appLinkName, + String appLinkMemberName, Context context); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkInner.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkInner.java new file mode 100644 index 000000000000..a7602a510f45 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkInner.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.applink.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.applink.models.AppLinkProperties; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * AppLink resource. + */ +@Fluent +public final class AppLinkInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private AppLinkProperties 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 AppLinkInner class. + */ + public AppLinkInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AppLinkProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AppLinkInner object itself. + */ + public AppLinkInner withProperties(AppLinkProperties 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 AppLinkInner object itself. + */ + public AppLinkInner 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 AppLinkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AppLinkInner 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 AppLinkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppLinkInner 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 AppLinkInner. + */ + public static AppLinkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppLinkInner deserializedAppLinkInner = new AppLinkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAppLinkInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAppLinkInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAppLinkInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAppLinkInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAppLinkInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAppLinkInner.properties = AppLinkProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedAppLinkInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAppLinkInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppLinkInner; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkMemberInner.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkMemberInner.java new file mode 100644 index 000000000000..a3060451f281 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkMemberInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.models.AppLinkMemberProperties; +import java.io.IOException; +import java.util.Map; + +/** + * AppLink Member resource. + */ +@Fluent +public final class AppLinkMemberInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private AppLinkMemberProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AppLinkMemberInner class. + */ + public AppLinkMemberInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AppLinkMemberProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AppLinkMemberInner object itself. + */ + public AppLinkMemberInner withProperties(AppLinkMemberProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public AppLinkMemberInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AppLinkMemberInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppLinkMemberInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppLinkMemberInner 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 AppLinkMemberInner. + */ + public static AppLinkMemberInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppLinkMemberInner deserializedAppLinkMemberInner = new AppLinkMemberInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAppLinkMemberInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAppLinkMemberInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAppLinkMemberInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAppLinkMemberInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAppLinkMemberInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAppLinkMemberInner.properties = AppLinkMemberProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAppLinkMemberInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppLinkMemberInner; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AvailableVersionInner.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AvailableVersionInner.java new file mode 100644 index 000000000000..e71abc70862d --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/AvailableVersionInner.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.applink.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 com.azure.resourcemanager.applink.models.AvailableVersionProperties; +import java.io.IOException; + +/** + * AppLink available version resource. + */ +@Immutable +public final class AvailableVersionInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AvailableVersionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AvailableVersionInner class. + */ + private AvailableVersionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AvailableVersionProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableVersionInner 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 AvailableVersionInner. + */ + public static AvailableVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableVersionInner deserializedAvailableVersionInner = new AvailableVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAvailableVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAvailableVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvailableVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAvailableVersionInner.properties = AvailableVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAvailableVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableVersionInner; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/OperationInner.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/OperationInner.java new file mode 100644 index 000000000000..c7e1ae0b4282 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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.applink.models.ActionType; +import com.azure.resourcemanager.applink.models.OperationDisplay; +import com.azure.resourcemanager.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/UpgradeHistoryInner.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/UpgradeHistoryInner.java new file mode 100644 index 000000000000..d3244cada92e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/UpgradeHistoryInner.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.applink.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 com.azure.resourcemanager.applink.models.UpgradeHistoryProperties; +import java.io.IOException; + +/** + * AppLinkMember upgrade history. + */ +@Immutable +public final class UpgradeHistoryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private UpgradeHistoryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of UpgradeHistoryInner class. + */ + private UpgradeHistoryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public UpgradeHistoryProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpgradeHistoryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpgradeHistoryInner 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 UpgradeHistoryInner. + */ + public static UpgradeHistoryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpgradeHistoryInner deserializedUpgradeHistoryInner = new UpgradeHistoryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUpgradeHistoryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedUpgradeHistoryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUpgradeHistoryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedUpgradeHistoryInner.properties = UpgradeHistoryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedUpgradeHistoryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpgradeHistoryInner; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/package-info.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/package-info.java new file mode 100644 index 000000000000..9c763d471023 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// 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 ApplinkManagementClient. + * Microsoft.AppLink Resource Provider management API. + */ +package com.azure.resourcemanager.applink.fluent.models; diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/package-info.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/package-info.java new file mode 100644 index 000000000000..2eeb27453cd8 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/fluent/package-info.java @@ -0,0 +1,9 @@ +// 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 ApplinkManagementClient. + * Microsoft.AppLink Resource Provider management API. + */ +package com.azure.resourcemanager.applink.fluent; diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkImpl.java new file mode 100644 index 000000000000..f714278f48d6 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.applink.fluent.models.AppLinkInner; +import com.azure.resourcemanager.applink.models.AppLink; +import com.azure.resourcemanager.applink.models.AppLinkProperties; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentity; +import java.util.Collections; +import java.util.Map; + +public final class AppLinkImpl implements AppLink, AppLink.Definition, AppLink.Update { + private AppLinkInner innerObject; + + private final com.azure.resourcemanager.applink.ApplinkManager 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 AppLinkProperties 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 AppLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.applink.ApplinkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String appLinkName; + + public AppLinkImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AppLink create() { + this.innerObject = serviceManager.serviceClient() + .getAppLinks() + .createOrUpdate(resourceGroupName, appLinkName, this.innerModel(), Context.NONE); + return this; + } + + public AppLink create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppLinks() + .createOrUpdate(resourceGroupName, appLinkName, this.innerModel(), context); + return this; + } + + AppLinkImpl(String name, com.azure.resourcemanager.applink.ApplinkManager serviceManager) { + this.innerObject = new AppLinkInner(); + this.serviceManager = serviceManager; + this.appLinkName = name; + } + + public AppLinkImpl update() { + return this; + } + + public AppLink apply() { + this.innerObject = serviceManager.serviceClient() + .getAppLinks() + .update(resourceGroupName, appLinkName, this.innerModel(), Context.NONE); + return this; + } + + public AppLink apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppLinks() + .update(resourceGroupName, appLinkName, this.innerModel(), context); + return this; + } + + AppLinkImpl(AppLinkInner innerObject, com.azure.resourcemanager.applink.ApplinkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.appLinkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "appLinks"); + } + + public AppLink refresh() { + this.innerObject = serviceManager.serviceClient() + .getAppLinks() + .getByResourceGroupWithResponse(resourceGroupName, appLinkName, Context.NONE) + .getValue(); + return this; + } + + public AppLink refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppLinks() + .getByResourceGroupWithResponse(resourceGroupName, appLinkName, context) + .getValue(); + return this; + } + + public AppLinkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AppLinkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AppLinkImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public AppLinkImpl withProperties(AppLinkProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public AppLinkImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMemberImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMemberImpl.java new file mode 100644 index 000000000000..3887a6626350 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMemberImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.applink.fluent.models.AppLinkMemberInner; +import com.azure.resourcemanager.applink.models.AppLinkMember; +import com.azure.resourcemanager.applink.models.AppLinkMemberProperties; +import java.util.Collections; +import java.util.Map; + +public final class AppLinkMemberImpl implements AppLinkMember, AppLinkMember.Definition, AppLinkMember.Update { + private AppLinkMemberInner innerObject; + + private final com.azure.resourcemanager.applink.ApplinkManager 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 AppLinkMemberProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AppLinkMemberInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.applink.ApplinkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String appLinkName; + + private String appLinkMemberName; + + public AppLinkMemberImpl withExistingAppLink(String resourceGroupName, String appLinkName) { + this.resourceGroupName = resourceGroupName; + this.appLinkName = appLinkName; + return this; + } + + public AppLinkMember create() { + this.innerObject = serviceManager.serviceClient() + .getAppLinkMembers() + .createOrUpdate(resourceGroupName, appLinkName, appLinkMemberName, this.innerModel(), Context.NONE); + return this; + } + + public AppLinkMember create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppLinkMembers() + .createOrUpdate(resourceGroupName, appLinkName, appLinkMemberName, this.innerModel(), context); + return this; + } + + AppLinkMemberImpl(String name, com.azure.resourcemanager.applink.ApplinkManager serviceManager) { + this.innerObject = new AppLinkMemberInner(); + this.serviceManager = serviceManager; + this.appLinkMemberName = name; + } + + public AppLinkMemberImpl update() { + return this; + } + + public AppLinkMember apply() { + this.innerObject = serviceManager.serviceClient() + .getAppLinkMembers() + .update(resourceGroupName, appLinkName, appLinkMemberName, this.innerModel(), Context.NONE); + return this; + } + + public AppLinkMember apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppLinkMembers() + .update(resourceGroupName, appLinkName, appLinkMemberName, this.innerModel(), context); + return this; + } + + AppLinkMemberImpl(AppLinkMemberInner innerObject, com.azure.resourcemanager.applink.ApplinkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.appLinkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "appLinks"); + this.appLinkMemberName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "appLinkMembers"); + } + + public AppLinkMember refresh() { + this.innerObject = serviceManager.serviceClient() + .getAppLinkMembers() + .getWithResponse(resourceGroupName, appLinkName, appLinkMemberName, Context.NONE) + .getValue(); + return this; + } + + public AppLinkMember refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppLinkMembers() + .getWithResponse(resourceGroupName, appLinkName, appLinkMemberName, context) + .getValue(); + return this; + } + + public AppLinkMemberImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AppLinkMemberImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AppLinkMemberImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public AppLinkMemberImpl withProperties(AppLinkMemberProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersClientImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersClientImpl.java new file mode 100644 index 000000000000..ecca73e63e9e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersClientImpl.java @@ -0,0 +1,974 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.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.applink.fluent.AppLinkMembersClient; +import com.azure.resourcemanager.applink.fluent.models.AppLinkMemberInner; +import com.azure.resourcemanager.applink.implementation.models.AppLinkMemberListResult; +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 AppLinkMembersClient. + */ +public final class AppLinkMembersClientImpl implements AppLinkMembersClient { + /** + * The proxy service used to perform REST calls. + */ + private final AppLinkMembersService service; + + /** + * The service client containing this operation class. + */ + private final ApplinkManagementClientImpl client; + + /** + * Initializes an instance of AppLinkMembersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppLinkMembersClientImpl(ApplinkManagementClientImpl client) { + this.service + = RestProxy.create(AppLinkMembersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApplinkManagementClientAppLinkMembers to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ApplinkManagementClientAppLinkMembers") + public interface AppLinkMembersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}") + @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("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AppLinkMemberInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}") + @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("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AppLinkMemberInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}") + @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("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AppLinkMemberInner properties, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}") + @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("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AppLinkMemberInner properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}") + @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("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}") + @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("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAppLink(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appLinkName") String appLinkName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByAppLinkSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appLinkName") String appLinkName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAppLinkNext( + @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 listByAppLinkNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String appLinkName, + String appLinkMemberName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, appLinkMemberName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String appLinkName, String appLinkMemberName) { + return getWithResponseAsync(resourceGroupName, appLinkName, appLinkMemberName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String appLinkName, + String appLinkMemberName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, appLinkName, appLinkMemberName, accept, context); + } + + /** + * Get an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkMemberInner get(String resourceGroupName, String appLinkName, String appLinkMemberName) { + return getWithResponse(resourceGroupName, appLinkName, appLinkMemberName, Context.NONE).getValue(); + } + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner 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, appLinkName, appLinkMemberName, contentType, accept, + resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String appLinkName, + String appLinkMemberName, AppLinkMemberInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, appLinkMemberName, contentType, accept, + resource, Context.NONE); + } + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String appLinkName, + String appLinkMemberName, AppLinkMemberInner 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, appLinkName, appLinkMemberName, contentType, accept, + resource, context); + } + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppLinkMemberInner> beginCreateOrUpdateAsync( + String resourceGroupName, String appLinkName, String appLinkMemberName, AppLinkMemberInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, appLinkName, appLinkMemberName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AppLinkMemberInner.class, AppLinkMemberInner.class, this.client.getContext()); + } + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppLinkMemberInner> beginCreateOrUpdate(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, appLinkName, appLinkMemberName, resource); + return this.client.getLroResult(response, AppLinkMemberInner.class, + AppLinkMemberInner.class, Context.NONE); + } + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppLinkMemberInner> beginCreateOrUpdate(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, appLinkName, appLinkMemberName, resource, context); + return this.client.getLroResult(response, AppLinkMemberInner.class, + AppLinkMemberInner.class, context); + } + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String appLinkName, + String appLinkMemberName, AppLinkMemberInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, appLinkName, appLinkMemberName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkMemberInner createOrUpdate(String resourceGroupName, String appLinkName, String appLinkMemberName, + AppLinkMemberInner resource) { + return beginCreateOrUpdate(resourceGroupName, appLinkName, appLinkMemberName, resource).getFinalResult(); + } + + /** + * Create an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkMemberInner createOrUpdate(String resourceGroupName, String appLinkName, String appLinkMemberName, + AppLinkMemberInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, appLinkName, appLinkMemberName, resource, context) + .getFinalResult(); + } + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String appLinkName, + String appLinkMemberName, AppLinkMemberInner 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, appLinkName, appLinkMemberName, contentType, accept, + properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String appLinkName, + String appLinkMemberName, AppLinkMemberInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, appLinkMemberName, contentType, accept, + properties, Context.NONE); + } + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String appLinkName, + String appLinkMemberName, AppLinkMemberInner 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, appLinkName, appLinkMemberName, contentType, accept, + properties, context); + } + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppLinkMemberInner> beginUpdateAsync(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, appLinkName, appLinkMemberName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AppLinkMemberInner.class, AppLinkMemberInner.class, this.client.getContext()); + } + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppLinkMemberInner> beginUpdate(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner properties) { + Response response + = updateWithResponse(resourceGroupName, appLinkName, appLinkMemberName, properties); + return this.client.getLroResult(response, AppLinkMemberInner.class, + AppLinkMemberInner.class, Context.NONE); + } + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppLinkMemberInner> beginUpdate(String resourceGroupName, + String appLinkName, String appLinkMemberName, AppLinkMemberInner properties, Context context) { + Response response + = updateWithResponse(resourceGroupName, appLinkName, appLinkMemberName, properties, context); + return this.client.getLroResult(response, AppLinkMemberInner.class, + AppLinkMemberInner.class, context); + } + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String appLinkName, String appLinkMemberName, + AppLinkMemberInner properties) { + return beginUpdateAsync(resourceGroupName, appLinkName, appLinkMemberName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkMemberInner update(String resourceGroupName, String appLinkName, String appLinkMemberName, + AppLinkMemberInner properties) { + return beginUpdate(resourceGroupName, appLinkName, appLinkMemberName, properties).getFinalResult(); + } + + /** + * Update an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLink Member resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkMemberInner update(String resourceGroupName, String appLinkName, String appLinkMemberName, + AppLinkMemberInner properties, Context context) { + return beginUpdate(resourceGroupName, appLinkName, appLinkMemberName, properties, context).getFinalResult(); + } + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, + String appLinkMemberName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, appLinkMemberName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, + String appLinkMemberName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, appLinkMemberName, Context.NONE); + } + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, + String appLinkMemberName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, appLinkMemberName, context); + } + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, + String appLinkMemberName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, appLinkName, appLinkMemberName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, + String appLinkMemberName) { + Response response = deleteWithResponse(resourceGroupName, appLinkName, appLinkMemberName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, + String appLinkMemberName, Context context) { + Response response = deleteWithResponse(resourceGroupName, appLinkName, appLinkMemberName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, String appLinkMemberName) { + return beginDeleteAsync(resourceGroupName, appLinkName, appLinkMemberName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, String appLinkMemberName) { + beginDelete(resourceGroupName, appLinkName, appLinkMemberName).getFinalResult(); + } + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, String appLinkMemberName, Context context) { + beginDelete(resourceGroupName, appLinkName, appLinkMemberName, context).getFinalResult(); + } + + /** + * List AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAppLinkSinglePageAsync(String resourceGroupName, + String appLinkName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByAppLink(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, 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 AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAppLinkAsync(String resourceGroupName, String appLinkName) { + return new PagedFlux<>(() -> listByAppLinkSinglePageAsync(resourceGroupName, appLinkName), + nextLink -> listByAppLinkNextSinglePageAsync(nextLink)); + } + + /** + * List AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAppLinkSinglePage(String resourceGroupName, String appLinkName) { + final String accept = "application/json"; + Response res + = service.listByAppLinkSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAppLinkSinglePage(String resourceGroupName, String appLinkName, + Context context) { + final String accept = "application/json"; + Response res + = service.listByAppLinkSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAppLink(String resourceGroupName, String appLinkName) { + return new PagedIterable<>(() -> listByAppLinkSinglePage(resourceGroupName, appLinkName), + nextLink -> listByAppLinkNextSinglePage(nextLink)); + } + + /** + * List AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAppLink(String resourceGroupName, String appLinkName, + Context context) { + return new PagedIterable<>(() -> listByAppLinkSinglePage(resourceGroupName, appLinkName, context), + nextLink -> listByAppLinkNextSinglePage(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 the response of a AppLinkMember list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAppLinkNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByAppLinkNext(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 AppLinkMember list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAppLinkNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByAppLinkNextSync(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 AppLinkMember list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAppLinkNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByAppLinkNextSync(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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersImpl.java new file mode 100644 index 000000000000..5fda65213409 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.AppLinkMembersClient; +import com.azure.resourcemanager.applink.fluent.models.AppLinkMemberInner; +import com.azure.resourcemanager.applink.models.AppLinkMember; +import com.azure.resourcemanager.applink.models.AppLinkMembers; + +public final class AppLinkMembersImpl implements AppLinkMembers { + private static final ClientLogger LOGGER = new ClientLogger(AppLinkMembersImpl.class); + + private final AppLinkMembersClient innerClient; + + private final com.azure.resourcemanager.applink.ApplinkManager serviceManager; + + public AppLinkMembersImpl(AppLinkMembersClient innerClient, + com.azure.resourcemanager.applink.ApplinkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String appLinkName, + String appLinkMemberName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, appLinkName, appLinkMemberName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AppLinkMemberImpl(inner.getValue(), this.manager())); + } + + public AppLinkMember get(String resourceGroupName, String appLinkName, String appLinkMemberName) { + AppLinkMemberInner inner = this.serviceClient().get(resourceGroupName, appLinkName, appLinkMemberName); + if (inner != null) { + return new AppLinkMemberImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String appLinkName, String appLinkMemberName) { + this.serviceClient().delete(resourceGroupName, appLinkName, appLinkMemberName); + } + + public void delete(String resourceGroupName, String appLinkName, String appLinkMemberName, Context context) { + this.serviceClient().delete(resourceGroupName, appLinkName, appLinkMemberName, context); + } + + public PagedIterable listByAppLink(String resourceGroupName, String appLinkName) { + PagedIterable inner = this.serviceClient().listByAppLink(resourceGroupName, appLinkName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppLinkMemberImpl(inner1, this.manager())); + } + + public PagedIterable listByAppLink(String resourceGroupName, String appLinkName, Context context) { + PagedIterable inner + = this.serviceClient().listByAppLink(resourceGroupName, appLinkName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppLinkMemberImpl(inner1, this.manager())); + } + + public AppLinkMember 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 appLinkName = ResourceManagerUtils.getValueFromIdByName(id, "appLinks"); + if (appLinkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinks'.", id))); + } + String appLinkMemberName = ResourceManagerUtils.getValueFromIdByName(id, "appLinkMembers"); + if (appLinkMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinkMembers'.", id))); + } + return this.getWithResponse(resourceGroupName, appLinkName, appLinkMemberName, 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 appLinkName = ResourceManagerUtils.getValueFromIdByName(id, "appLinks"); + if (appLinkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinks'.", id))); + } + String appLinkMemberName = ResourceManagerUtils.getValueFromIdByName(id, "appLinkMembers"); + if (appLinkMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinkMembers'.", id))); + } + return this.getWithResponse(resourceGroupName, appLinkName, appLinkMemberName, 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 appLinkName = ResourceManagerUtils.getValueFromIdByName(id, "appLinks"); + if (appLinkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinks'.", id))); + } + String appLinkMemberName = ResourceManagerUtils.getValueFromIdByName(id, "appLinkMembers"); + if (appLinkMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinkMembers'.", id))); + } + this.delete(resourceGroupName, appLinkName, appLinkMemberName, 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 appLinkName = ResourceManagerUtils.getValueFromIdByName(id, "appLinks"); + if (appLinkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinks'.", id))); + } + String appLinkMemberName = ResourceManagerUtils.getValueFromIdByName(id, "appLinkMembers"); + if (appLinkMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinkMembers'.", id))); + } + this.delete(resourceGroupName, appLinkName, appLinkMemberName, context); + } + + private AppLinkMembersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.applink.ApplinkManager manager() { + return this.serviceManager; + } + + public AppLinkMemberImpl define(String name) { + return new AppLinkMemberImpl(name, this.manager()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksClientImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksClientImpl.java new file mode 100644 index 000000000000..5d9d6bfc0073 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksClientImpl.java @@ -0,0 +1,1088 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.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.applink.fluent.AppLinksClient; +import com.azure.resourcemanager.applink.fluent.models.AppLinkInner; +import com.azure.resourcemanager.applink.implementation.models.AppLinkListResult; +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 AppLinksClient. + */ +public final class AppLinksClientImpl implements AppLinksClient { + /** + * The proxy service used to perform REST calls. + */ + private final AppLinksService service; + + /** + * The service client containing this operation class. + */ + private final ApplinkManagementClientImpl client; + + /** + * Initializes an instance of AppLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppLinksClientImpl(ApplinkManagementClientImpl client) { + this.service = RestProxy.create(AppLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApplinkManagementClientAppLinks to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ApplinkManagementClientAppLinks") + public interface AppLinksService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}") + @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("appLinkName") String appLinkName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}") + @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("appLinkName") String appLinkName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}") + @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("appLinkName") String appLinkName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AppLinkInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}") + @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("appLinkName") String appLinkName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AppLinkInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}") + @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("appLinkName") String appLinkName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AppLinkInner properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}") + @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("appLinkName") String appLinkName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AppLinkInner properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}") + @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("appLinkName") String appLinkName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}") + @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("appLinkName") String appLinkName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks") + @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/Microsoft.AppLink/appLinks") + @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/Microsoft.AppLink/appLinks") + @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/Microsoft.AppLink/appLinks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String appLinkName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String appLinkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, appLinkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String appLinkName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, accept, context); + } + + /** + * Get an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkInner getByResourceGroup(String resourceGroupName, String appLinkName) { + return getByResourceGroupWithResponse(resourceGroupName, appLinkName, Context.NONE).getValue(); + } + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String appLinkName, AppLinkInner 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, appLinkName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String appLinkName, + AppLinkInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String appLinkName, + AppLinkInner 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, appLinkName, contentType, accept, resource, context); + } + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppLinkInner> beginCreateOrUpdateAsync(String resourceGroupName, + String appLinkName, AppLinkInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, appLinkName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AppLinkInner.class, AppLinkInner.class, this.client.getContext()); + } + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppLinkInner> beginCreateOrUpdate(String resourceGroupName, + String appLinkName, AppLinkInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, appLinkName, resource); + return this.client.getLroResult(response, AppLinkInner.class, AppLinkInner.class, + Context.NONE); + } + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppLinkInner> beginCreateOrUpdate(String resourceGroupName, + String appLinkName, AppLinkInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, appLinkName, resource, context); + return this.client.getLroResult(response, AppLinkInner.class, AppLinkInner.class, + context); + } + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String appLinkName, + AppLinkInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, appLinkName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkInner createOrUpdate(String resourceGroupName, String appLinkName, AppLinkInner resource) { + return beginCreateOrUpdate(resourceGroupName, appLinkName, resource).getFinalResult(); + } + + /** + * Create an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkInner createOrUpdate(String resourceGroupName, String appLinkName, AppLinkInner resource, + Context context) { + return beginCreateOrUpdate(resourceGroupName, appLinkName, resource, context).getFinalResult(); + } + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String appLinkName, + AppLinkInner 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, appLinkName, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String appLinkName, + AppLinkInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, contentType, accept, properties, + Context.NONE); + } + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String appLinkName, + AppLinkInner 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, appLinkName, contentType, accept, properties, context); + } + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppLinkInner> beginUpdateAsync(String resourceGroupName, + String appLinkName, AppLinkInner properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, appLinkName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AppLinkInner.class, AppLinkInner.class, this.client.getContext()); + } + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppLinkInner> beginUpdate(String resourceGroupName, String appLinkName, + AppLinkInner properties) { + Response response = updateWithResponse(resourceGroupName, appLinkName, properties); + return this.client.getLroResult(response, AppLinkInner.class, AppLinkInner.class, + Context.NONE); + } + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppLinkInner> beginUpdate(String resourceGroupName, String appLinkName, + AppLinkInner properties, Context context) { + Response response = updateWithResponse(resourceGroupName, appLinkName, properties, context); + return this.client.getLroResult(response, AppLinkInner.class, AppLinkInner.class, + context); + } + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String appLinkName, AppLinkInner properties) { + return beginUpdateAsync(resourceGroupName, appLinkName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkInner update(String resourceGroupName, String appLinkName, AppLinkInner properties) { + return beginUpdate(resourceGroupName, appLinkName, properties).getFinalResult(); + } + + /** + * Update an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLink resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppLinkInner update(String resourceGroupName, String appLinkName, AppLinkInner properties, Context context) { + return beginUpdate(resourceGroupName, appLinkName, properties, context).getFinalResult(); + } + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, Context.NONE); + } + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, context); + } + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, appLinkName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName) { + Response response = deleteWithResponse(resourceGroupName, appLinkName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, appLinkName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName) { + return beginDeleteAsync(resourceGroupName, appLinkName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName) { + beginDelete(resourceGroupName, appLinkName).getFinalResult(); + } + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName, Context context) { + beginDelete(resourceGroupName, appLinkName, context).getFinalResult(); + } + + /** + * List AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink resources by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink 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 AppLink resources by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List AppLink resources by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink 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 AppLink resources by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink 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 AppLink resources by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List AppLink resources by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink 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)); + } + + /** + * 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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 AppLink 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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksImpl.java new file mode 100644 index 000000000000..bd077a74ae0f --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksImpl.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.AppLinksClient; +import com.azure.resourcemanager.applink.fluent.models.AppLinkInner; +import com.azure.resourcemanager.applink.models.AppLink; +import com.azure.resourcemanager.applink.models.AppLinks; + +public final class AppLinksImpl implements AppLinks { + private static final ClientLogger LOGGER = new ClientLogger(AppLinksImpl.class); + + private final AppLinksClient innerClient; + + private final com.azure.resourcemanager.applink.ApplinkManager serviceManager; + + public AppLinksImpl(AppLinksClient innerClient, com.azure.resourcemanager.applink.ApplinkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String appLinkName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, appLinkName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AppLinkImpl(inner.getValue(), this.manager())); + } + + public AppLink getByResourceGroup(String resourceGroupName, String appLinkName) { + AppLinkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, appLinkName); + if (inner != null) { + return new AppLinkImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String appLinkName) { + this.serviceClient().delete(resourceGroupName, appLinkName); + } + + public void delete(String resourceGroupName, String appLinkName, Context context) { + this.serviceClient().delete(resourceGroupName, appLinkName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppLinkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppLinkImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppLinkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppLinkImpl(inner1, this.manager())); + } + + public AppLink 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 appLinkName = ResourceManagerUtils.getValueFromIdByName(id, "appLinks"); + if (appLinkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, appLinkName, 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 appLinkName = ResourceManagerUtils.getValueFromIdByName(id, "appLinks"); + if (appLinkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, appLinkName, 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 appLinkName = ResourceManagerUtils.getValueFromIdByName(id, "appLinks"); + if (appLinkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinks'.", id))); + } + this.delete(resourceGroupName, appLinkName, 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 appLinkName = ResourceManagerUtils.getValueFromIdByName(id, "appLinks"); + if (appLinkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appLinks'.", id))); + } + this.delete(resourceGroupName, appLinkName, context); + } + + private AppLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.applink.ApplinkManager manager() { + return this.serviceManager; + } + + public AppLinkImpl define(String name) { + return new AppLinkImpl(name, this.manager()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientBuilder.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientBuilder.java new file mode 100644 index 000000000000..8e9b6baf9692 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientBuilder.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.applink.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 ApplinkManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ApplinkManagementClientImpl.class }) +public final class ApplinkManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the ApplinkManagementClientBuilder. + */ + public ApplinkManagementClientBuilder 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 ApplinkManagementClientBuilder. + */ + public ApplinkManagementClientBuilder 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 ApplinkManagementClientBuilder. + */ + public ApplinkManagementClientBuilder 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 ApplinkManagementClientBuilder. + */ + public ApplinkManagementClientBuilder 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 ApplinkManagementClientBuilder. + */ + public ApplinkManagementClientBuilder 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 ApplinkManagementClientBuilder. + */ + public ApplinkManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ApplinkManagementClientImpl with the provided parameters. + * + * @return an instance of ApplinkManagementClientImpl. + */ + public ApplinkManagementClientImpl 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(); + ApplinkManagementClientImpl client = new ApplinkManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientImpl.java new file mode 100644 index 000000000000..b50238d0fafc --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientImpl.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.AppLinkMembersClient; +import com.azure.resourcemanager.applink.fluent.AppLinksClient; +import com.azure.resourcemanager.applink.fluent.ApplinkManagementClient; +import com.azure.resourcemanager.applink.fluent.AvailableVersionsClient; +import com.azure.resourcemanager.applink.fluent.OperationsClient; +import com.azure.resourcemanager.applink.fluent.UpgradeHistoriesClient; +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 ApplinkManagementClientImpl type. + */ +@ServiceClient(builder = ApplinkManagementClientBuilder.class) +public final class ApplinkManagementClientImpl implements ApplinkManagementClient { + /** + * 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 AppLinksClient object to access its operations. + */ + private final AppLinksClient appLinks; + + /** + * Gets the AppLinksClient object to access its operations. + * + * @return the AppLinksClient object. + */ + public AppLinksClient getAppLinks() { + return this.appLinks; + } + + /** + * The AppLinkMembersClient object to access its operations. + */ + private final AppLinkMembersClient appLinkMembers; + + /** + * Gets the AppLinkMembersClient object to access its operations. + * + * @return the AppLinkMembersClient object. + */ + public AppLinkMembersClient getAppLinkMembers() { + return this.appLinkMembers; + } + + /** + * The UpgradeHistoriesClient object to access its operations. + */ + private final UpgradeHistoriesClient upgradeHistories; + + /** + * Gets the UpgradeHistoriesClient object to access its operations. + * + * @return the UpgradeHistoriesClient object. + */ + public UpgradeHistoriesClient getUpgradeHistories() { + return this.upgradeHistories; + } + + /** + * The AvailableVersionsClient object to access its operations. + */ + private final AvailableVersionsClient availableVersions; + + /** + * Gets the AvailableVersionsClient object to access its operations. + * + * @return the AvailableVersionsClient object. + */ + public AvailableVersionsClient getAvailableVersions() { + return this.availableVersions; + } + + /** + * Initializes an instance of ApplinkManagementClient 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. + */ + ApplinkManagementClientImpl(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-08-01-preview"; + this.operations = new OperationsClientImpl(this); + this.appLinks = new AppLinksClientImpl(this); + this.appLinkMembers = new AppLinkMembersClientImpl(this); + this.upgradeHistories = new UpgradeHistoriesClientImpl(this); + this.availableVersions = new AvailableVersionsClientImpl(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(ApplinkManagementClientImpl.class); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionImpl.java new file mode 100644 index 000000000000..84eb2d1c0fa2 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionImpl.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.applink.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.applink.fluent.models.AvailableVersionInner; +import com.azure.resourcemanager.applink.models.AvailableVersion; +import com.azure.resourcemanager.applink.models.AvailableVersionProperties; + +public final class AvailableVersionImpl implements AvailableVersion { + private AvailableVersionInner innerObject; + + private final com.azure.resourcemanager.applink.ApplinkManager serviceManager; + + AvailableVersionImpl(AvailableVersionInner innerObject, + com.azure.resourcemanager.applink.ApplinkManager 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 AvailableVersionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AvailableVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.applink.ApplinkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsClientImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsClientImpl.java new file mode 100644 index 000000000000..0d27f6d3952b --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsClientImpl.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.AvailableVersionsClient; +import com.azure.resourcemanager.applink.fluent.models.AvailableVersionInner; +import com.azure.resourcemanager.applink.implementation.models.AvailableVersionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AvailableVersionsClient. + */ +public final class AvailableVersionsClientImpl implements AvailableVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AvailableVersionsService service; + + /** + * The service client containing this operation class. + */ + private final ApplinkManagementClientImpl client; + + /** + * Initializes an instance of AvailableVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableVersionsClientImpl(ApplinkManagementClientImpl client) { + this.service + = RestProxy.create(AvailableVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApplinkManagementClientAvailableVersions to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ApplinkManagementClientAvailableVersions") + public interface AvailableVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppLink/locations/{location}/availableVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @QueryParam("kubernetesVersion") String kubernetesVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppLink/locations/{location}/availableVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByLocationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @QueryParam("kubernetesVersion") String kubernetesVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocationNext( + @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 listByLocationNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @param kubernetesVersion Kubernetes version to filter profiles. + * @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 AvailableVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location, + String kubernetesVersion) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByLocation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, kubernetesVersion, 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 AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @param kubernetesVersion Kubernetes version to filter profiles. + * @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 AvailableVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location, String kubernetesVersion) { + return new PagedFlux<>(() -> listByLocationSinglePageAsync(location, kubernetesVersion), + nextLink -> listByLocationNextSinglePageAsync(nextLink)); + } + + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @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 AvailableVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location) { + final String kubernetesVersion = null; + return new PagedFlux<>(() -> listByLocationSinglePageAsync(location, kubernetesVersion), + nextLink -> listByLocationNextSinglePageAsync(nextLink)); + } + + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @param kubernetesVersion Kubernetes version to filter profiles. + * @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 AvailableVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByLocationSinglePage(String location, String kubernetesVersion) { + final String accept = "application/json"; + Response res + = service.listByLocationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, kubernetesVersion, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @param kubernetesVersion Kubernetes version to filter profiles. + * @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 AvailableVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByLocationSinglePage(String location, String kubernetesVersion, + Context context) { + final String accept = "application/json"; + Response res = service.listByLocationSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, kubernetesVersion, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @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 AvailableVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location) { + final String kubernetesVersion = null; + return new PagedIterable<>(() -> listByLocationSinglePage(location, kubernetesVersion), + nextLink -> listByLocationNextSinglePage(nextLink)); + } + + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @param kubernetesVersion Kubernetes version to filter profiles. + * @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 AvailableVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location, String kubernetesVersion, + Context context) { + return new PagedIterable<>(() -> listByLocationSinglePage(location, kubernetesVersion, context), + nextLink -> listByLocationNextSinglePage(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 the response of a AvailableVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByLocationNext(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 AvailableVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByLocationNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByLocationNextSync(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 AvailableVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByLocationNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByLocationNextSync(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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsImpl.java new file mode 100644 index 000000000000..45e8c5682a2b --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsImpl.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.applink.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.applink.fluent.AvailableVersionsClient; +import com.azure.resourcemanager.applink.fluent.models.AvailableVersionInner; +import com.azure.resourcemanager.applink.models.AvailableVersion; +import com.azure.resourcemanager.applink.models.AvailableVersions; + +public final class AvailableVersionsImpl implements AvailableVersions { + private static final ClientLogger LOGGER = new ClientLogger(AvailableVersionsImpl.class); + + private final AvailableVersionsClient innerClient; + + private final com.azure.resourcemanager.applink.ApplinkManager serviceManager; + + public AvailableVersionsImpl(AvailableVersionsClient innerClient, + com.azure.resourcemanager.applink.ApplinkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLocation(String location) { + PagedIterable inner = this.serviceClient().listByLocation(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailableVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByLocation(String location, String kubernetesVersion, Context context) { + PagedIterable inner + = this.serviceClient().listByLocation(location, kubernetesVersion, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailableVersionImpl(inner1, this.manager())); + } + + private AvailableVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.applink.ApplinkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationImpl.java new file mode 100644 index 000000000000..d834e39dba26 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationImpl.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.applink.implementation; + +import com.azure.resourcemanager.applink.fluent.models.OperationInner; +import com.azure.resourcemanager.applink.models.ActionType; +import com.azure.resourcemanager.applink.models.Operation; +import com.azure.resourcemanager.applink.models.OperationDisplay; +import com.azure.resourcemanager.applink.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.applink.ApplinkManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.applink.ApplinkManager 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.applink.ApplinkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationsClientImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..cc319fde6f2c --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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.applink.fluent.OperationsClient; +import com.azure.resourcemanager.applink.fluent.models.OperationInner; +import com.azure.resourcemanager.applink.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 ApplinkManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ApplinkManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApplinkManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ApplinkManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AppLink/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/Microsoft.AppLink/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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationsImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/OperationsImpl.java new file mode 100644 index 000000000000..96f6c3de1ed1 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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.applink.fluent.OperationsClient; +import com.azure.resourcemanager.applink.fluent.models.OperationInner; +import com.azure.resourcemanager.applink.models.Operation; +import com.azure.resourcemanager.applink.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.applink.ApplinkManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.applink.ApplinkManager 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.applink.ApplinkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ResourceManagerUtils.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..fdf513963058 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesClientImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesClientImpl.java new file mode 100644 index 000000000000..68eb492d5d9f --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesClientImpl.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.UpgradeHistoriesClient; +import com.azure.resourcemanager.applink.fluent.models.UpgradeHistoryInner; +import com.azure.resourcemanager.applink.implementation.models.UpgradeHistoryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in UpgradeHistoriesClient. + */ +public final class UpgradeHistoriesClientImpl implements UpgradeHistoriesClient { + /** + * The proxy service used to perform REST calls. + */ + private final UpgradeHistoriesService service; + + /** + * The service client containing this operation class. + */ + private final ApplinkManagementClientImpl client; + + /** + * Initializes an instance of UpgradeHistoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpgradeHistoriesClientImpl(ApplinkManagementClientImpl client) { + this.service + = RestProxy.create(UpgradeHistoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApplinkManagementClientUpgradeHistories to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ApplinkManagementClientUpgradeHistories") + public interface UpgradeHistoriesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}/upgradeHistories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAppLinkMember(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/appLinks/{appLinkName}/appLinkMembers/{appLinkMemberName}/upgradeHistories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByAppLinkMemberSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appLinkName") String appLinkName, + @PathParam("appLinkMemberName") String appLinkMemberName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAppLinkMemberNext( + @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 listByAppLinkMemberNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAppLinkMemberSinglePageAsync(String resourceGroupName, + String appLinkName, String appLinkMemberName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByAppLinkMember(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, appLinkMemberName, 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 UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAppLinkMemberAsync(String resourceGroupName, String appLinkName, + String appLinkMemberName) { + return new PagedFlux<>( + () -> listByAppLinkMemberSinglePageAsync(resourceGroupName, appLinkName, appLinkMemberName), + nextLink -> listByAppLinkMemberNextSinglePageAsync(nextLink)); + } + + /** + * List UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAppLinkMemberSinglePage(String resourceGroupName, + String appLinkName, String appLinkMemberName) { + final String accept = "application/json"; + Response res = service.listByAppLinkMemberSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, appLinkName, + appLinkMemberName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAppLinkMemberSinglePage(String resourceGroupName, + String appLinkName, String appLinkMemberName, Context context) { + final String accept = "application/json"; + Response res + = service.listByAppLinkMemberSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appLinkName, appLinkMemberName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAppLinkMember(String resourceGroupName, String appLinkName, + String appLinkMemberName) { + return new PagedIterable<>( + () -> listByAppLinkMemberSinglePage(resourceGroupName, appLinkName, appLinkMemberName), + nextLink -> listByAppLinkMemberNextSinglePage(nextLink)); + } + + /** + * List UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAppLinkMember(String resourceGroupName, String appLinkName, + String appLinkMemberName, Context context) { + return new PagedIterable<>( + () -> listByAppLinkMemberSinglePage(resourceGroupName, appLinkName, appLinkMemberName, context), + nextLink -> listByAppLinkMemberNextSinglePage(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 the response of a UpgradeHistory list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAppLinkMemberNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByAppLinkMemberNext(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 UpgradeHistory list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAppLinkMemberNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByAppLinkMemberNextSync(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 UpgradeHistory list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAppLinkMemberNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByAppLinkMemberNextSync(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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesImpl.java new file mode 100644 index 000000000000..4f2724c5fd1e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesImpl.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.applink.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.applink.fluent.UpgradeHistoriesClient; +import com.azure.resourcemanager.applink.fluent.models.UpgradeHistoryInner; +import com.azure.resourcemanager.applink.models.UpgradeHistories; +import com.azure.resourcemanager.applink.models.UpgradeHistory; + +public final class UpgradeHistoriesImpl implements UpgradeHistories { + private static final ClientLogger LOGGER = new ClientLogger(UpgradeHistoriesImpl.class); + + private final UpgradeHistoriesClient innerClient; + + private final com.azure.resourcemanager.applink.ApplinkManager serviceManager; + + public UpgradeHistoriesImpl(UpgradeHistoriesClient innerClient, + com.azure.resourcemanager.applink.ApplinkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByAppLinkMember(String resourceGroupName, String appLinkName, + String appLinkMemberName) { + PagedIterable inner + = this.serviceClient().listByAppLinkMember(resourceGroupName, appLinkName, appLinkMemberName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UpgradeHistoryImpl(inner1, this.manager())); + } + + public PagedIterable listByAppLinkMember(String resourceGroupName, String appLinkName, + String appLinkMemberName, Context context) { + PagedIterable inner + = this.serviceClient().listByAppLinkMember(resourceGroupName, appLinkName, appLinkMemberName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UpgradeHistoryImpl(inner1, this.manager())); + } + + private UpgradeHistoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.applink.ApplinkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoryImpl.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoryImpl.java new file mode 100644 index 000000000000..0935e4f670f7 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoryImpl.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.applink.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.applink.fluent.models.UpgradeHistoryInner; +import com.azure.resourcemanager.applink.models.UpgradeHistory; +import com.azure.resourcemanager.applink.models.UpgradeHistoryProperties; + +public final class UpgradeHistoryImpl implements UpgradeHistory { + private UpgradeHistoryInner innerObject; + + private final com.azure.resourcemanager.applink.ApplinkManager serviceManager; + + UpgradeHistoryImpl(UpgradeHistoryInner innerObject, + com.azure.resourcemanager.applink.ApplinkManager 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 UpgradeHistoryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public UpgradeHistoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.applink.ApplinkManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkListResult.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkListResult.java new file mode 100644 index 000000000000..6e0ec40ff7b1 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.models.AppLinkInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AppLink list operation. + */ +@Immutable +public final class AppLinkListResult implements JsonSerializable { + /* + * The AppLink items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AppLinkListResult class. + */ + private AppLinkListResult() { + } + + /** + * Get the value property: The AppLink 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 AppLinkListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppLinkListResult 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 AppLinkListResult. + */ + public static AppLinkListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppLinkListResult deserializedAppLinkListResult = new AppLinkListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AppLinkInner.fromJson(reader1)); + deserializedAppLinkListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAppLinkListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppLinkListResult; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkMemberListResult.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkMemberListResult.java new file mode 100644 index 000000000000..181bc3e59063 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkMemberListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.fluent.models.AppLinkMemberInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AppLinkMember list operation. + */ +@Immutable +public final class AppLinkMemberListResult implements JsonSerializable { + /* + * The AppLinkMember items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AppLinkMemberListResult class. + */ + private AppLinkMemberListResult() { + } + + /** + * Get the value property: The AppLinkMember 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 AppLinkMemberListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppLinkMemberListResult 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 AppLinkMemberListResult. + */ + public static AppLinkMemberListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppLinkMemberListResult deserializedAppLinkMemberListResult = new AppLinkMemberListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AppLinkMemberInner.fromJson(reader1)); + deserializedAppLinkMemberListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAppLinkMemberListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppLinkMemberListResult; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AvailableVersionListResult.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AvailableVersionListResult.java new file mode 100644 index 000000000000..83b5d5f4d5da --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/AvailableVersionListResult.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.applink.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.applink.fluent.models.AvailableVersionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AvailableVersion list operation. + */ +@Immutable +public final class AvailableVersionListResult implements JsonSerializable { + /* + * The AvailableVersion items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AvailableVersionListResult class. + */ + private AvailableVersionListResult() { + } + + /** + * Get the value property: The AvailableVersion 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 AvailableVersionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableVersionListResult 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 AvailableVersionListResult. + */ + public static AvailableVersionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableVersionListResult deserializedAvailableVersionListResult = new AvailableVersionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvailableVersionInner.fromJson(reader1)); + deserializedAvailableVersionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvailableVersionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableVersionListResult; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/OperationListResult.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..1c96a0411601 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/UpgradeHistoryListResult.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/UpgradeHistoryListResult.java new file mode 100644 index 000000000000..a269ff46a35c --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/models/UpgradeHistoryListResult.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.applink.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.applink.fluent.models.UpgradeHistoryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a UpgradeHistory list operation. + */ +@Immutable +public final class UpgradeHistoryListResult implements JsonSerializable { + /* + * The UpgradeHistory items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of UpgradeHistoryListResult class. + */ + private UpgradeHistoryListResult() { + } + + /** + * Get the value property: The UpgradeHistory 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 UpgradeHistoryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpgradeHistoryListResult 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 UpgradeHistoryListResult. + */ + public static UpgradeHistoryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpgradeHistoryListResult deserializedUpgradeHistoryListResult = new UpgradeHistoryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> UpgradeHistoryInner.fromJson(reader1)); + deserializedUpgradeHistoryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUpgradeHistoryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUpgradeHistoryListResult; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/package-info.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/package-info.java new file mode 100644 index 000000000000..1d466f1effea --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/implementation/package-info.java @@ -0,0 +1,9 @@ +// 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 ApplinkManagementClient. + * Microsoft.AppLink Resource Provider management API. + */ +package com.azure.resourcemanager.applink.implementation; diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ActionType.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ActionType.java new file mode 100644 index 000000000000..3254ea0f363f --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLink.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLink.java new file mode 100644 index 000000000000..39b6a0c8942e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLink.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.applink.fluent.models.AppLinkInner; +import java.util.Map; + +/** + * An immutable client-side representation of AppLink. + */ +public interface AppLink { + /** + * 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. + */ + AppLinkProperties 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.applink.fluent.models.AppLinkInner object. + * + * @return the inner object. + */ + AppLinkInner innerModel(); + + /** + * The entirety of the AppLink definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The AppLink definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AppLink definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the AppLink 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 AppLink 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 AppLink 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. + */ + AppLink create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AppLink create(Context context); + } + + /** + * The stage of the AppLink 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 AppLink 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(AppLinkProperties properties); + } + + /** + * The stage of the AppLink 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 AppLink resource. + * + * @return the stage of resource update. + */ + AppLink.Update update(); + + /** + * The template for AppLink update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AppLink apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AppLink apply(Context context); + } + + /** + * The AppLink update stages. + */ + interface UpdateStages { + /** + * The stage of the AppLink 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 AppLink update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(AppLinkProperties properties); + } + + /** + * The stage of the AppLink 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. + */ + AppLink refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AppLink refresh(Context context); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMember.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMember.java new file mode 100644 index 000000000000..ff0b6a9522ed --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMember.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.applink.fluent.models.AppLinkMemberInner; +import java.util.Map; + +/** + * An immutable client-side representation of AppLinkMember. + */ +public interface AppLinkMember { + /** + * 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. + */ + AppLinkMemberProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.applink.fluent.models.AppLinkMemberInner object. + * + * @return the inner object. + */ + AppLinkMemberInner innerModel(); + + /** + * The entirety of the AppLinkMember definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AppLinkMember definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AppLinkMember definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the AppLinkMember 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** + * The stage of the AppLinkMember definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, appLinkName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @return the next definition stage. + */ + WithCreate withExistingAppLink(String resourceGroupName, String appLinkName); + } + + /** + * The stage of the AppLinkMember definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + AppLinkMember create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AppLinkMember create(Context context); + } + + /** + * The stage of the AppLinkMember 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 AppLinkMember 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(AppLinkMemberProperties properties); + } + } + + /** + * Begins update for the AppLinkMember resource. + * + * @return the stage of resource update. + */ + AppLinkMember.Update update(); + + /** + * The template for AppLinkMember update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AppLinkMember apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AppLinkMember apply(Context context); + } + + /** + * The AppLinkMember update stages. + */ + interface UpdateStages { + /** + * The stage of the AppLinkMember 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 AppLinkMember update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(AppLinkMemberProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AppLinkMember refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AppLinkMember refresh(Context context); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMemberProperties.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMemberProperties.java new file mode 100644 index 000000000000..b96796a73f80 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMemberProperties.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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; + +/** + * AppLink Member properties. + */ +@Fluent +public final class AppLinkMemberProperties implements JsonSerializable { + /* + * Cluster type + */ + private ClusterType clusterType; + + /* + * AppLink Member Metadata + */ + private Metadata metadata; + + /* + * Upgrade profile. + */ + private UpgradeProfile upgradeProfile; + + /* + * Observability profile + */ + private ObservabilityProfile observabilityProfile; + + /* + * Connectivity profile. + */ + private ConnectivityProfile connectivityProfile; + + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AppLinkMemberProperties class. + */ + public AppLinkMemberProperties() { + } + + /** + * Get the clusterType property: Cluster type. + * + * @return the clusterType value. + */ + public ClusterType clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: Cluster type. + * + * @param clusterType the clusterType value to set. + * @return the AppLinkMemberProperties object itself. + */ + public AppLinkMemberProperties withClusterType(ClusterType clusterType) { + this.clusterType = clusterType; + return this; + } + + /** + * Get the metadata property: AppLink Member Metadata. + * + * @return the metadata value. + */ + public Metadata metadata() { + return this.metadata; + } + + /** + * Set the metadata property: AppLink Member Metadata. + * + * @param metadata the metadata value to set. + * @return the AppLinkMemberProperties object itself. + */ + public AppLinkMemberProperties withMetadata(Metadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the upgradeProfile property: Upgrade profile. + * + * @return the upgradeProfile value. + */ + public UpgradeProfile upgradeProfile() { + return this.upgradeProfile; + } + + /** + * Set the upgradeProfile property: Upgrade profile. + * + * @param upgradeProfile the upgradeProfile value to set. + * @return the AppLinkMemberProperties object itself. + */ + public AppLinkMemberProperties withUpgradeProfile(UpgradeProfile upgradeProfile) { + this.upgradeProfile = upgradeProfile; + return this; + } + + /** + * Get the observabilityProfile property: Observability profile. + * + * @return the observabilityProfile value. + */ + public ObservabilityProfile observabilityProfile() { + return this.observabilityProfile; + } + + /** + * Set the observabilityProfile property: Observability profile. + * + * @param observabilityProfile the observabilityProfile value to set. + * @return the AppLinkMemberProperties object itself. + */ + public AppLinkMemberProperties withObservabilityProfile(ObservabilityProfile observabilityProfile) { + this.observabilityProfile = observabilityProfile; + return this; + } + + /** + * Get the connectivityProfile property: Connectivity profile. + * + * @return the connectivityProfile value. + */ + public ConnectivityProfile connectivityProfile() { + return this.connectivityProfile; + } + + /** + * Set the connectivityProfile property: Connectivity profile. + * + * @param connectivityProfile the connectivityProfile value to set. + * @return the AppLinkMemberProperties object itself. + */ + public AppLinkMemberProperties withConnectivityProfile(ConnectivityProfile connectivityProfile) { + this.connectivityProfile = connectivityProfile; + return this; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeStringField("clusterType", this.clusterType == null ? null : this.clusterType.toString()); + jsonWriter.writeJsonField("upgradeProfile", this.upgradeProfile); + jsonWriter.writeJsonField("observabilityProfile", this.observabilityProfile); + jsonWriter.writeJsonField("connectivityProfile", this.connectivityProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppLinkMemberProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppLinkMemberProperties 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 AppLinkMemberProperties. + */ + public static AppLinkMemberProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppLinkMemberProperties deserializedAppLinkMemberProperties = new AppLinkMemberProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + deserializedAppLinkMemberProperties.metadata = Metadata.fromJson(reader); + } else if ("clusterType".equals(fieldName)) { + deserializedAppLinkMemberProperties.clusterType = ClusterType.fromString(reader.getString()); + } else if ("upgradeProfile".equals(fieldName)) { + deserializedAppLinkMemberProperties.upgradeProfile = UpgradeProfile.fromJson(reader); + } else if ("observabilityProfile".equals(fieldName)) { + deserializedAppLinkMemberProperties.observabilityProfile = ObservabilityProfile.fromJson(reader); + } else if ("connectivityProfile".equals(fieldName)) { + deserializedAppLinkMemberProperties.connectivityProfile = ConnectivityProfile.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedAppLinkMemberProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAppLinkMemberProperties; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMembers.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMembers.java new file mode 100644 index 000000000000..192c91d4a055 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkMembers.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.applink.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 AppLinkMembers. + */ +public interface AppLinkMembers { + /** + * Get an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String appLinkName, String appLinkMemberName, + Context context); + + /** + * Get an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember. + */ + AppLinkMember get(String resourceGroupName, String appLinkName, String appLinkMemberName); + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, String appLinkMemberName); + + /** + * Delete an AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 appLinkName, String appLinkMemberName, Context context); + + /** + * List AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAppLink(String resourceGroupName, String appLinkName); + + /** + * List AppLinkMember resources by AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 AppLinkMember list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAppLink(String resourceGroupName, String appLinkName, Context context); + + /** + * Get an AppLinkMember. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember along with {@link Response}. + */ + AppLinkMember getById(String id); + + /** + * Get an AppLinkMember. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLinkMember along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an AppLinkMember. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an AppLinkMember. + * + * @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 AppLinkMember resource. + * + * @param name resource name. + * @return the first stage of the new AppLinkMember definition. + */ + AppLinkMember.DefinitionStages.Blank define(String name); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkProperties.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkProperties.java new file mode 100644 index 000000000000..5796b23323c5 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinkProperties.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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; + +/** + * AppLink properties. + */ +@Immutable +public final class AppLinkProperties implements JsonSerializable { + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AppLinkProperties class. + */ + public AppLinkProperties() { + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppLinkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppLinkProperties 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 AppLinkProperties. + */ + public static AppLinkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppLinkProperties deserializedAppLinkProperties = new AppLinkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedAppLinkProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAppLinkProperties; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinks.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinks.java new file mode 100644 index 000000000000..765e8c0c2ec8 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AppLinks.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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 AppLinks. + */ +public interface AppLinks { + /** + * Get an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String appLinkName, Context context); + + /** + * Get an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink. + */ + AppLink getByResourceGroup(String resourceGroupName, String appLinkName); + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName); + + /** + * Delete an AppLink. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @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 appLinkName, Context context); + + /** + * List AppLink 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 AppLink list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AppLink 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 AppLink list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List AppLink resources by subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List AppLink resources by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppLink list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get an AppLink. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink along with {@link Response}. + */ + AppLink getById(String id); + + /** + * Get an AppLink. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an AppLink along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an AppLink. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an AppLink. + * + * @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 AppLink resource. + * + * @param name resource name. + * @return the first stage of the new AppLink definition. + */ + AppLink.DefinitionStages.Blank define(String name); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersion.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersion.java new file mode 100644 index 000000000000..e3c1f7b023ed --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersion.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.applink.fluent.models.AvailableVersionInner; + +/** + * An immutable client-side representation of AvailableVersion. + */ +public interface AvailableVersion { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + AvailableVersionProperties properties(); + + /** + * 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.applink.fluent.models.AvailableVersionInner object. + * + * @return the inner object. + */ + AvailableVersionInner innerModel(); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersionProperties.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersionProperties.java new file mode 100644 index 000000000000..961cd259504c --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersionProperties.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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; + +/** + * AppLink available version properties. + */ +@Immutable +public final class AvailableVersionProperties implements JsonSerializable { + /* + * Kubernetes version + */ + private String kubernetesVersion; + + /* + * Fully managed versions + */ + private FullyManagedVersions fullyManagedVersions; + + /* + * Self managed versions + */ + private SelfManagedVersions selfManagedVersions; + + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AvailableVersionProperties class. + */ + private AvailableVersionProperties() { + } + + /** + * Get the kubernetesVersion property: Kubernetes version. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the fullyManagedVersions property: Fully managed versions. + * + * @return the fullyManagedVersions value. + */ + public FullyManagedVersions fullyManagedVersions() { + return this.fullyManagedVersions; + } + + /** + * Get the selfManagedVersions property: Self managed versions. + * + * @return the selfManagedVersions value. + */ + public SelfManagedVersions selfManagedVersions() { + return this.selfManagedVersions; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kubernetesVersion", this.kubernetesVersion); + jsonWriter.writeJsonField("fullyManagedVersions", this.fullyManagedVersions); + jsonWriter.writeJsonField("selfManagedVersions", this.selfManagedVersions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableVersionProperties 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 AvailableVersionProperties. + */ + public static AvailableVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableVersionProperties deserializedAvailableVersionProperties = new AvailableVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kubernetesVersion".equals(fieldName)) { + deserializedAvailableVersionProperties.kubernetesVersion = reader.getString(); + } else if ("fullyManagedVersions".equals(fieldName)) { + deserializedAvailableVersionProperties.fullyManagedVersions = FullyManagedVersions.fromJson(reader); + } else if ("selfManagedVersions".equals(fieldName)) { + deserializedAvailableVersionProperties.selfManagedVersions = SelfManagedVersions.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedAvailableVersionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableVersionProperties; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersions.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersions.java new file mode 100644 index 000000000000..d53655ea5b70 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/AvailableVersions.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of AvailableVersions. + */ +public interface AvailableVersions { + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @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 AvailableVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location); + + /** + * List AvailableVersion resources by location. + * + * @param location The name of the Azure region. + * @param kubernetesVersion Kubernetes version to filter profiles. + * @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 AvailableVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location, String kubernetesVersion, Context context); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ClusterType.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ClusterType.java new file mode 100644 index 000000000000..944aa30d8bdd --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ClusterType.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.applink.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AppLinkMember cluster type. + */ +public final class ClusterType extends ExpandableStringEnum { + /** + * Azure Kubernetes Service. + */ + public static final ClusterType AKS = fromString("AKS"); + + /** + * Creates a new instance of ClusterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterType() { + } + + /** + * Creates or finds a ClusterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterType. + */ + public static ClusterType fromString(String name) { + return fromString(name, ClusterType.class); + } + + /** + * Gets known ClusterType values. + * + * @return known ClusterType values. + */ + public static Collection values() { + return values(ClusterType.class); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ConnectivityProfile.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ConnectivityProfile.java new file mode 100644 index 000000000000..a5d9bfb59213 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ConnectivityProfile.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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; + +/** + * AppLinkMember connectivity profile. + */ +@Fluent +public final class ConnectivityProfile implements JsonSerializable { + /* + * East-West gateway profile. + */ + private EastWestGatewayProfile eastWestGateway; + + /* + * Private connect profile. + */ + private PrivateConnectProfile privateConnect; + + /** + * Creates an instance of ConnectivityProfile class. + */ + public ConnectivityProfile() { + } + + /** + * Get the eastWestGateway property: East-West gateway profile. + * + * @return the eastWestGateway value. + */ + public EastWestGatewayProfile eastWestGateway() { + return this.eastWestGateway; + } + + /** + * Set the eastWestGateway property: East-West gateway profile. + * + * @param eastWestGateway the eastWestGateway value to set. + * @return the ConnectivityProfile object itself. + */ + public ConnectivityProfile withEastWestGateway(EastWestGatewayProfile eastWestGateway) { + this.eastWestGateway = eastWestGateway; + return this; + } + + /** + * Get the privateConnect property: Private connect profile. + * + * @return the privateConnect value. + */ + public PrivateConnectProfile privateConnect() { + return this.privateConnect; + } + + /** + * Set the privateConnect property: Private connect profile. + * + * @param privateConnect the privateConnect value to set. + * @return the ConnectivityProfile object itself. + */ + public ConnectivityProfile withPrivateConnect(PrivateConnectProfile privateConnect) { + this.privateConnect = privateConnect; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("eastWestGateway", this.eastWestGateway); + jsonWriter.writeJsonField("privateConnect", this.privateConnect); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityProfile 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 ConnectivityProfile. + */ + public static ConnectivityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityProfile deserializedConnectivityProfile = new ConnectivityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eastWestGateway".equals(fieldName)) { + deserializedConnectivityProfile.eastWestGateway = EastWestGatewayProfile.fromJson(reader); + } else if ("privateConnect".equals(fieldName)) { + deserializedConnectivityProfile.privateConnect = PrivateConnectProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityProfile; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayProfile.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayProfile.java new file mode 100644 index 000000000000..979c74e63316 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayProfile.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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; + +/** + * AppLinkMember east-west gateway profile. + */ +@Fluent +public final class EastWestGatewayProfile implements JsonSerializable { + /* + * East-West gateway visibility. + */ + private EastWestGatewayVisibility visibility; + + /** + * Creates an instance of EastWestGatewayProfile class. + */ + public EastWestGatewayProfile() { + } + + /** + * Get the visibility property: East-West gateway visibility. + * + * @return the visibility value. + */ + public EastWestGatewayVisibility visibility() { + return this.visibility; + } + + /** + * Set the visibility property: East-West gateway visibility. + * + * @param visibility the visibility value to set. + * @return the EastWestGatewayProfile object itself. + */ + public EastWestGatewayProfile withVisibility(EastWestGatewayVisibility visibility) { + this.visibility = visibility; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("visibility", this.visibility == null ? null : this.visibility.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EastWestGatewayProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EastWestGatewayProfile 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 EastWestGatewayProfile. + */ + public static EastWestGatewayProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EastWestGatewayProfile deserializedEastWestGatewayProfile = new EastWestGatewayProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("visibility".equals(fieldName)) { + deserializedEastWestGatewayProfile.visibility + = EastWestGatewayVisibility.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEastWestGatewayProfile; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayVisibility.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayVisibility.java new file mode 100644 index 000000000000..eece165f20ab --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayVisibility.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.applink.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * East-West gateway visibility. + */ +public final class EastWestGatewayVisibility extends ExpandableStringEnum { + /** + * Use an internal load balancer for the east-west gateway. + */ + public static final EastWestGatewayVisibility INTERNAL = fromString("Internal"); + + /** + * Use an external load balancer for the east-west gateway. + */ + public static final EastWestGatewayVisibility EXTERNAL = fromString("External"); + + /** + * Creates a new instance of EastWestGatewayVisibility value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EastWestGatewayVisibility() { + } + + /** + * Creates or finds a EastWestGatewayVisibility from its string representation. + * + * @param name a name to look for. + * @return the corresponding EastWestGatewayVisibility. + */ + public static EastWestGatewayVisibility fromString(String name) { + return fromString(name, EastWestGatewayVisibility.class); + } + + /** + * Gets known EastWestGatewayVisibility values. + * + * @return known EastWestGatewayVisibility values. + */ + public static Collection values() { + return values(EastWestGatewayVisibility.class); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/FullyManagedUpgradeProfile.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/FullyManagedUpgradeProfile.java new file mode 100644 index 000000000000..3a0490257027 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/FullyManagedUpgradeProfile.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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; + +/** + * AppLinkMember fully managed upgrade profile. + */ +@Fluent +public final class FullyManagedUpgradeProfile implements JsonSerializable { + /* + * Release channel + */ + private UpgradeReleaseChannel releaseChannel; + + /** + * Creates an instance of FullyManagedUpgradeProfile class. + */ + public FullyManagedUpgradeProfile() { + } + + /** + * Get the releaseChannel property: Release channel. + * + * @return the releaseChannel value. + */ + public UpgradeReleaseChannel releaseChannel() { + return this.releaseChannel; + } + + /** + * Set the releaseChannel property: Release channel. + * + * @param releaseChannel the releaseChannel value to set. + * @return the FullyManagedUpgradeProfile object itself. + */ + public FullyManagedUpgradeProfile withReleaseChannel(UpgradeReleaseChannel releaseChannel) { + this.releaseChannel = releaseChannel; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("releaseChannel", + this.releaseChannel == null ? null : this.releaseChannel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FullyManagedUpgradeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FullyManagedUpgradeProfile 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 FullyManagedUpgradeProfile. + */ + public static FullyManagedUpgradeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FullyManagedUpgradeProfile deserializedFullyManagedUpgradeProfile = new FullyManagedUpgradeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("releaseChannel".equals(fieldName)) { + deserializedFullyManagedUpgradeProfile.releaseChannel + = UpgradeReleaseChannel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFullyManagedUpgradeProfile; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/FullyManagedVersions.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/FullyManagedVersions.java new file mode 100644 index 000000000000..4ba59ec37e0e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/FullyManagedVersions.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Fully managed versions. + */ +@Immutable +public final class FullyManagedVersions implements JsonSerializable { + /* + * Release channels + */ + private List releaseChannels; + + /** + * Creates an instance of FullyManagedVersions class. + */ + private FullyManagedVersions() { + } + + /** + * Get the releaseChannels property: Release channels. + * + * @return the releaseChannels value. + */ + public List releaseChannels() { + return this.releaseChannels; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("releaseChannels", this.releaseChannels, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FullyManagedVersions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FullyManagedVersions 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 FullyManagedVersions. + */ + public static FullyManagedVersions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FullyManagedVersions deserializedFullyManagedVersions = new FullyManagedVersions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("releaseChannels".equals(fieldName)) { + List releaseChannels + = reader.readArray(reader1 -> ReleaseChannelInfo.fromJson(reader1)); + deserializedFullyManagedVersions.releaseChannels = releaseChannels; + } else { + reader.skipChildren(); + } + } + + return deserializedFullyManagedVersions; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ManagedServiceIdentity.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..9f254cffd2ca --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ManagedServiceIdentityType.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..a38f9b3ff101 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Metadata.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Metadata.java new file mode 100644 index 000000000000..54ef238c41a8 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Metadata.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.applink.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; + +/** + * AppLinkMember metadata. + */ +@Fluent +public final class Metadata implements JsonSerializable { + /* + * Resource ID + */ + private String resourceId; + + /** + * Creates an instance of Metadata class. + */ + public Metadata() { + } + + /** + * Get the resourceId property: Resource ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID. + * + * @param resourceId the resourceId value to set. + * @return the Metadata object itself. + */ + public Metadata withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Metadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Metadata 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 Metadata. + */ + public static Metadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Metadata deserializedMetadata = new Metadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedMetadata.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetadata; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/MetricsProfile.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/MetricsProfile.java new file mode 100644 index 000000000000..40f5cdc51529 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/MetricsProfile.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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; + +/** + * AppLinkMember metrics profile. + */ +@Immutable +public final class MetricsProfile implements JsonSerializable { + /* + * Metrics endpoint URL + */ + private String metricsEndpoint; + + /** + * Creates an instance of MetricsProfile class. + */ + public MetricsProfile() { + } + + /** + * Get the metricsEndpoint property: Metrics endpoint URL. + * + * @return the metricsEndpoint value. + */ + public String metricsEndpoint() { + return this.metricsEndpoint; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsProfile 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 MetricsProfile. + */ + public static MetricsProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsProfile deserializedMetricsProfile = new MetricsProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metricsEndpoint".equals(fieldName)) { + deserializedMetricsProfile.metricsEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsProfile; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ObservabilityProfile.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ObservabilityProfile.java new file mode 100644 index 000000000000..a126252fe18b --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ObservabilityProfile.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.applink.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; + +/** + * AppLinkMember observability profile. + */ +@Fluent +public final class ObservabilityProfile implements JsonSerializable { + /* + * Metrics configuration + */ + private MetricsProfile metrics; + + /** + * Creates an instance of ObservabilityProfile class. + */ + public ObservabilityProfile() { + } + + /** + * Get the metrics property: Metrics configuration. + * + * @return the metrics value. + */ + public MetricsProfile metrics() { + return this.metrics; + } + + /** + * Set the metrics property: Metrics configuration. + * + * @param metrics the metrics value to set. + * @return the ObservabilityProfile object itself. + */ + public ObservabilityProfile withMetrics(MetricsProfile metrics) { + this.metrics = metrics; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metrics", this.metrics); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObservabilityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObservabilityProfile 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 ObservabilityProfile. + */ + public static ObservabilityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObservabilityProfile deserializedObservabilityProfile = new ObservabilityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metrics".equals(fieldName)) { + deserializedObservabilityProfile.metrics = MetricsProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObservabilityProfile; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Operation.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Operation.java new file mode 100644 index 000000000000..97c883c1b644 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.models; + +import com.azure.resourcemanager.applink.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.applink.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/OperationDisplay.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/OperationDisplay.java new file mode 100644 index 000000000000..9efb246a3dc4 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Operations.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Operations.java new file mode 100644 index 000000000000..dcc73066f897 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Origin.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/Origin.java new file mode 100644 index 000000000000..39520f7b077e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/PrivateConnectProfile.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/PrivateConnectProfile.java new file mode 100644 index 000000000000..9148f31ef47d --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/PrivateConnectProfile.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.applink.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; + +/** + * AppLinkMember private connect profile. + */ +@Fluent +public final class PrivateConnectProfile implements JsonSerializable { + /* + * Delegated Subnet to AppLink. + */ + private String subnetResourceId; + + /** + * Creates an instance of PrivateConnectProfile class. + */ + public PrivateConnectProfile() { + } + + /** + * Get the subnetResourceId property: Delegated Subnet to AppLink. + * + * @return the subnetResourceId value. + */ + public String subnetResourceId() { + return this.subnetResourceId; + } + + /** + * Set the subnetResourceId property: Delegated Subnet to AppLink. + * + * @param subnetResourceId the subnetResourceId value to set. + * @return the PrivateConnectProfile object itself. + */ + public PrivateConnectProfile withSubnetResourceId(String subnetResourceId) { + this.subnetResourceId = subnetResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetResourceId", this.subnetResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateConnectProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateConnectProfile 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 PrivateConnectProfile. + */ + public static PrivateConnectProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateConnectProfile deserializedPrivateConnectProfile = new PrivateConnectProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetResourceId".equals(fieldName)) { + deserializedPrivateConnectProfile.subnetResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateConnectProfile; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ProvisioningState.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ProvisioningState.java new file mode 100644 index 000000000000..103a5241bd78 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ProvisioningState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the resource. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Resource is getting provisioned. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Resource is Updating. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Resource is Deleting. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Resource has been Accepted. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ReleaseChannelInfo.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ReleaseChannelInfo.java new file mode 100644 index 000000000000..24b98991cb2f --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/ReleaseChannelInfo.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.applink.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; + +/** + * Release channel information. + */ +@Immutable +public final class ReleaseChannelInfo implements JsonSerializable { + /* + * Release channel + */ + private String releaseChannel; + + /* + * Istio version behind release channel + */ + private String version; + + /** + * Creates an instance of ReleaseChannelInfo class. + */ + private ReleaseChannelInfo() { + } + + /** + * Get the releaseChannel property: Release channel. + * + * @return the releaseChannel value. + */ + public String releaseChannel() { + return this.releaseChannel; + } + + /** + * Get the version property: Istio version behind release channel. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("releaseChannel", this.releaseChannel); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReleaseChannelInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReleaseChannelInfo 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 ReleaseChannelInfo. + */ + public static ReleaseChannelInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReleaseChannelInfo deserializedReleaseChannelInfo = new ReleaseChannelInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("releaseChannel".equals(fieldName)) { + deserializedReleaseChannelInfo.releaseChannel = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedReleaseChannelInfo.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReleaseChannelInfo; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/SelfManagedUpgradeProfile.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/SelfManagedUpgradeProfile.java new file mode 100644 index 000000000000..23d3b45af3e1 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/SelfManagedUpgradeProfile.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.applink.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; + +/** + * AppLinkMember self managed upgrade profile. + */ +@Fluent +public final class SelfManagedUpgradeProfile implements JsonSerializable { + /* + * Istio version + */ + private String version; + + /** + * Creates an instance of SelfManagedUpgradeProfile class. + */ + public SelfManagedUpgradeProfile() { + } + + /** + * Get the version property: Istio version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Istio version. + * + * @param version the version value to set. + * @return the SelfManagedUpgradeProfile object itself. + */ + public SelfManagedUpgradeProfile withVersion(String version) { + this.version = version; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SelfManagedUpgradeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SelfManagedUpgradeProfile 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 SelfManagedUpgradeProfile. + */ + public static SelfManagedUpgradeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SelfManagedUpgradeProfile deserializedSelfManagedUpgradeProfile = new SelfManagedUpgradeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedSelfManagedUpgradeProfile.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSelfManagedUpgradeProfile; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/SelfManagedVersions.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/SelfManagedVersions.java new file mode 100644 index 000000000000..4592cd213056 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/SelfManagedVersions.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.applink.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Self managed versions. + */ +@Immutable +public final class SelfManagedVersions implements JsonSerializable { + /* + * Istio versions + */ + private List versions; + + /** + * Creates an instance of SelfManagedVersions class. + */ + private SelfManagedVersions() { + } + + /** + * Get the versions property: Istio versions. + * + * @return the versions value. + */ + public List versions() { + return this.versions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("versions", this.versions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SelfManagedVersions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SelfManagedVersions 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 SelfManagedVersions. + */ + public static SelfManagedVersions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SelfManagedVersions deserializedSelfManagedVersions = new SelfManagedVersions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("versions".equals(fieldName)) { + List versions = reader.readArray(reader1 -> VersionInfo.fromJson(reader1)); + deserializedSelfManagedVersions.versions = versions; + } else { + reader.skipChildren(); + } + } + + return deserializedSelfManagedVersions; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistories.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistories.java new file mode 100644 index 000000000000..792a4e3e28bc --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistories.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.applink.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of UpgradeHistories. + */ +public interface UpgradeHistories { + /** + * List UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAppLinkMember(String resourceGroupName, String appLinkName, + String appLinkMemberName); + + /** + * List UpgradeHistory resources by AppLinkMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appLinkName The name of the AppLink. + * @param appLinkMemberName The name of the AppLinkMember. + * @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 UpgradeHistory list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAppLinkMember(String resourceGroupName, String appLinkName, + String appLinkMemberName, Context context); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistory.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistory.java new file mode 100644 index 000000000000..f67a141beb99 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistory.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.applink.fluent.models.UpgradeHistoryInner; + +/** + * An immutable client-side representation of UpgradeHistory. + */ +public interface UpgradeHistory { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + UpgradeHistoryProperties properties(); + + /** + * 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.applink.fluent.models.UpgradeHistoryInner object. + * + * @return the inner object. + */ + UpgradeHistoryInner innerModel(); +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistoryProperties.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistoryProperties.java new file mode 100644 index 000000000000..55f753221a20 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistoryProperties.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * AppLinkMember upgrade history properties. + */ +@Immutable +public final class UpgradeHistoryProperties implements JsonSerializable { + /* + * Start timestamp + */ + private OffsetDateTime startTimestamp; + + /* + * End timestamp + */ + private OffsetDateTime endTimestamp; + + /* + * Upgrade initiator + */ + private String initiatedBy; + + /* + * Version upgraded from + */ + private String fromVersion; + + /* + * Version upgraded to + */ + private String toVersion; + + /* + * Provisioning state + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of UpgradeHistoryProperties class. + */ + private UpgradeHistoryProperties() { + } + + /** + * Get the startTimestamp property: Start timestamp. + * + * @return the startTimestamp value. + */ + public OffsetDateTime startTimestamp() { + return this.startTimestamp; + } + + /** + * Get the endTimestamp property: End timestamp. + * + * @return the endTimestamp value. + */ + public OffsetDateTime endTimestamp() { + return this.endTimestamp; + } + + /** + * Get the initiatedBy property: Upgrade initiator. + * + * @return the initiatedBy value. + */ + public String initiatedBy() { + return this.initiatedBy; + } + + /** + * Get the fromVersion property: Version upgraded from. + * + * @return the fromVersion value. + */ + public String fromVersion() { + return this.fromVersion; + } + + /** + * Get the toVersion property: Version upgraded to. + * + * @return the toVersion value. + */ + public String toVersion() { + return this.toVersion; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTimestamp", + this.startTimestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTimestamp)); + jsonWriter.writeStringField("initiatedBy", this.initiatedBy); + jsonWriter.writeStringField("fromVersion", this.fromVersion); + jsonWriter.writeStringField("toVersion", this.toVersion); + jsonWriter.writeStringField("endTimestamp", + this.endTimestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTimestamp)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpgradeHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpgradeHistoryProperties 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 UpgradeHistoryProperties. + */ + public static UpgradeHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpgradeHistoryProperties deserializedUpgradeHistoryProperties = new UpgradeHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTimestamp".equals(fieldName)) { + deserializedUpgradeHistoryProperties.startTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("initiatedBy".equals(fieldName)) { + deserializedUpgradeHistoryProperties.initiatedBy = reader.getString(); + } else if ("fromVersion".equals(fieldName)) { + deserializedUpgradeHistoryProperties.fromVersion = reader.getString(); + } else if ("toVersion".equals(fieldName)) { + deserializedUpgradeHistoryProperties.toVersion = reader.getString(); + } else if ("endTimestamp".equals(fieldName)) { + deserializedUpgradeHistoryProperties.endTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedUpgradeHistoryProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUpgradeHistoryProperties; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeMode.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeMode.java new file mode 100644 index 000000000000..ed26bd0e750d --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeMode.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.applink.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AppLinkMember upgrade mode. + */ +public final class UpgradeMode extends ExpandableStringEnum { + /** + * Fully managed upgrade mode. + */ + public static final UpgradeMode FULLY_MANAGED = fromString("FullyManaged"); + + /** + * Self managed upgrade mode. + */ + public static final UpgradeMode SELF_MANAGED = fromString("SelfManaged"); + + /** + * Creates a new instance of UpgradeMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpgradeMode() { + } + + /** + * Creates or finds a UpgradeMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpgradeMode. + */ + public static UpgradeMode fromString(String name) { + return fromString(name, UpgradeMode.class); + } + + /** + * Gets known UpgradeMode values. + * + * @return known UpgradeMode values. + */ + public static Collection values() { + return values(UpgradeMode.class); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeProfile.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeProfile.java new file mode 100644 index 000000000000..20ed06d56b99 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeProfile.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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; + +/** + * AppLinkMember upgrade profile. + */ +@Fluent +public final class UpgradeProfile implements JsonSerializable { + /* + * Upgrade mode. + */ + private UpgradeMode mode; + + /* + * Fully managed upgrade profile. + */ + private FullyManagedUpgradeProfile fullyManagedUpgradeProfile; + + /* + * Self managed upgrade profile. + */ + private SelfManagedUpgradeProfile selfManagedUpgradeProfile; + + /** + * Creates an instance of UpgradeProfile class. + */ + public UpgradeProfile() { + } + + /** + * Get the mode property: Upgrade mode. + * + * @return the mode value. + */ + public UpgradeMode mode() { + return this.mode; + } + + /** + * Set the mode property: Upgrade mode. + * + * @param mode the mode value to set. + * @return the UpgradeProfile object itself. + */ + public UpgradeProfile withMode(UpgradeMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the fullyManagedUpgradeProfile property: Fully managed upgrade profile. + * + * @return the fullyManagedUpgradeProfile value. + */ + public FullyManagedUpgradeProfile fullyManagedUpgradeProfile() { + return this.fullyManagedUpgradeProfile; + } + + /** + * Set the fullyManagedUpgradeProfile property: Fully managed upgrade profile. + * + * @param fullyManagedUpgradeProfile the fullyManagedUpgradeProfile value to set. + * @return the UpgradeProfile object itself. + */ + public UpgradeProfile withFullyManagedUpgradeProfile(FullyManagedUpgradeProfile fullyManagedUpgradeProfile) { + this.fullyManagedUpgradeProfile = fullyManagedUpgradeProfile; + return this; + } + + /** + * Get the selfManagedUpgradeProfile property: Self managed upgrade profile. + * + * @return the selfManagedUpgradeProfile value. + */ + public SelfManagedUpgradeProfile selfManagedUpgradeProfile() { + return this.selfManagedUpgradeProfile; + } + + /** + * Set the selfManagedUpgradeProfile property: Self managed upgrade profile. + * + * @param selfManagedUpgradeProfile the selfManagedUpgradeProfile value to set. + * @return the UpgradeProfile object itself. + */ + public UpgradeProfile withSelfManagedUpgradeProfile(SelfManagedUpgradeProfile selfManagedUpgradeProfile) { + this.selfManagedUpgradeProfile = selfManagedUpgradeProfile; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeJsonField("fullyManagedUpgradeProfile", this.fullyManagedUpgradeProfile); + jsonWriter.writeJsonField("selfManagedUpgradeProfile", this.selfManagedUpgradeProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpgradeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpgradeProfile 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 UpgradeProfile. + */ + public static UpgradeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpgradeProfile deserializedUpgradeProfile = new UpgradeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedUpgradeProfile.mode = UpgradeMode.fromString(reader.getString()); + } else if ("fullyManagedUpgradeProfile".equals(fieldName)) { + deserializedUpgradeProfile.fullyManagedUpgradeProfile = FullyManagedUpgradeProfile.fromJson(reader); + } else if ("selfManagedUpgradeProfile".equals(fieldName)) { + deserializedUpgradeProfile.selfManagedUpgradeProfile = SelfManagedUpgradeProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpgradeProfile; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeReleaseChannel.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeReleaseChannel.java new file mode 100644 index 000000000000..b7eea7ef6ab7 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UpgradeReleaseChannel.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.applink.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AppLinkMember upgrade release channel. + */ +public final class UpgradeReleaseChannel extends ExpandableStringEnum { + /** + * Rapid release channel. + */ + public static final UpgradeReleaseChannel RAPID = fromString("Rapid"); + + /** + * Stable release channel. + */ + public static final UpgradeReleaseChannel STABLE = fromString("Stable"); + + /** + * Creates a new instance of UpgradeReleaseChannel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UpgradeReleaseChannel() { + } + + /** + * Creates or finds a UpgradeReleaseChannel from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpgradeReleaseChannel. + */ + public static UpgradeReleaseChannel fromString(String name) { + return fromString(name, UpgradeReleaseChannel.class); + } + + /** + * Gets known UpgradeReleaseChannel values. + * + * @return known UpgradeReleaseChannel values. + */ + public static Collection values() { + return values(UpgradeReleaseChannel.class); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UserAssignedIdentity.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..2b3333e434c3 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/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.applink.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/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/VersionInfo.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/VersionInfo.java new file mode 100644 index 000000000000..e6d7568eb3f4 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/VersionInfo.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Version information. + */ +@Immutable +public final class VersionInfo implements JsonSerializable { + /* + * Istio version + */ + private String version; + + /* + * Available upgrades + */ + private List upgrades; + + /** + * Creates an instance of VersionInfo class. + */ + private VersionInfo() { + } + + /** + * Get the version property: Istio version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the upgrades property: Available upgrades. + * + * @return the upgrades value. + */ + public List upgrades() { + return this.upgrades; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeArrayField("upgrades", this.upgrades, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VersionInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VersionInfo 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 VersionInfo. + */ + public static VersionInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VersionInfo deserializedVersionInfo = new VersionInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedVersionInfo.version = reader.getString(); + } else if ("upgrades".equals(fieldName)) { + List upgrades = reader.readArray(reader1 -> reader1.getString()); + deserializedVersionInfo.upgrades = upgrades; + } else { + reader.skipChildren(); + } + } + + return deserializedVersionInfo; + }); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/package-info.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/package-info.java new file mode 100644 index 000000000000..fb58ebb33d8e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/models/package-info.java @@ -0,0 +1,9 @@ +// 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 ApplinkManagementClient. + * Microsoft.AppLink Resource Provider management API. + */ +package com.azure.resourcemanager.applink.models; diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/package-info.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/package-info.java new file mode 100644 index 000000000000..341b7ded0117 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/java/com/azure/resourcemanager/applink/package-info.java @@ -0,0 +1,9 @@ +// 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 ApplinkManagementClient. + * Microsoft.AppLink Resource Provider management API. + */ +package com.azure.resourcemanager.applink; diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/java/module-info.java b/sdk/applink/azure-resourcemanager-applink/src/main/java/module-info.java new file mode 100644 index 000000000000..fee0bde06e67 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/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.applink { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.applink; + exports com.azure.resourcemanager.applink.fluent; + exports com.azure.resourcemanager.applink.fluent.models; + exports com.azure.resourcemanager.applink.models; + + opens com.azure.resourcemanager.applink.fluent.models to com.azure.core; + opens com.azure.resourcemanager.applink.models to com.azure.core; + opens com.azure.resourcemanager.applink.implementation.models to com.azure.core; +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/azure-resourcemanager-applink_metadata.json b/sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/azure-resourcemanager-applink_metadata.json new file mode 100644 index 000000000000..799246c67282 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/azure-resourcemanager-applink_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.AppLink":"2025-08-01-preview"},"crossLanguageDefinitions":{"com.azure.resourcemanager.applink.fluent.AppLinkMembersClient":"Microsoft.AppLink.AppLinkMembers","com.azure.resourcemanager.applink.fluent.AppLinkMembersClient.beginCreateOrUpdate":"Microsoft.AppLink.AppLinkMembers.createOrUpdate","com.azure.resourcemanager.applink.fluent.AppLinkMembersClient.beginDelete":"Microsoft.AppLink.AppLinkMembers.delete","com.azure.resourcemanager.applink.fluent.AppLinkMembersClient.beginUpdate":"Microsoft.AppLink.AppLinkMembers.update","com.azure.resourcemanager.applink.fluent.AppLinkMembersClient.createOrUpdate":"Microsoft.AppLink.AppLinkMembers.createOrUpdate","com.azure.resourcemanager.applink.fluent.AppLinkMembersClient.delete":"Microsoft.AppLink.AppLinkMembers.delete","com.azure.resourcemanager.applink.fluent.AppLinkMembersClient.get":"Microsoft.AppLink.AppLinkMembers.get","com.azure.resourcemanager.applink.fluent.AppLinkMembersClient.getWithResponse":"Microsoft.AppLink.AppLinkMembers.get","com.azure.resourcemanager.applink.fluent.AppLinkMembersClient.listByAppLink":"Microsoft.AppLink.AppLinkMembers.listByAppLink","com.azure.resourcemanager.applink.fluent.AppLinkMembersClient.update":"Microsoft.AppLink.AppLinkMembers.update","com.azure.resourcemanager.applink.fluent.AppLinksClient":"Microsoft.AppLink.AppLinks","com.azure.resourcemanager.applink.fluent.AppLinksClient.beginCreateOrUpdate":"Microsoft.AppLink.AppLinks.createOrUpdate","com.azure.resourcemanager.applink.fluent.AppLinksClient.beginDelete":"Microsoft.AppLink.AppLinks.delete","com.azure.resourcemanager.applink.fluent.AppLinksClient.beginUpdate":"Microsoft.AppLink.AppLinks.update","com.azure.resourcemanager.applink.fluent.AppLinksClient.createOrUpdate":"Microsoft.AppLink.AppLinks.createOrUpdate","com.azure.resourcemanager.applink.fluent.AppLinksClient.delete":"Microsoft.AppLink.AppLinks.delete","com.azure.resourcemanager.applink.fluent.AppLinksClient.getByResourceGroup":"Microsoft.AppLink.AppLinks.get","com.azure.resourcemanager.applink.fluent.AppLinksClient.getByResourceGroupWithResponse":"Microsoft.AppLink.AppLinks.get","com.azure.resourcemanager.applink.fluent.AppLinksClient.list":"Microsoft.AppLink.AppLinks.listBySubscription","com.azure.resourcemanager.applink.fluent.AppLinksClient.listByResourceGroup":"Microsoft.AppLink.AppLinks.listByResourceGroup","com.azure.resourcemanager.applink.fluent.AppLinksClient.update":"Microsoft.AppLink.AppLinks.update","com.azure.resourcemanager.applink.fluent.ApplinkManagementClient":"Microsoft.AppLink","com.azure.resourcemanager.applink.fluent.AvailableVersionsClient":"Microsoft.AppLink.AvailableVersions","com.azure.resourcemanager.applink.fluent.AvailableVersionsClient.listByLocation":"Microsoft.AppLink.AvailableVersions.listByLocation","com.azure.resourcemanager.applink.fluent.OperationsClient":"Microsoft.AppLink.Operations","com.azure.resourcemanager.applink.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.applink.fluent.UpgradeHistoriesClient":"Microsoft.AppLink.UpgradeHistories","com.azure.resourcemanager.applink.fluent.UpgradeHistoriesClient.listByAppLinkMember":"Microsoft.AppLink.UpgradeHistories.listByAppLinkMember","com.azure.resourcemanager.applink.fluent.models.AppLinkInner":"Microsoft.AppLink.AppLink","com.azure.resourcemanager.applink.fluent.models.AppLinkMemberInner":"Microsoft.AppLink.AppLinkMember","com.azure.resourcemanager.applink.fluent.models.AvailableVersionInner":"Microsoft.AppLink.AvailableVersion","com.azure.resourcemanager.applink.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.applink.fluent.models.UpgradeHistoryInner":"Microsoft.AppLink.UpgradeHistory","com.azure.resourcemanager.applink.implementation.ApplinkManagementClientBuilder":"Microsoft.AppLink","com.azure.resourcemanager.applink.implementation.models.AppLinkListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.applink.implementation.models.AppLinkMemberListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.applink.implementation.models.AvailableVersionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.applink.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.applink.implementation.models.UpgradeHistoryListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.applink.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.applink.models.AppLinkMemberProperties":"Microsoft.AppLink.AppLinkMemberProperties","com.azure.resourcemanager.applink.models.AppLinkProperties":"Microsoft.AppLink.AppLinkProperties","com.azure.resourcemanager.applink.models.AvailableVersionProperties":"Microsoft.AppLink.AvailableVersionProperties","com.azure.resourcemanager.applink.models.ClusterType":"Microsoft.AppLink.ClusterType","com.azure.resourcemanager.applink.models.ConnectivityProfile":"Microsoft.AppLink.ConnectivityProfile","com.azure.resourcemanager.applink.models.EastWestGatewayProfile":"Microsoft.AppLink.EastWestGatewayProfile","com.azure.resourcemanager.applink.models.EastWestGatewayVisibility":"Microsoft.AppLink.EastWestGatewayVisibility","com.azure.resourcemanager.applink.models.FullyManagedUpgradeProfile":"Microsoft.AppLink.FullyManagedUpgradeProfile","com.azure.resourcemanager.applink.models.FullyManagedVersions":"Microsoft.AppLink.FullyManagedVersions","com.azure.resourcemanager.applink.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.applink.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.applink.models.Metadata":"Microsoft.AppLink.Metadata","com.azure.resourcemanager.applink.models.MetricsProfile":"Microsoft.AppLink.MetricsProfile","com.azure.resourcemanager.applink.models.ObservabilityProfile":"Microsoft.AppLink.ObservabilityProfile","com.azure.resourcemanager.applink.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.applink.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.applink.models.PrivateConnectProfile":"Microsoft.AppLink.PrivateConnectProfile","com.azure.resourcemanager.applink.models.ProvisioningState":"Microsoft.AppLink.ProvisioningState","com.azure.resourcemanager.applink.models.ReleaseChannelInfo":"Microsoft.AppLink.ReleaseChannelInfo","com.azure.resourcemanager.applink.models.SelfManagedUpgradeProfile":"Microsoft.AppLink.SelfManagedUpgradeProfile","com.azure.resourcemanager.applink.models.SelfManagedVersions":"Microsoft.AppLink.SelfManagedVersions","com.azure.resourcemanager.applink.models.UpgradeHistoryProperties":"Microsoft.AppLink.UpgradeHistoryProperties","com.azure.resourcemanager.applink.models.UpgradeMode":"Microsoft.AppLink.UpgradeMode","com.azure.resourcemanager.applink.models.UpgradeProfile":"Microsoft.AppLink.UpgradeProfile","com.azure.resourcemanager.applink.models.UpgradeReleaseChannel":"Microsoft.AppLink.UpgradeReleaseChannel","com.azure.resourcemanager.applink.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.applink.models.VersionInfo":"Microsoft.AppLink.VersionInfo"},"generatedFiles":["src/main/java/com/azure/resourcemanager/applink/ApplinkManager.java","src/main/java/com/azure/resourcemanager/applink/fluent/AppLinkMembersClient.java","src/main/java/com/azure/resourcemanager/applink/fluent/AppLinksClient.java","src/main/java/com/azure/resourcemanager/applink/fluent/ApplinkManagementClient.java","src/main/java/com/azure/resourcemanager/applink/fluent/AvailableVersionsClient.java","src/main/java/com/azure/resourcemanager/applink/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/applink/fluent/UpgradeHistoriesClient.java","src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkInner.java","src/main/java/com/azure/resourcemanager/applink/fluent/models/AppLinkMemberInner.java","src/main/java/com/azure/resourcemanager/applink/fluent/models/AvailableVersionInner.java","src/main/java/com/azure/resourcemanager/applink/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/applink/fluent/models/UpgradeHistoryInner.java","src/main/java/com/azure/resourcemanager/applink/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/applink/fluent/package-info.java","src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMemberImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersClientImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/AppLinkMembersImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksClientImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/AppLinksImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/applink/implementation/ApplinkManagementClientImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsClientImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/AvailableVersionsImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesClientImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoriesImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/UpgradeHistoryImpl.java","src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkListResult.java","src/main/java/com/azure/resourcemanager/applink/implementation/models/AppLinkMemberListResult.java","src/main/java/com/azure/resourcemanager/applink/implementation/models/AvailableVersionListResult.java","src/main/java/com/azure/resourcemanager/applink/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/applink/implementation/models/UpgradeHistoryListResult.java","src/main/java/com/azure/resourcemanager/applink/implementation/package-info.java","src/main/java/com/azure/resourcemanager/applink/models/ActionType.java","src/main/java/com/azure/resourcemanager/applink/models/AppLink.java","src/main/java/com/azure/resourcemanager/applink/models/AppLinkMember.java","src/main/java/com/azure/resourcemanager/applink/models/AppLinkMemberProperties.java","src/main/java/com/azure/resourcemanager/applink/models/AppLinkMembers.java","src/main/java/com/azure/resourcemanager/applink/models/AppLinkProperties.java","src/main/java/com/azure/resourcemanager/applink/models/AppLinks.java","src/main/java/com/azure/resourcemanager/applink/models/AvailableVersion.java","src/main/java/com/azure/resourcemanager/applink/models/AvailableVersionProperties.java","src/main/java/com/azure/resourcemanager/applink/models/AvailableVersions.java","src/main/java/com/azure/resourcemanager/applink/models/ClusterType.java","src/main/java/com/azure/resourcemanager/applink/models/ConnectivityProfile.java","src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayProfile.java","src/main/java/com/azure/resourcemanager/applink/models/EastWestGatewayVisibility.java","src/main/java/com/azure/resourcemanager/applink/models/FullyManagedUpgradeProfile.java","src/main/java/com/azure/resourcemanager/applink/models/FullyManagedVersions.java","src/main/java/com/azure/resourcemanager/applink/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/applink/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/applink/models/Metadata.java","src/main/java/com/azure/resourcemanager/applink/models/MetricsProfile.java","src/main/java/com/azure/resourcemanager/applink/models/ObservabilityProfile.java","src/main/java/com/azure/resourcemanager/applink/models/Operation.java","src/main/java/com/azure/resourcemanager/applink/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/applink/models/Operations.java","src/main/java/com/azure/resourcemanager/applink/models/Origin.java","src/main/java/com/azure/resourcemanager/applink/models/PrivateConnectProfile.java","src/main/java/com/azure/resourcemanager/applink/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/applink/models/ReleaseChannelInfo.java","src/main/java/com/azure/resourcemanager/applink/models/SelfManagedUpgradeProfile.java","src/main/java/com/azure/resourcemanager/applink/models/SelfManagedVersions.java","src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistories.java","src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistory.java","src/main/java/com/azure/resourcemanager/applink/models/UpgradeHistoryProperties.java","src/main/java/com/azure/resourcemanager/applink/models/UpgradeMode.java","src/main/java/com/azure/resourcemanager/applink/models/UpgradeProfile.java","src/main/java/com/azure/resourcemanager/applink/models/UpgradeReleaseChannel.java","src/main/java/com/azure/resourcemanager/applink/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/applink/models/VersionInfo.java","src/main/java/com/azure/resourcemanager/applink/models/package-info.java","src/main/java/com/azure/resourcemanager/applink/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-applink/proxy-config.json b/sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-applink/proxy-config.json new file mode 100644 index 000000000000..4c309a143a34 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-applink/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.applink.implementation.AppLinkMembersClientImpl$AppLinkMembersService"],["com.azure.resourcemanager.applink.implementation.AppLinksClientImpl$AppLinksService"],["com.azure.resourcemanager.applink.implementation.AvailableVersionsClientImpl$AvailableVersionsService"],["com.azure.resourcemanager.applink.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.applink.implementation.UpgradeHistoriesClientImpl$UpgradeHistoriesService"]] \ No newline at end of file diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-applink/reflect-config.json b/sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-applink/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-applink/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/applink/azure-resourcemanager-applink/src/main/resources/azure-resourcemanager-applink.properties b/sdk/applink/azure-resourcemanager-applink/src/main/resources/azure-resourcemanager-applink.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/main/resources/azure-resourcemanager-applink.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersCreateOrUpdateSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..aea615bede37 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersCreateOrUpdateSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.resourcemanager.applink.models.AppLinkMemberProperties; +import com.azure.resourcemanager.applink.models.ClusterType; +import com.azure.resourcemanager.applink.models.ConnectivityProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.FullyManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.Metadata; +import com.azure.resourcemanager.applink.models.PrivateConnectProfile; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppLinkMembers CreateOrUpdate. + */ +public final class AppLinkMembersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_CreateOrUpdate.json + */ + /** + * Sample code: AppLinkMembers_CreateOrUpdate. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersCreateOrUpdate(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinkMembers() + .define("member-01") + .withRegion("westus2") + .withExistingAppLink("test_rg", "applink-test-01") + .withTags(mapOf("key2913", "fakeTokenPlaceholder")) + .withProperties(new AppLinkMemberProperties().withClusterType(ClusterType.AKS) + .withMetadata(new Metadata().withResourceId( + "/subscriptions/bc7e0da9-5e4c-4a91-9252-9658837006cf/resourcegroups/applink-rg/providers/Microsoft.ContainerService/managedClusters/applink-member1")) + .withUpgradeProfile(new UpgradeProfile().withMode(UpgradeMode.FULLY_MANAGED) + .withFullyManagedUpgradeProfile( + new FullyManagedUpgradeProfile().withReleaseChannel(UpgradeReleaseChannel.STABLE))) + .withConnectivityProfile(new ConnectivityProfile() + .withEastWestGateway( + new EastWestGatewayProfile().withVisibility(EastWestGatewayVisibility.INTERNAL)) + .withPrivateConnect(new PrivateConnectProfile().withSubnetResourceId( + "/subscriptions/bc7e0da9-5e4c-4a91-9252-9658837006cf/resourceGroups/applink-vnet-rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1")))) + .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/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersDeleteSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersDeleteSamples.java new file mode 100644 index 000000000000..22c80c75109e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersDeleteSamples.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.applink.generated; + +/** + * Samples for AppLinkMembers Delete. + */ +public final class AppLinkMembersDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_Delete.json + */ + /** + * Sample code: AppLinkMembers_Delete. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersDelete(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinkMembers().delete("test_rg", "applink-test-01", "member-01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersGetSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersGetSamples.java new file mode 100644 index 000000000000..58fcb153ed4d --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersGetSamples.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.applink.generated; + +/** + * Samples for AppLinkMembers Get. + */ +public final class AppLinkMembersGetSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_Get.json + */ + /** + * Sample code: AppLinkMembers_Get. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersGet(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinkMembers() + .getWithResponse("test_rg", "applink-test-01", "member-01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersListByAppLinkSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersListByAppLinkSamples.java new file mode 100644 index 000000000000..27ba92761b0b --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersListByAppLinkSamples.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.applink.generated; + +/** + * Samples for AppLinkMembers ListByAppLink. + */ +public final class AppLinkMembersListByAppLinkSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_ListByAppLink.json + */ + /** + * Sample code: AppLinkMembers_ListByAppLink. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersListByAppLink(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinkMembers().listByAppLink("test_rg", "applink-test-01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersUpdateSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersUpdateSamples.java new file mode 100644 index 000000000000..563008944e22 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinkMembersUpdateSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.resourcemanager.applink.models.AppLinkMember; +import com.azure.resourcemanager.applink.models.AppLinkMemberProperties; +import com.azure.resourcemanager.applink.models.ConnectivityProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.SelfManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeProfile; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppLinkMembers Update. + */ +public final class AppLinkMembersUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinkMembers_Update.json + */ + /** + * Sample code: AppLinkMembers_Update. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinkMembersUpdate(com.azure.resourcemanager.applink.ApplinkManager manager) { + AppLinkMember resource = manager.appLinkMembers() + .getWithResponse("test_rg", "applink-test-01", "member-01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key7952", "fakeTokenPlaceholder")) + .withProperties(new AppLinkMemberProperties() + .withUpgradeProfile(new UpgradeProfile().withMode(UpgradeMode.SELF_MANAGED) + .withSelfManagedUpgradeProfile(new SelfManagedUpgradeProfile().withVersion("1.26"))) + .withConnectivityProfile(new ConnectivityProfile().withEastWestGateway( + new EastWestGatewayProfile().withVisibility(EastWestGatewayVisibility.INTERNAL)))) + .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/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksCreateOrUpdateSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..6a45efac032e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.resourcemanager.applink.models.AppLinkProperties; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentity; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppLinks CreateOrUpdate. + */ +public final class AppLinksCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_CreateOrUpdate.json + */ + /** + * Sample code: AppLinks_CreateOrUpdate. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksCreateOrUpdate(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks() + .define("applink-test-01") + .withRegion("westus2") + .withExistingResourceGroup("test_rg") + .withTags(mapOf("key2913", "fakeTokenPlaceholder")) + .withProperties(new AppLinkProperties()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .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/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksDeleteSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksDeleteSamples.java new file mode 100644 index 000000000000..d7f3dac254ad --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksDeleteSamples.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.applink.generated; + +/** + * Samples for AppLinks Delete. + */ +public final class AppLinksDeleteSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_Delete.json + */ + /** + * Sample code: AppLinks_Delete. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksDelete(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks().delete("test_rg", "applink-test-01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksGetByResourceGroupSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e07d9fbd3ffb --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksGetByResourceGroupSamples.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.applink.generated; + +/** + * Samples for AppLinks GetByResourceGroup. + */ +public final class AppLinksGetByResourceGroupSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_Get.json + */ + /** + * Sample code: AppLinks_Get. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksGet(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks() + .getByResourceGroupWithResponse("test_rg", "applink-test-01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksListByResourceGroupSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksListByResourceGroupSamples.java new file mode 100644 index 000000000000..7477b8f4826c --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksListByResourceGroupSamples.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.applink.generated; + +/** + * Samples for AppLinks ListByResourceGroup. + */ +public final class AppLinksListByResourceGroupSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_ListByResourceGroup.json + */ + /** + * Sample code: AppLinks_ListByResourceGroup. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksListByResourceGroup(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks().listByResourceGroup("test_rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksListSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksListSamples.java new file mode 100644 index 000000000000..739abe67f80e --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksListSamples.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.applink.generated; + +/** + * Samples for AppLinks List. + */ +public final class AppLinksListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_ListBySubscription.json + */ + /** + * Sample code: AppLinks_ListBySubscription. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksListBySubscription(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.appLinks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksUpdateSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksUpdateSamples.java new file mode 100644 index 000000000000..a1bc4df8c474 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AppLinksUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.resourcemanager.applink.models.AppLink; +import com.azure.resourcemanager.applink.models.AppLinkProperties; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentity; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.applink.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppLinks Update. + */ +public final class AppLinksUpdateSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AppLinks_Update.json + */ + /** + * Sample code: AppLinks_Update. + * + * @param manager Entry point to ApplinkManager. + */ + public static void appLinksUpdate(com.azure.resourcemanager.applink.ApplinkManager manager) { + AppLink resource = manager.appLinks() + .getByResourceGroupWithResponse("test_rg", "applink-test-01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("environment", "production", "cost-center", "platform")) + .withProperties(new AppLinkProperties()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/test_rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/applink-identity", + new UserAssignedIdentity()))) + .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/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AvailableVersionsListByLocationSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AvailableVersionsListByLocationSamples.java new file mode 100644 index 000000000000..cc3b7dddce0f --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/AvailableVersionsListByLocationSamples.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.applink.generated; + +/** + * Samples for AvailableVersions ListByLocation. + */ +public final class AvailableVersionsListByLocationSamples { + /* + * x-ms-original-file: 2025-08-01-preview/AvailableVersions_ListByLocationWithFilter.json + */ + /** + * Sample code: AvailableVersions_ListByLocationWithFilter. + * + * @param manager Entry point to ApplinkManager. + */ + public static void + availableVersionsListByLocationWithFilter(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.availableVersions().listByLocation("westus2", "1.28", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-08-01-preview/AvailableVersions_ListByLocation.json + */ + /** + * Sample code: AvailableVersions_ListByLocation. + * + * @param manager Entry point to ApplinkManager. + */ + public static void availableVersionsListByLocation(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.availableVersions().listByLocation("westus2", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/OperationsListSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/OperationsListSamples.java new file mode 100644 index 000000000000..1076b51e1cf8 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/OperationsListSamples.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.applink.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2025-08-01-preview/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to ApplinkManager. + */ + public static void operationsList(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/UpgradeHistoriesListByAppLinkMemberSamples.java b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/UpgradeHistoriesListByAppLinkMemberSamples.java new file mode 100644 index 000000000000..2efb8e1b138b --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/samples/java/com/azure/resourcemanager/applink/generated/UpgradeHistoriesListByAppLinkMemberSamples.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.applink.generated; + +/** + * Samples for UpgradeHistories ListByAppLinkMember. + */ +public final class UpgradeHistoriesListByAppLinkMemberSamples { + /* + * x-ms-original-file: 2025-08-01-preview/UpgradeHistories_ListByAppLinkMember.json + */ + /** + * Sample code: UpgradeHistories_ListByAppLinkMember. + * + * @param manager Entry point to ApplinkManager. + */ + public static void upgradeHistoriesListByAppLinkMember(com.azure.resourcemanager.applink.ApplinkManager manager) { + manager.upgradeHistories() + .listByAppLinkMember("test_rg", "applink-test-01", "member-01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkInnerTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkInnerTests.java new file mode 100644 index 000000000000..bd33a13df889 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkInnerTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.fluent.models.AppLinkInner; +import com.azure.resourcemanager.applink.models.AppLinkProperties; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentity; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.applink.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AppLinkInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AppLinkInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"zvgnwzs\",\"tenantId\":\"glzufc\",\"type\":\"None\",\"userAssignedIdentities\":{\"ithxqhabifpi\":{\"principalId\":\"dbihanufhfcbj\",\"clientId\":\"a\"},\"ivyqniwbybrkxvd\":{\"principalId\":\"wczbys\",\"clientId\":\"pqxu\"},\"yejhk\":{\"principalId\":\"jgrtfwvukxga\",\"clientId\":\"ccsnhsjc\"}}},\"location\":\"htnapczwlokjyem\",\"tags\":{\"joxzjnchgejspodm\":\"ni\",\"h\":\"ilzyd\"},\"id\":\"jwyahuxinpmqnja\",\"name\":\"wixjsprozvcp\",\"type\":\"tegjvwmf\"}") + .toObject(AppLinkInner.class); + Assertions.assertEquals("htnapczwlokjyem", model.location()); + Assertions.assertEquals("ni", model.tags().get("joxzjnchgejspodm")); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AppLinkInner model = new AppLinkInner().withLocation("htnapczwlokjyem") + .withTags(mapOf("joxzjnchgejspodm", "ni", "h", "ilzyd")) + .withProperties(new AppLinkProperties()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("ithxqhabifpi", new UserAssignedIdentity(), "ivyqniwbybrkxvd", + new UserAssignedIdentity(), "yejhk", new UserAssignedIdentity()))); + model = BinaryData.fromObject(model).toObject(AppLinkInner.class); + Assertions.assertEquals("htnapczwlokjyem", model.location()); + Assertions.assertEquals("ni", model.tags().get("joxzjnchgejspodm")); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, 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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkListResultTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkListResultTests.java new file mode 100644 index 000000000000..8b6b36597ba7 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkListResultTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.implementation.models.AppLinkListResult; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +import org.junit.jupiter.api.Assertions; + +public final class AppLinkListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AppLinkListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\"},\"identity\":{\"principalId\":\"xofpdvhpfxxypi\",\"tenantId\":\"nmayhuybb\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"rxzxtheo\":{\"principalId\":\"po\",\"clientId\":\"inuvamiheogn\"},\"bwjzr\":{\"principalId\":\"si\",\"clientId\":\"evcciqihnhun\"}}},\"location\":\"ygxgispemvtz\",\"tags\":{\"fxqeof\":\"fublj\",\"jqul\":\"aeqjhqjbasvms\"},\"id\":\"gsntnbybkzgcwr\",\"name\":\"clxxwrljdo\",\"type\":\"skcqvkocrcjd\"},{\"properties\":{\"provisioningState\":\"Accepted\"},\"identity\":{\"principalId\":\"bnjbiksqrglssain\",\"tenantId\":\"jwnzlljfmp\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"vndhkrwpdapp\":{\"principalId\":\"mgxsab\",\"clientId\":\"qduujitcjczdz\"},\"je\":{\"principalId\":\"bdkvwrwjf\",\"clientId\":\"snhu\"},\"tqxhocdgeab\":{\"principalId\":\"mrldhu\",\"clientId\":\"zzd\"},\"aozwyiftyhxhu\":{\"principalId\":\"phut\",\"clientId\":\"ndv\"}}},\"location\":\"k\",\"tags\":{\"iawxklry\":\"xolniwpwcukjfk\",\"cbacphejkotynqg\":\"lwckbasyypnddhs\"},\"id\":\"ulzndlikwyqk\",\"name\":\"fgibmadgakeq\",\"type\":\"rxybz\"},{\"properties\":{\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"tbciqfouflmm\",\"tenantId\":\"zsm\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"umkdosvqwhbmd\":{\"principalId\":\"ougpbkwt\",\"clientId\":\"tduqktapspwgcuer\"},\"q\":{\"principalId\":\"bjf\",\"clientId\":\"gmbmbexppbh\"}}},\"location\":\"ol\",\"tags\":{\"gjyjgzjaoyfhrtxi\":\"psalgbqux\",\"rkujy\":\"n\",\"rlyxwjkcprbnw\":\"vlejuvfqa\"},\"id\":\"xgjvtbv\",\"name\":\"ysszdnrujqguh\",\"type\":\"uouq\"}],\"nextLink\":\"rwzwbng\"}") + .toObject(AppLinkListResult.class); + Assertions.assertEquals("ygxgispemvtz", model.value().get(0).location()); + Assertions.assertEquals("fublj", model.value().get(0).tags().get("fxqeof")); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("rwzwbng", model.nextLink()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberInnerTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberInnerTests.java new file mode 100644 index 000000000000..bcf11e9ba2ba --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberInnerTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.fluent.models.AppLinkMemberInner; +import com.azure.resourcemanager.applink.models.AppLinkMemberProperties; +import com.azure.resourcemanager.applink.models.ClusterType; +import com.azure.resourcemanager.applink.models.ConnectivityProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.FullyManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.Metadata; +import com.azure.resourcemanager.applink.models.MetricsProfile; +import com.azure.resourcemanager.applink.models.ObservabilityProfile; +import com.azure.resourcemanager.applink.models.PrivateConnectProfile; +import com.azure.resourcemanager.applink.models.SelfManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AppLinkMemberInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AppLinkMemberInner model = BinaryData.fromString( + "{\"properties\":{\"clusterType\":\"AKS\",\"metadata\":{\"resourceId\":\"wu\"},\"upgradeProfile\":{\"mode\":\"FullyManaged\",\"fullyManagedUpgradeProfile\":{\"releaseChannel\":\"Rapid\"},\"selfManagedUpgradeProfile\":{\"version\":\"ufizuckyf\"}},\"observabilityProfile\":{\"metrics\":{\"metricsEndpoint\":\"idf\"}},\"connectivityProfile\":{\"eastWestGateway\":{\"visibility\":\"External\"},\"privateConnect\":{\"subnetResourceId\":\"uht\"}},\"provisioningState\":\"Canceled\"},\"location\":\"sdkf\",\"tags\":{\"km\":\"xmnteiwaop\",\"mzidnsezcxtb\":\"jcmmxdcufufsrp\",\"dwzjeiach\":\"sgfyccsnew\"},\"id\":\"oosflnr\",\"name\":\"sfqpteehz\",\"type\":\"vypyqrimzinpv\"}") + .toObject(AppLinkMemberInner.class); + Assertions.assertEquals("sdkf", model.location()); + Assertions.assertEquals("xmnteiwaop", model.tags().get("km")); + Assertions.assertEquals(ClusterType.AKS, model.properties().clusterType()); + Assertions.assertEquals("wu", model.properties().metadata().resourceId()); + Assertions.assertEquals(UpgradeMode.FULLY_MANAGED, model.properties().upgradeProfile().mode()); + Assertions.assertEquals(UpgradeReleaseChannel.RAPID, + model.properties().upgradeProfile().fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("ufizuckyf", model.properties().upgradeProfile().selfManagedUpgradeProfile().version()); + Assertions.assertEquals(EastWestGatewayVisibility.EXTERNAL, + model.properties().connectivityProfile().eastWestGateway().visibility()); + Assertions.assertEquals("uht", model.properties().connectivityProfile().privateConnect().subnetResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AppLinkMemberInner model = new AppLinkMemberInner().withLocation("sdkf") + .withTags(mapOf("km", "xmnteiwaop", "mzidnsezcxtb", "jcmmxdcufufsrp", "dwzjeiach", "sgfyccsnew")) + .withProperties(new AppLinkMemberProperties().withClusterType(ClusterType.AKS) + .withMetadata(new Metadata().withResourceId("wu")) + .withUpgradeProfile(new UpgradeProfile().withMode(UpgradeMode.FULLY_MANAGED) + .withFullyManagedUpgradeProfile( + new FullyManagedUpgradeProfile().withReleaseChannel(UpgradeReleaseChannel.RAPID)) + .withSelfManagedUpgradeProfile(new SelfManagedUpgradeProfile().withVersion("ufizuckyf"))) + .withObservabilityProfile(new ObservabilityProfile().withMetrics(new MetricsProfile())) + .withConnectivityProfile(new ConnectivityProfile() + .withEastWestGateway( + new EastWestGatewayProfile().withVisibility(EastWestGatewayVisibility.EXTERNAL)) + .withPrivateConnect(new PrivateConnectProfile().withSubnetResourceId("uht")))); + model = BinaryData.fromObject(model).toObject(AppLinkMemberInner.class); + Assertions.assertEquals("sdkf", model.location()); + Assertions.assertEquals("xmnteiwaop", model.tags().get("km")); + Assertions.assertEquals(ClusterType.AKS, model.properties().clusterType()); + Assertions.assertEquals("wu", model.properties().metadata().resourceId()); + Assertions.assertEquals(UpgradeMode.FULLY_MANAGED, model.properties().upgradeProfile().mode()); + Assertions.assertEquals(UpgradeReleaseChannel.RAPID, + model.properties().upgradeProfile().fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("ufizuckyf", model.properties().upgradeProfile().selfManagedUpgradeProfile().version()); + Assertions.assertEquals(EastWestGatewayVisibility.EXTERNAL, + model.properties().connectivityProfile().eastWestGateway().visibility()); + Assertions.assertEquals("uht", model.properties().connectivityProfile().privateConnect().subnetResourceId()); + } + + // 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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberListResultTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberListResultTests.java new file mode 100644 index 000000000000..8e2f78b211cb --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberListResultTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.implementation.models.AppLinkMemberListResult; +import com.azure.resourcemanager.applink.models.ClusterType; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +import org.junit.jupiter.api.Assertions; + +public final class AppLinkMemberListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AppLinkMemberListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"clusterType\":\"AKS\",\"metadata\":{\"resourceId\":\"zloc\"},\"upgradeProfile\":{\"mode\":\"FullyManaged\",\"fullyManagedUpgradeProfile\":{\"releaseChannel\":\"Rapid\"},\"selfManagedUpgradeProfile\":{\"version\":\"erhhbcsglumm\"}},\"observabilityProfile\":{\"metrics\":{\"metricsEndpoint\":\"aodxo\"}},\"connectivityProfile\":{\"eastWestGateway\":{\"visibility\":\"Internal\"},\"privateConnect\":{\"subnetResourceId\":\"k\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"kajionpim\",\"tags\":{\"odgmaajrmvdjwz\":\"stxgc\",\"ctbzaq\":\"lovmclwhijcoe\"},\"id\":\"qsycbkbfkgu\",\"name\":\"dkexxppofm\",\"type\":\"axcfjpgddtocjjx\"},{\"properties\":{\"clusterType\":\"AKS\",\"metadata\":{\"resourceId\":\"o\"},\"upgradeProfile\":{\"mode\":\"SelfManaged\",\"fullyManagedUpgradeProfile\":{\"releaseChannel\":\"Stable\"},\"selfManagedUpgradeProfile\":{\"version\":\"xibqeojnx\"}},\"observabilityProfile\":{\"metrics\":{\"metricsEndpoint\":\"ddntwndei\"}},\"connectivityProfile\":{\"eastWestGateway\":{\"visibility\":\"Internal\"},\"privateConnect\":{\"subnetResourceId\":\"pzaoqvuhr\"}},\"provisioningState\":\"Deleting\"},\"location\":\"cyddglmjthjqk\",\"tags\":{\"uigdtopbobjog\":\"eicxmqciwqvhkhi\",\"w\":\"m\",\"a\":\"a\",\"iotkftutqxl\":\"hrzayvvtpgvdf\"},\"id\":\"gxlefgugnxkrxd\",\"name\":\"mi\",\"type\":\"tthzrvqd\"},{\"properties\":{\"clusterType\":\"AKS\",\"metadata\":{\"resourceId\":\"jybige\"},\"upgradeProfile\":{\"mode\":\"FullyManaged\",\"fullyManagedUpgradeProfile\":{\"releaseChannel\":\"Rapid\"},\"selfManagedUpgradeProfile\":{\"version\":\"wska\"}},\"observabilityProfile\":{\"metrics\":{\"metricsEndpoint\":\"zlcuiywgqywgndrv\"}},\"connectivityProfile\":{\"eastWestGateway\":{\"visibility\":\"External\"},\"privateConnect\":{\"subnetResourceId\":\"pphrcgynco\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"fvm\",\"tags\":{\"zevgb\":\"ofsx\"},\"id\":\"qjqabcypmivkwl\",\"name\":\"uvcc\",\"type\":\"wnfnbacf\"}],\"nextLink\":\"nlebxetqgtzxd\"}") + .toObject(AppLinkMemberListResult.class); + Assertions.assertEquals("kajionpim", model.value().get(0).location()); + Assertions.assertEquals("stxgc", model.value().get(0).tags().get("odgmaajrmvdjwz")); + Assertions.assertEquals(ClusterType.AKS, model.value().get(0).properties().clusterType()); + Assertions.assertEquals("zloc", model.value().get(0).properties().metadata().resourceId()); + Assertions.assertEquals(UpgradeMode.FULLY_MANAGED, model.value().get(0).properties().upgradeProfile().mode()); + Assertions.assertEquals(UpgradeReleaseChannel.RAPID, + model.value().get(0).properties().upgradeProfile().fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("erhhbcsglumm", + model.value().get(0).properties().upgradeProfile().selfManagedUpgradeProfile().version()); + Assertions.assertEquals(EastWestGatewayVisibility.INTERNAL, + model.value().get(0).properties().connectivityProfile().eastWestGateway().visibility()); + Assertions.assertEquals("k", + model.value().get(0).properties().connectivityProfile().privateConnect().subnetResourceId()); + Assertions.assertEquals("nlebxetqgtzxd", model.nextLink()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberPropertiesTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberPropertiesTests.java new file mode 100644 index 000000000000..e3d60cec2634 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMemberPropertiesTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.AppLinkMemberProperties; +import com.azure.resourcemanager.applink.models.ClusterType; +import com.azure.resourcemanager.applink.models.ConnectivityProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.FullyManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.Metadata; +import com.azure.resourcemanager.applink.models.MetricsProfile; +import com.azure.resourcemanager.applink.models.ObservabilityProfile; +import com.azure.resourcemanager.applink.models.PrivateConnectProfile; +import com.azure.resourcemanager.applink.models.SelfManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +import org.junit.jupiter.api.Assertions; + +public final class AppLinkMemberPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AppLinkMemberProperties model = BinaryData.fromString( + "{\"clusterType\":\"AKS\",\"metadata\":{\"resourceId\":\"dkirsoodqxhcr\"},\"upgradeProfile\":{\"mode\":\"FullyManaged\",\"fullyManagedUpgradeProfile\":{\"releaseChannel\":\"Stable\"},\"selfManagedUpgradeProfile\":{\"version\":\"ckwhds\"}},\"observabilityProfile\":{\"metrics\":{\"metricsEndpoint\":\"yip\"}},\"connectivityProfile\":{\"eastWestGateway\":{\"visibility\":\"External\"},\"privateConnect\":{\"subnetResourceId\":\"pgrjbz\"}},\"provisioningState\":\"Provisioning\"}") + .toObject(AppLinkMemberProperties.class); + Assertions.assertEquals(ClusterType.AKS, model.clusterType()); + Assertions.assertEquals("dkirsoodqxhcr", model.metadata().resourceId()); + Assertions.assertEquals(UpgradeMode.FULLY_MANAGED, model.upgradeProfile().mode()); + Assertions.assertEquals(UpgradeReleaseChannel.STABLE, + model.upgradeProfile().fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("ckwhds", model.upgradeProfile().selfManagedUpgradeProfile().version()); + Assertions.assertEquals(EastWestGatewayVisibility.EXTERNAL, + model.connectivityProfile().eastWestGateway().visibility()); + Assertions.assertEquals("pgrjbz", model.connectivityProfile().privateConnect().subnetResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AppLinkMemberProperties model = new AppLinkMemberProperties().withClusterType(ClusterType.AKS) + .withMetadata(new Metadata().withResourceId("dkirsoodqxhcr")) + .withUpgradeProfile(new UpgradeProfile().withMode(UpgradeMode.FULLY_MANAGED) + .withFullyManagedUpgradeProfile( + new FullyManagedUpgradeProfile().withReleaseChannel(UpgradeReleaseChannel.STABLE)) + .withSelfManagedUpgradeProfile(new SelfManagedUpgradeProfile().withVersion("ckwhds"))) + .withObservabilityProfile(new ObservabilityProfile().withMetrics(new MetricsProfile())) + .withConnectivityProfile(new ConnectivityProfile() + .withEastWestGateway(new EastWestGatewayProfile().withVisibility(EastWestGatewayVisibility.EXTERNAL)) + .withPrivateConnect(new PrivateConnectProfile().withSubnetResourceId("pgrjbz"))); + model = BinaryData.fromObject(model).toObject(AppLinkMemberProperties.class); + Assertions.assertEquals(ClusterType.AKS, model.clusterType()); + Assertions.assertEquals("dkirsoodqxhcr", model.metadata().resourceId()); + Assertions.assertEquals(UpgradeMode.FULLY_MANAGED, model.upgradeProfile().mode()); + Assertions.assertEquals(UpgradeReleaseChannel.STABLE, + model.upgradeProfile().fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("ckwhds", model.upgradeProfile().selfManagedUpgradeProfile().version()); + Assertions.assertEquals(EastWestGatewayVisibility.EXTERNAL, + model.connectivityProfile().eastWestGateway().visibility()); + Assertions.assertEquals("pgrjbz", model.connectivityProfile().privateConnect().subnetResourceId()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersCreateOrUpdateMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..890299050d3d --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersCreateOrUpdateMockTests.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.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.models.AppLinkMember; +import com.azure.resourcemanager.applink.models.AppLinkMemberProperties; +import com.azure.resourcemanager.applink.models.ClusterType; +import com.azure.resourcemanager.applink.models.ConnectivityProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.FullyManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.Metadata; +import com.azure.resourcemanager.applink.models.MetricsProfile; +import com.azure.resourcemanager.applink.models.ObservabilityProfile; +import com.azure.resourcemanager.applink.models.PrivateConnectProfile; +import com.azure.resourcemanager.applink.models.SelfManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +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 AppLinkMembersCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"clusterType\":\"AKS\",\"metadata\":{\"resourceId\":\"pvjzbe\"},\"upgradeProfile\":{\"mode\":\"FullyManaged\",\"fullyManagedUpgradeProfile\":{\"releaseChannel\":\"Stable\"},\"selfManagedUpgradeProfile\":{\"version\":\"fqqnvwpmqtaruo\"}},\"observabilityProfile\":{\"metrics\":{\"metricsEndpoint\":\"cjhwq\"}},\"connectivityProfile\":{\"eastWestGateway\":{\"visibility\":\"Internal\"},\"privateConnect\":{\"subnetResourceId\":\"bnw\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"drjervnaenqpehin\",\"tags\":{\"dslgnayqigynduh\":\"gmifthnzd\"},\"id\":\"vhqlkthumaqo\",\"name\":\"bgycduiertgccym\",\"type\":\"aolps\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AppLinkMember response = manager.appLinkMembers() + .define("ivkrtsw") + .withRegion("crsbfovasr") + .withExistingAppLink("n", "u") + .withTags(mapOf("gjb", "wbhsqfsub")) + .withProperties(new AppLinkMemberProperties().withClusterType(ClusterType.AKS) + .withMetadata(new Metadata().withResourceId("vszjfauvjfdxxi")) + .withUpgradeProfile(new UpgradeProfile().withMode(UpgradeMode.FULLY_MANAGED) + .withFullyManagedUpgradeProfile( + new FullyManagedUpgradeProfile().withReleaseChannel(UpgradeReleaseChannel.RAPID)) + .withSelfManagedUpgradeProfile(new SelfManagedUpgradeProfile().withVersion("qaqtdoqmcbxvwvxy"))) + .withObservabilityProfile(new ObservabilityProfile().withMetrics(new MetricsProfile())) + .withConnectivityProfile(new ConnectivityProfile() + .withEastWestGateway( + new EastWestGatewayProfile().withVisibility(EastWestGatewayVisibility.EXTERNAL)) + .withPrivateConnect(new PrivateConnectProfile().withSubnetResourceId("wwfbkrvrnsvshq")))) + .create(); + + Assertions.assertEquals("drjervnaenqpehin", response.location()); + Assertions.assertEquals("gmifthnzd", response.tags().get("dslgnayqigynduh")); + Assertions.assertEquals(ClusterType.AKS, response.properties().clusterType()); + Assertions.assertEquals("pvjzbe", response.properties().metadata().resourceId()); + Assertions.assertEquals(UpgradeMode.FULLY_MANAGED, response.properties().upgradeProfile().mode()); + Assertions.assertEquals(UpgradeReleaseChannel.STABLE, + response.properties().upgradeProfile().fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("fqqnvwpmqtaruo", + response.properties().upgradeProfile().selfManagedUpgradeProfile().version()); + Assertions.assertEquals(EastWestGatewayVisibility.INTERNAL, + response.properties().connectivityProfile().eastWestGateway().visibility()); + Assertions.assertEquals("bnw", response.properties().connectivityProfile().privateConnect().subnetResourceId()); + } + + // 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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersGetWithResponseMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersGetWithResponseMockTests.java new file mode 100644 index 000000000000..bd60557df581 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersGetWithResponseMockTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.models.AppLinkMember; +import com.azure.resourcemanager.applink.models.ClusterType; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +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 AppLinkMembersGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"clusterType\":\"AKS\",\"metadata\":{\"resourceId\":\"nojvknmefqsg\"},\"upgradeProfile\":{\"mode\":\"FullyManaged\",\"fullyManagedUpgradeProfile\":{\"releaseChannel\":\"Rapid\"},\"selfManagedUpgradeProfile\":{\"version\":\"jyzhpvgq\"}},\"observabilityProfile\":{\"metrics\":{\"metricsEndpoint\":\"vxdjzlmwlxkvugf\"}},\"connectivityProfile\":{\"eastWestGateway\":{\"visibility\":\"External\"},\"privateConnect\":{\"subnetResourceId\":\"wjvzunluthnn\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"i\",\"tags\":{\"tskzbbtdzumveek\":\"lpjzuaejxdu\",\"uh\":\"pwo\",\"us\":\"fpbsjyofdxl\",\"smv\":\"ttouwaboekqvkel\"},\"id\":\"xwyjsflhhc\",\"name\":\"aln\",\"type\":\"ixisxyawjoy\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AppLinkMember response = manager.appLinkMembers() + .getWithResponse("rknftguvriuhprwm", "yvxqtayriwwroy", "bexrmcq", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("i", response.location()); + Assertions.assertEquals("lpjzuaejxdu", response.tags().get("tskzbbtdzumveek")); + Assertions.assertEquals(ClusterType.AKS, response.properties().clusterType()); + Assertions.assertEquals("nojvknmefqsg", response.properties().metadata().resourceId()); + Assertions.assertEquals(UpgradeMode.FULLY_MANAGED, response.properties().upgradeProfile().mode()); + Assertions.assertEquals(UpgradeReleaseChannel.RAPID, + response.properties().upgradeProfile().fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("jyzhpvgq", + response.properties().upgradeProfile().selfManagedUpgradeProfile().version()); + Assertions.assertEquals(EastWestGatewayVisibility.EXTERNAL, + response.properties().connectivityProfile().eastWestGateway().visibility()); + Assertions.assertEquals("wjvzunluthnn", + response.properties().connectivityProfile().privateConnect().subnetResourceId()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersListByAppLinkMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersListByAppLinkMockTests.java new file mode 100644 index 000000000000..71da84fac4c0 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkMembersListByAppLinkMockTests.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.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.models.AppLinkMember; +import com.azure.resourcemanager.applink.models.ClusterType; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +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 AppLinkMembersListByAppLinkMockTests { + @Test + public void testListByAppLink() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"clusterType\":\"AKS\",\"metadata\":{\"resourceId\":\"xhnrztfolhb\"},\"upgradeProfile\":{\"mode\":\"SelfManaged\",\"fullyManagedUpgradeProfile\":{\"releaseChannel\":\"Stable\"},\"selfManagedUpgradeProfile\":{\"version\":\"aulppggd\"}},\"observabilityProfile\":{\"metrics\":{\"metricsEndpoint\":\"pnyiropuhp\"}},\"connectivityProfile\":{\"eastWestGateway\":{\"visibility\":\"Internal\"},\"privateConnect\":{\"subnetResourceId\":\"ylgqgitxmedjvcsl\"}},\"provisioningState\":\"Deleting\"},\"location\":\"wncwzzhxgktrmg\",\"tags\":{\"fqbuaceopzf\":\"apkteoellwptfdyg\",\"lzdahzxctobgbkdm\":\"rhhuaopppcqeqx\",\"grcfb\":\"izpost\"},\"id\":\"nrmfqjhhk\",\"name\":\"bpvjymjhx\",\"type\":\"j\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.appLinkMembers().listByAppLink("qcslyjpkiid", "yexz", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("wncwzzhxgktrmg", response.iterator().next().location()); + Assertions.assertEquals("apkteoellwptfdyg", response.iterator().next().tags().get("fqbuaceopzf")); + Assertions.assertEquals(ClusterType.AKS, response.iterator().next().properties().clusterType()); + Assertions.assertEquals("xhnrztfolhb", response.iterator().next().properties().metadata().resourceId()); + Assertions.assertEquals(UpgradeMode.SELF_MANAGED, + response.iterator().next().properties().upgradeProfile().mode()); + Assertions.assertEquals(UpgradeReleaseChannel.STABLE, + response.iterator().next().properties().upgradeProfile().fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("aulppggd", + response.iterator().next().properties().upgradeProfile().selfManagedUpgradeProfile().version()); + Assertions.assertEquals(EastWestGatewayVisibility.INTERNAL, + response.iterator().next().properties().connectivityProfile().eastWestGateway().visibility()); + Assertions.assertEquals("ylgqgitxmedjvcsl", + response.iterator().next().properties().connectivityProfile().privateConnect().subnetResourceId()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkPropertiesTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkPropertiesTests.java new file mode 100644 index 000000000000..dac78ecc55bd --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinkPropertiesTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.AppLinkProperties; + +public final class AppLinkPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AppLinkProperties model + = BinaryData.fromString("{\"provisioningState\":\"Provisioning\"}").toObject(AppLinkProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AppLinkProperties model = new AppLinkProperties(); + model = BinaryData.fromObject(model).toObject(AppLinkProperties.class); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksCreateOrUpdateMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..ad098470e205 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksCreateOrUpdateMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.models.AppLink; +import com.azure.resourcemanager.applink.models.AppLinkProperties; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentity; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.applink.models.UserAssignedIdentity; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +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 AppLinksCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"rqhakauha\",\"tenantId\":\"sfwxosowzxc\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"zceuojgjrw\":{\"principalId\":\"ooxdjebwpuc\",\"clientId\":\"fvovbvmeuecivy\"},\"qwgxhniskx\":{\"principalId\":\"eiotwmcdytdx\",\"clientId\":\"txnrjaw\"},\"btdhxujznbm\":{\"principalId\":\"kpycgklwndnhjd\",\"clientId\":\"whvylw\"},\"hfxobbcswsrtj\":{\"principalId\":\"wuwprzqlv\",\"clientId\":\"alupjm\"}}},\"location\":\"plrbpbewtghf\",\"tags\":{\"wxzvlvqhjkb\":\"c\",\"iebwwaloayqcgwrt\":\"gibtnm\",\"zg\":\"j\"},\"id\":\"yzm\",\"name\":\"txon\",\"type\":\"mtsavjcbpwxqp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AppLink response = manager.appLinks() + .define("ca") + .withRegion("hmdua") + .withExistingResourceGroup("rxsbkyvp") + .withTags(mapOf("rcrgvx", "xqpvfadmw")) + .withProperties(new AppLinkProperties()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("hvljuahaquh", new UserAssignedIdentity()))) + .create(); + + Assertions.assertEquals("plrbpbewtghf", response.location()); + Assertions.assertEquals("c", response.tags().get("wxzvlvqhjkb")); + 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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksGetByResourceGroupWithResponseMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..95a8aa8ad00b --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksGetByResourceGroupWithResponseMockTests.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.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.models.AppLink; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +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 AppLinksGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Updating\"},\"identity\":{\"principalId\":\"ankxmyskpbhenb\",\"tenantId\":\"cxy\",\"type\":\"None\",\"userAssignedIdentities\":{\"lhaaxdbabp\":{\"principalId\":\"rsyn\",\"clientId\":\"idybyxczf\"},\"ckzywbiexzfeyue\":{\"principalId\":\"wrqlfktsthsuco\",\"clientId\":\"nyyazttbtwwrqpue\"}}},\"location\":\"ibx\",\"tags\":{\"pdkzjancuxr\":\"bhqwalmuzyoxa\",\"bavxbniwdjswzt\":\"d\"},\"id\":\"dbpgnxytxhp\",\"name\":\"xbzpfzab\",\"type\":\"lcuhxwtctyqiklb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AppLink response = manager.appLinks() + .getByResourceGroupWithResponse("siarbutrcvpn", "zzmhjrunmpxttd", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ibx", response.location()); + Assertions.assertEquals("bhqwalmuzyoxa", response.tags().get("pdkzjancuxr")); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksListByResourceGroupMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksListByResourceGroupMockTests.java new file mode 100644 index 000000000000..6b8ceab7cf30 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksListByResourceGroupMockTests.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.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.models.AppLink; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +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 AppLinksListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Provisioning\"},\"identity\":{\"principalId\":\"u\",\"tenantId\":\"osvmk\",\"type\":\"None\",\"userAssignedIdentities\":{\"deslp\":{\"principalId\":\"ukkfplgmgs\",\"clientId\":\"kjz\"}}},\"location\":\"opwi\",\"tags\":{\"zb\":\"hxpkd\",\"upedeojnabckhs\":\"iuebbaumny\"},\"id\":\"txp\",\"name\":\"ie\",\"type\":\"tfhvpesapskrdqmh\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.appLinks().listByResourceGroup("ovplw", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("opwi", response.iterator().next().location()); + Assertions.assertEquals("hxpkd", response.iterator().next().tags().get("zb")); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksListMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksListMockTests.java new file mode 100644 index 000000000000..61062f42ea0a --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AppLinksListMockTests.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.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.models.AppLink; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +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 AppLinksListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\"},\"identity\":{\"principalId\":\"dwkyzxuu\",\"tenantId\":\"ncwscwsvlxoto\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"yfjfcnjbkcn\":{\"principalId\":\"pqsxvnmicy\",\"clientId\":\"ceoveilovno\"},\"phoxus\":{\"principalId\":\"hbttkphyw\",\"clientId\":\"vjtoqnermclfp\"},\"wfqkquj\":{\"principalId\":\"pabgyeps\",\"clientId\":\"tazqugxywpmueefj\"}}},\"location\":\"suyonobglaocq\",\"tags\":{\"ytlmoyrxvwfud\":\"cmgyud\"},\"id\":\"pz\",\"name\":\"txhdzh\",\"type\":\"rqjbhckfrl\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.appLinks().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("suyonobglaocq", response.iterator().next().location()); + Assertions.assertEquals("cmgyud", response.iterator().next().tags().get("ytlmoyrxvwfud")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionInnerTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionInnerTests.java new file mode 100644 index 000000000000..747ddea784a2 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionInnerTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.fluent.models.AvailableVersionInner; +import org.junit.jupiter.api.Assertions; + +public final class AvailableVersionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AvailableVersionInner model = BinaryData.fromString( + "{\"properties\":{\"kubernetesVersion\":\"xhqyudxorrqnb\",\"fullyManagedVersions\":{\"releaseChannels\":[{\"releaseChannel\":\"czvyifq\",\"version\":\"vkd\"},{\"releaseChannel\":\"jsllrmv\",\"version\":\"d\"}]},\"selfManagedVersions\":{\"versions\":[{\"version\":\"atkpnp\",\"upgrades\":[\"exxbczwtr\",\"wiqzbqjvsovmyo\",\"acspkwl\"]},{\"version\":\"zdobpxjmflbvvnch\",\"upgrades\":[\"cciw\",\"zjuqkhrsaj\",\"wkuofoskghsauu\",\"mjmvxieduugidyjr\"]},{\"version\":\"f\",\"upgrades\":[\"aos\"]},{\"version\":\"e\",\"upgrades\":[\"sonpclhocohs\",\"kevle\",\"gz\"]}]},\"provisioningState\":\"Failed\"},\"id\":\"fmvfaxkffeiit\",\"name\":\"lvmezyvshxmzsbbz\",\"type\":\"ggi\"}") + .toObject(AvailableVersionInner.class); + Assertions.assertEquals("xhqyudxorrqnb", model.properties().kubernetesVersion()); + Assertions.assertEquals("czvyifq", + model.properties().fullyManagedVersions().releaseChannels().get(0).releaseChannel()); + Assertions.assertEquals("vkd", model.properties().fullyManagedVersions().releaseChannels().get(0).version()); + Assertions.assertEquals("atkpnp", model.properties().selfManagedVersions().versions().get(0).version()); + Assertions.assertEquals("exxbczwtr", + model.properties().selfManagedVersions().versions().get(0).upgrades().get(0)); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionListResultTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionListResultTests.java new file mode 100644 index 000000000000..691ef5078730 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionListResultTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.implementation.models.AvailableVersionListResult; +import org.junit.jupiter.api.Assertions; + +public final class AvailableVersionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AvailableVersionListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"kubernetesVersion\":\"eypvhezrkg\",\"fullyManagedVersions\":{\"releaseChannels\":[{\"releaseChannel\":\"c\",\"version\":\"refovgmkqsleyyvx\"},{\"releaseChannel\":\"qjpkcattpngjcrc\",\"version\":\"zsqpjhvmdajvny\"},{\"releaseChannel\":\"ounqecano\",\"version\":\"eupfhyhltrpm\"}]},\"selfManagedVersions\":{\"versions\":[{\"version\":\"jmcmatuokthfu\",\"upgrades\":[]},{\"version\":\"uaodsfcpk\",\"upgrades\":[]},{\"version\":\"xodpuozmyzydagfu\",\"upgrades\":[]},{\"version\":\"xbezyiuokktwh\",\"upgrades\":[]}]},\"provisioningState\":\"Accepted\"},\"id\":\"zywqsmbsu\",\"name\":\"exim\",\"type\":\"ryocfsfksymdd\"}],\"nextLink\":\"tki\"}") + .toObject(AvailableVersionListResult.class); + Assertions.assertEquals("eypvhezrkg", model.value().get(0).properties().kubernetesVersion()); + Assertions.assertEquals("c", + model.value().get(0).properties().fullyManagedVersions().releaseChannels().get(0).releaseChannel()); + Assertions.assertEquals("refovgmkqsleyyvx", + model.value().get(0).properties().fullyManagedVersions().releaseChannels().get(0).version()); + Assertions.assertEquals("jmcmatuokthfu", + model.value().get(0).properties().selfManagedVersions().versions().get(0).version()); + Assertions.assertEquals("tki", model.nextLink()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionPropertiesTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionPropertiesTests.java new file mode 100644 index 000000000000..d57a35af34ab --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionPropertiesTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.AvailableVersionProperties; +import org.junit.jupiter.api.Assertions; + +public final class AvailableVersionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AvailableVersionProperties model = BinaryData.fromString( + "{\"kubernetesVersion\":\"rxwburv\",\"fullyManagedVersions\":{\"releaseChannels\":[{\"releaseChannel\":\"xjnspy\",\"version\":\"ptkoenkoukn\"},{\"releaseChannel\":\"udwtiukbl\",\"version\":\"ngkpocipazy\"},{\"releaseChannel\":\"o\",\"version\":\"gukgjnpiucgygevq\"}]},\"selfManagedVersions\":{\"versions\":[{\"version\":\"typmrbpizcdrqjsd\",\"upgrades\":[\"dnfyhxdeoejzicwi\",\"sjttgzfbish\",\"bkh\",\"jdeyeamdpha\"]},{\"version\":\"alpbuxwgipwhon\",\"upgrades\":[\"kgshwa\",\"kix\"]},{\"version\":\"bin\",\"upgrades\":[\"pu\",\"tmryw\",\"uzoqft\",\"yqzrnkcqvyxlw\"]},{\"version\":\"zlsico\",\"upgrades\":[\"qqn\",\"vlryavwhheunmmq\",\"gyxzk\"]}]},\"provisioningState\":\"Accepted\"}") + .toObject(AvailableVersionProperties.class); + Assertions.assertEquals("rxwburv", model.kubernetesVersion()); + Assertions.assertEquals("xjnspy", model.fullyManagedVersions().releaseChannels().get(0).releaseChannel()); + Assertions.assertEquals("ptkoenkoukn", model.fullyManagedVersions().releaseChannels().get(0).version()); + Assertions.assertEquals("typmrbpizcdrqjsd", model.selfManagedVersions().versions().get(0).version()); + Assertions.assertEquals("dnfyhxdeoejzicwi", model.selfManagedVersions().versions().get(0).upgrades().get(0)); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionsListByLocationMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionsListByLocationMockTests.java new file mode 100644 index 000000000000..cfcd9e2b4fbf --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/AvailableVersionsListByLocationMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.models.AvailableVersion; +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 AvailableVersionsListByLocationMockTests { + @Test + public void testListByLocation() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"kubernetesVersion\":\"hszhedplvwiwu\",\"fullyManagedVersions\":{\"releaseChannels\":[{\"releaseChannel\":\"wmbesldnkw\",\"version\":\"tppjflcx\"},{\"releaseChannel\":\"gaokonzmnsikv\",\"version\":\"kqze\"}]},\"selfManagedVersions\":{\"versions\":[{\"version\":\"kdltfzxmhhvhg\",\"upgrades\":[\"eodkwobda\"]},{\"version\":\"xtibqdxbxwakbog\",\"upgrades\":[\"ndlkzgxhurip\",\"bpodxunkbebxm\",\"byyntwlrbqt\"]}]},\"provisioningState\":\"Canceled\"},\"id\":\"vseotgqrl\",\"name\":\"tmuwlauwzi\",\"type\":\"xbmp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.availableVersions().listByLocation("tmweriofzpyq", "emwabnet", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("hszhedplvwiwu", response.iterator().next().properties().kubernetesVersion()); + Assertions.assertEquals("wmbesldnkw", + response.iterator().next().properties().fullyManagedVersions().releaseChannels().get(0).releaseChannel()); + Assertions.assertEquals("tppjflcx", + response.iterator().next().properties().fullyManagedVersions().releaseChannels().get(0).version()); + Assertions.assertEquals("kdltfzxmhhvhg", + response.iterator().next().properties().selfManagedVersions().versions().get(0).version()); + Assertions.assertEquals("eodkwobda", + response.iterator().next().properties().selfManagedVersions().versions().get(0).upgrades().get(0)); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ConnectivityProfileTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ConnectivityProfileTests.java new file mode 100644 index 000000000000..7a43bedc9c87 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ConnectivityProfileTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.ConnectivityProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import com.azure.resourcemanager.applink.models.PrivateConnectProfile; +import org.junit.jupiter.api.Assertions; + +public final class ConnectivityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectivityProfile model = BinaryData + .fromString( + "{\"eastWestGateway\":{\"visibility\":\"External\"},\"privateConnect\":{\"subnetResourceId\":\"pku\"}}") + .toObject(ConnectivityProfile.class); + Assertions.assertEquals(EastWestGatewayVisibility.EXTERNAL, model.eastWestGateway().visibility()); + Assertions.assertEquals("pku", model.privateConnect().subnetResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectivityProfile model = new ConnectivityProfile() + .withEastWestGateway(new EastWestGatewayProfile().withVisibility(EastWestGatewayVisibility.EXTERNAL)) + .withPrivateConnect(new PrivateConnectProfile().withSubnetResourceId("pku")); + model = BinaryData.fromObject(model).toObject(ConnectivityProfile.class); + Assertions.assertEquals(EastWestGatewayVisibility.EXTERNAL, model.eastWestGateway().visibility()); + Assertions.assertEquals("pku", model.privateConnect().subnetResourceId()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/EastWestGatewayProfileTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/EastWestGatewayProfileTests.java new file mode 100644 index 000000000000..802d0d8da28d --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/EastWestGatewayProfileTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.EastWestGatewayProfile; +import com.azure.resourcemanager.applink.models.EastWestGatewayVisibility; +import org.junit.jupiter.api.Assertions; + +public final class EastWestGatewayProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EastWestGatewayProfile model + = BinaryData.fromString("{\"visibility\":\"External\"}").toObject(EastWestGatewayProfile.class); + Assertions.assertEquals(EastWestGatewayVisibility.EXTERNAL, model.visibility()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EastWestGatewayProfile model = new EastWestGatewayProfile().withVisibility(EastWestGatewayVisibility.EXTERNAL); + model = BinaryData.fromObject(model).toObject(EastWestGatewayProfile.class); + Assertions.assertEquals(EastWestGatewayVisibility.EXTERNAL, model.visibility()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/FullyManagedUpgradeProfileTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/FullyManagedUpgradeProfileTests.java new file mode 100644 index 000000000000..3fbd1df28433 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/FullyManagedUpgradeProfileTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.FullyManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +import org.junit.jupiter.api.Assertions; + +public final class FullyManagedUpgradeProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FullyManagedUpgradeProfile model + = BinaryData.fromString("{\"releaseChannel\":\"Stable\"}").toObject(FullyManagedUpgradeProfile.class); + Assertions.assertEquals(UpgradeReleaseChannel.STABLE, model.releaseChannel()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FullyManagedUpgradeProfile model + = new FullyManagedUpgradeProfile().withReleaseChannel(UpgradeReleaseChannel.STABLE); + model = BinaryData.fromObject(model).toObject(FullyManagedUpgradeProfile.class); + Assertions.assertEquals(UpgradeReleaseChannel.STABLE, model.releaseChannel()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/FullyManagedVersionsTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/FullyManagedVersionsTests.java new file mode 100644 index 000000000000..0f76aaf6da79 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/FullyManagedVersionsTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.FullyManagedVersions; +import org.junit.jupiter.api.Assertions; + +public final class FullyManagedVersionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FullyManagedVersions model = BinaryData.fromString( + "{\"releaseChannels\":[{\"releaseChannel\":\"uko\",\"version\":\"lyaxuc\"},{\"releaseChannel\":\"nuqszfkbey\",\"version\":\"ewrmjmwvvjektc\"},{\"releaseChannel\":\"senhwlrs\",\"version\":\"frzpwvlqdqgb\"},{\"releaseChannel\":\"qylihkaetckt\",\"version\":\"fcivfsnkym\"}]}") + .toObject(FullyManagedVersions.class); + Assertions.assertEquals("uko", model.releaseChannels().get(0).releaseChannel()); + Assertions.assertEquals("lyaxuc", model.releaseChannels().get(0).version()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ManagedServiceIdentityTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ManagedServiceIdentityTests.java new file mode 100644 index 000000000000..bf160a9e65ef --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentity; +import com.azure.resourcemanager.applink.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.applink.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\":\"cmdv\",\"tenantId\":\"hulsuuvmkjozkrwf\",\"type\":\"None\",\"userAssignedIdentities\":{\"azakl\":{\"principalId\":\"jpslwejd\",\"clientId\":\"wryoqpsoacc\"},\"jakhmsbzjh\":{\"principalId\":\"ahbc\",\"clientId\":\"ffdfdosygexpa\"},\"zfsinzgvf\":{\"principalId\":\"zevdphlx\",\"clientId\":\"lthqtrgqjbp\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("azakl", new UserAssignedIdentity(), "jakhmsbzjh", + new UserAssignedIdentity(), "zfsinzgvf", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, 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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/MetadataTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/MetadataTests.java new file mode 100644 index 000000000000..592662c3dc06 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/MetadataTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.Metadata; +import org.junit.jupiter.api.Assertions; + +public final class MetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Metadata model = BinaryData.fromString("{\"resourceId\":\"cjxvsnbyxqab\"}").toObject(Metadata.class); + Assertions.assertEquals("cjxvsnbyxqab", model.resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Metadata model = new Metadata().withResourceId("cjxvsnbyxqab"); + model = BinaryData.fromObject(model).toObject(Metadata.class); + Assertions.assertEquals("cjxvsnbyxqab", model.resourceId()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/MetricsProfileTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/MetricsProfileTests.java new file mode 100644 index 000000000000..09a74f0e0844 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/MetricsProfileTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.MetricsProfile; + +public final class MetricsProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetricsProfile model + = BinaryData.fromString("{\"metricsEndpoint\":\"bqidtqaj\"}").toObject(MetricsProfile.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetricsProfile model = new MetricsProfile(); + model = BinaryData.fromObject(model).toObject(MetricsProfile.class); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ObservabilityProfileTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ObservabilityProfileTests.java new file mode 100644 index 000000000000..d6a6fb9eb401 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ObservabilityProfileTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.MetricsProfile; +import com.azure.resourcemanager.applink.models.ObservabilityProfile; + +public final class ObservabilityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ObservabilityProfile model + = BinaryData.fromString("{\"metrics\":{\"metricsEndpoint\":\"klj\"}}").toObject(ObservabilityProfile.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ObservabilityProfile model = new ObservabilityProfile().withMetrics(new MetricsProfile()); + model = BinaryData.fromObject(model).toObject(ObservabilityProfile.class); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationDisplayTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..268db8ac43be --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationInnerTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationInnerTests.java new file mode 100644 index 000000000000..784d31658cb1 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationListResultTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationListResultTests.java new file mode 100644 index 000000000000..63d14febb683 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationsListMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..ce954e2a2f75 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/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.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.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\":\"puz\",\"isDataAction\":true,\"display\":{\"provider\":\"nqzahmgkbrpyyd\",\"resource\":\"bnuqqkpik\",\"operation\":\"rgvtqag\",\"description\":\"uynhijg\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/PrivateConnectProfileTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/PrivateConnectProfileTests.java new file mode 100644 index 000000000000..9f2b2ce9202a --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/PrivateConnectProfileTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.PrivateConnectProfile; +import org.junit.jupiter.api.Assertions; + +public final class PrivateConnectProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateConnectProfile model + = BinaryData.fromString("{\"subnetResourceId\":\"krlkhbzhfepg\"}").toObject(PrivateConnectProfile.class); + Assertions.assertEquals("krlkhbzhfepg", model.subnetResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateConnectProfile model = new PrivateConnectProfile().withSubnetResourceId("krlkhbzhfepg"); + model = BinaryData.fromObject(model).toObject(PrivateConnectProfile.class); + Assertions.assertEquals("krlkhbzhfepg", model.subnetResourceId()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ReleaseChannelInfoTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ReleaseChannelInfoTests.java new file mode 100644 index 000000000000..4b0bd96487ec --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/ReleaseChannelInfoTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.ReleaseChannelInfo; +import org.junit.jupiter.api.Assertions; + +public final class ReleaseChannelInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ReleaseChannelInfo model = BinaryData.fromString("{\"releaseChannel\":\"ctq\",\"version\":\"jf\"}") + .toObject(ReleaseChannelInfo.class); + Assertions.assertEquals("ctq", model.releaseChannel()); + Assertions.assertEquals("jf", model.version()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/SelfManagedUpgradeProfileTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/SelfManagedUpgradeProfileTests.java new file mode 100644 index 000000000000..6bcb18ec4629 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/SelfManagedUpgradeProfileTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.SelfManagedUpgradeProfile; +import org.junit.jupiter.api.Assertions; + +public final class SelfManagedUpgradeProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SelfManagedUpgradeProfile model + = BinaryData.fromString("{\"version\":\"oq\"}").toObject(SelfManagedUpgradeProfile.class); + Assertions.assertEquals("oq", model.version()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SelfManagedUpgradeProfile model = new SelfManagedUpgradeProfile().withVersion("oq"); + model = BinaryData.fromObject(model).toObject(SelfManagedUpgradeProfile.class); + Assertions.assertEquals("oq", model.version()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/SelfManagedVersionsTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/SelfManagedVersionsTests.java new file mode 100644 index 000000000000..612bc5159b86 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/SelfManagedVersionsTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.SelfManagedVersions; +import org.junit.jupiter.api.Assertions; + +public final class SelfManagedVersionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SelfManagedVersions model = BinaryData.fromString( + "{\"versions\":[{\"version\":\"brjcxe\",\"upgrades\":[\"uwutttxfvjrbi\",\"phxepcyvahf\",\"ljkyqxjvuuj\"]},{\"version\":\"gidokgjljyoxgvcl\",\"upgrades\":[\"gsncghkjeszz\",\"bijhtxfvgxbf\",\"mxnehmp\",\"ec\"]}]}") + .toObject(SelfManagedVersions.class); + Assertions.assertEquals("brjcxe", model.versions().get(0).version()); + Assertions.assertEquals("uwutttxfvjrbi", model.versions().get(0).upgrades().get(0)); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoriesListByAppLinkMemberMockTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoriesListByAppLinkMemberMockTests.java new file mode 100644 index 000000000000..9747d79901ae --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoriesListByAppLinkMemberMockTests.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.applink.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.applink.ApplinkManager; +import com.azure.resourcemanager.applink.models.UpgradeHistory; +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 UpgradeHistoriesListByAppLinkMemberMockTests { + @Test + public void testListByAppLinkMember() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"startTimestamp\":\"2021-03-08T17:29:22Z\",\"endTimestamp\":\"2021-07-26T10:10:37Z\",\"initiatedBy\":\"mnvdfzn\",\"fromVersion\":\"daodvxzbncblyl\",\"toVersion\":\"stdbhhxsrzdzu\",\"provisioningState\":\"Accepted\"},\"id\":\"cdntnevfiwjmy\",\"name\":\"tdss\",\"type\":\"s\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ApplinkManager manager = ApplinkManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.upgradeHistories() + .listByAppLinkMember("lqlfm", "dnbbglzps", "iydmcwyhzdxs", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T17:29:22Z"), + response.iterator().next().properties().startTimestamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-26T10:10:37Z"), + response.iterator().next().properties().endTimestamp()); + Assertions.assertEquals("mnvdfzn", response.iterator().next().properties().initiatedBy()); + Assertions.assertEquals("daodvxzbncblyl", response.iterator().next().properties().fromVersion()); + Assertions.assertEquals("stdbhhxsrzdzu", response.iterator().next().properties().toVersion()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryInnerTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryInnerTests.java new file mode 100644 index 000000000000..70cdf1f4bd5d --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryInnerTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.fluent.models.UpgradeHistoryInner; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class UpgradeHistoryInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpgradeHistoryInner model = BinaryData.fromString( + "{\"properties\":{\"startTimestamp\":\"2021-02-11T14:48:18Z\",\"endTimestamp\":\"2021-10-27T15:38:07Z\",\"initiatedBy\":\"dnvowg\",\"fromVersion\":\"jjugwdkcglhslaz\",\"toVersion\":\"dyggdtjixhbku\",\"provisioningState\":\"Accepted\"},\"id\":\"e\",\"name\":\"kh\",\"type\":\"enevfyexfwhybci\"}") + .toObject(UpgradeHistoryInner.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T14:48:18Z"), model.properties().startTimestamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-27T15:38:07Z"), model.properties().endTimestamp()); + Assertions.assertEquals("dnvowg", model.properties().initiatedBy()); + Assertions.assertEquals("jjugwdkcglhslaz", model.properties().fromVersion()); + Assertions.assertEquals("dyggdtjixhbku", model.properties().toVersion()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryListResultTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryListResultTests.java new file mode 100644 index 000000000000..b7a92b5f846b --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryListResultTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.implementation.models.UpgradeHistoryListResult; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class UpgradeHistoryListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpgradeHistoryListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"startTimestamp\":\"2021-04-08T18:16:48Z\",\"endTimestamp\":\"2021-10-04T00:28:42Z\",\"initiatedBy\":\"wxrjfeallnwsub\",\"fromVersion\":\"snjampmng\",\"toVersion\":\"zscxaqwo\",\"provisioningState\":\"Updating\"},\"id\":\"bonqvpkvlrxnjeas\",\"name\":\"ipheoflokeyyien\",\"type\":\"bdlwtgrhpdjpj\"},{\"properties\":{\"startTimestamp\":\"2021-02-17T18:41:32Z\",\"endTimestamp\":\"2021-05-01T06:23:28Z\",\"initiatedBy\":\"azjpqyegualhbxxh\",\"fromVersion\":\"jj\",\"toVersion\":\"zvdudgwdslfhotwm\",\"provisioningState\":\"Succeeded\"},\"id\":\"wlbjnpgacftade\",\"name\":\"xnltyfsoppu\",\"type\":\"uesnzwdejbavo\"}],\"nextLink\":\"zdmohctbqvu\"}") + .toObject(UpgradeHistoryListResult.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-08T18:16:48Z"), + model.value().get(0).properties().startTimestamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T00:28:42Z"), + model.value().get(0).properties().endTimestamp()); + Assertions.assertEquals("wxrjfeallnwsub", model.value().get(0).properties().initiatedBy()); + Assertions.assertEquals("snjampmng", model.value().get(0).properties().fromVersion()); + Assertions.assertEquals("zscxaqwo", model.value().get(0).properties().toVersion()); + Assertions.assertEquals("zdmohctbqvu", model.nextLink()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryPropertiesTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryPropertiesTests.java new file mode 100644 index 000000000000..e0c168c8a325 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeHistoryPropertiesTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.UpgradeHistoryProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class UpgradeHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpgradeHistoryProperties model = BinaryData.fromString( + "{\"startTimestamp\":\"2021-02-12T00:37:49Z\",\"endTimestamp\":\"2021-05-14T16:24:46Z\",\"initiatedBy\":\"dcsi\",\"fromVersion\":\"ynnaam\",\"toVersion\":\"ectehf\",\"provisioningState\":\"Succeeded\"}") + .toObject(UpgradeHistoryProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-12T00:37:49Z"), model.startTimestamp()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T16:24:46Z"), model.endTimestamp()); + Assertions.assertEquals("dcsi", model.initiatedBy()); + Assertions.assertEquals("ynnaam", model.fromVersion()); + Assertions.assertEquals("ectehf", model.toVersion()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeProfileTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeProfileTests.java new file mode 100644 index 000000000000..a480686e4cc4 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UpgradeProfileTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.FullyManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.SelfManagedUpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeMode; +import com.azure.resourcemanager.applink.models.UpgradeProfile; +import com.azure.resourcemanager.applink.models.UpgradeReleaseChannel; +import org.junit.jupiter.api.Assertions; + +public final class UpgradeProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpgradeProfile model = BinaryData.fromString( + "{\"mode\":\"FullyManaged\",\"fullyManagedUpgradeProfile\":{\"releaseChannel\":\"Rapid\"},\"selfManagedUpgradeProfile\":{\"version\":\"cyshurzafbljjgp\"}}") + .toObject(UpgradeProfile.class); + Assertions.assertEquals(UpgradeMode.FULLY_MANAGED, model.mode()); + Assertions.assertEquals(UpgradeReleaseChannel.RAPID, model.fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("cyshurzafbljjgp", model.selfManagedUpgradeProfile().version()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpgradeProfile model = new UpgradeProfile().withMode(UpgradeMode.FULLY_MANAGED) + .withFullyManagedUpgradeProfile( + new FullyManagedUpgradeProfile().withReleaseChannel(UpgradeReleaseChannel.RAPID)) + .withSelfManagedUpgradeProfile(new SelfManagedUpgradeProfile().withVersion("cyshurzafbljjgp")); + model = BinaryData.fromObject(model).toObject(UpgradeProfile.class); + Assertions.assertEquals(UpgradeMode.FULLY_MANAGED, model.mode()); + Assertions.assertEquals(UpgradeReleaseChannel.RAPID, model.fullyManagedUpgradeProfile().releaseChannel()); + Assertions.assertEquals("cyshurzafbljjgp", model.selfManagedUpgradeProfile().version()); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UserAssignedIdentityTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UserAssignedIdentityTests.java new file mode 100644 index 000000000000..c00b491a89e0 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/UserAssignedIdentityTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model + = BinaryData.fromString("{\"principalId\":\"rwzoxxjtfelluwf\",\"clientId\":\"tonpe\"}") + .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/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/VersionInfoTests.java b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/VersionInfoTests.java new file mode 100644 index 000000000000..b7505e35fe25 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/src/test/java/com/azure/resourcemanager/applink/generated/VersionInfoTests.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.applink.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.applink.models.VersionInfo; +import org.junit.jupiter.api.Assertions; + +public final class VersionInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VersionInfo model = BinaryData.fromString("{\"version\":\"godebfqkkrbmpu\",\"upgrades\":[\"riwflzlfb\"]}") + .toObject(VersionInfo.class); + Assertions.assertEquals("godebfqkkrbmpu", model.version()); + Assertions.assertEquals("riwflzlfb", model.upgrades().get(0)); + } +} diff --git a/sdk/applink/azure-resourcemanager-applink/tsp-location.yaml b/sdk/applink/azure-resourcemanager-applink/tsp-location.yaml new file mode 100644 index 000000000000..33e3f77e6a41 --- /dev/null +++ b/sdk/applink/azure-resourcemanager-applink/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/applink/AppLink.Management +commit: b37b0676411ff84913d5358998668b867ac75a0f +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/applink/ci.yml b/sdk/applink/ci.yml new file mode 100644 index 000000000000..e585e94dc92e --- /dev/null +++ b/sdk/applink/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/applink/ci.yml + - sdk/applink/azure-resourcemanager-applink/ + exclude: + - sdk/applink/pom.xml + - sdk/applink/azure-resourcemanager-applink/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applink/ci.yml + - sdk/applink/azure-resourcemanager-applink/ + exclude: + - sdk/applink/pom.xml + - sdk/applink/azure-resourcemanager-applink/pom.xml + +parameters: + - name: release_azureresourcemanagerapplink + displayName: azure-resourcemanager-applink + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: applink + Artifacts: + - name: azure-resourcemanager-applink + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerapplink + releaseInBatch: ${{ parameters.release_azureresourcemanagerapplink }} diff --git a/sdk/applink/pom.xml b/sdk/applink/pom.xml new file mode 100644 index 000000000000..2f0632631a18 --- /dev/null +++ b/sdk/applink/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-applink-service + pom + 1.0.0 + + + azure-resourcemanager-applink + +