From a6f766924492e8073663155768bbd338acfd5346 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Sat, 25 Jul 2026 17:48:13 +0000 Subject: [PATCH 1/2] Configurations: 'specification/relay/resource-manager/Microsoft.Relay/Relay/tspconfig.yaml', SDK Release Type: stable, and CommitSHA: 'e03e8c1a6ebebcd8e8c303ce938b810546bd8a06' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6617068 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 | 2 +- .../azure-resourcemanager-relay/CHANGELOG.md | 219 +- .../azure-resourcemanager-relay/README.md | 10 +- .../azure-resourcemanager-relay/SAMPLE.md | 404 ++- sdk/relay/azure-resourcemanager-relay/pom.xml | 10 +- .../resourcemanager/relay/RelayManager.java | 88 +- .../relay/fluent/HybridConnectionsClient.java | 244 +- .../relay/fluent/NamespacesClient.java | 380 +-- .../relay/fluent/OperationsClient.java | 12 +- .../PrivateEndpointConnectionsClient.java | 170 ++ .../fluent/PrivateLinkResourcesClient.java | 75 + ...layApi.java => RelayManagementClient.java} | 53 +- .../relay/fluent/WcfRelaysClient.java | 240 +- .../relay/fluent/models/AccessKeysInner.java | 72 +- .../fluent/models/AuthorizationRuleInner.java | 61 +- .../models/AuthorizationRuleProperties.java | 20 +- .../CheckNameAvailabilityResultInner.java | 39 +- .../fluent/models/HybridConnectionInner.java | 46 +- .../models/HybridConnectionProperties.java | 10 +- .../fluent/models/NetworkRuleSetInner.java | 243 ++ .../models/NetworkRuleSetProperties.java | 181 ++ .../relay/fluent/models/OperationInner.java | 79 +- .../PrivateEndpointConnectionInner.java | 234 ++ .../PrivateEndpointConnectionProperties.java | 150 ++ .../models/PrivateLinkResourceInner.java | 172 ++ .../models/PrivateLinkResourceProperties.java | 114 + .../PrivateLinkResourcesListResultInner.java | 97 + .../fluent/models/RelayNamespaceInner.java | 132 +- .../models/RelayNamespaceProperties.java | 137 +- .../relay/fluent/models/WcfRelayInner.java | 46 +- .../fluent/models/WcfRelayProperties.java | 10 +- .../relay/fluent/models/package-info.java | 4 +- .../relay/fluent/package-info.java | 4 +- .../relay/implementation/AccessKeysImpl.java | 2 +- .../implementation/AuthorizationRuleImpl.java | 20 +- .../CheckNameAvailabilityResultImpl.java | 2 +- .../implementation/HybridConnectionImpl.java | 20 +- .../HybridConnectionsClientImpl.java | 1734 +++++-------- .../implementation/HybridConnectionsImpl.java | 156 +- .../implementation/NamespacesClientImpl.java | 2287 +++++++---------- .../relay/implementation/NamespacesImpl.java | 276 +- .../implementation/NetworkRuleSetImpl.java | 70 + .../relay/implementation/OperationImpl.java | 16 +- .../implementation/OperationsClientImpl.java | 157 +- .../relay/implementation/OperationsImpl.java | 2 +- .../PrivateEndpointConnectionImpl.java | 173 ++ .../PrivateEndpointConnectionsClientImpl.java | 673 +++++ .../PrivateEndpointConnectionsImpl.java | 163 ++ .../PrivateLinkResourceImpl.java | 69 + .../PrivateLinkResourcesClientImpl.java | 248 ++ .../PrivateLinkResourcesImpl.java | 73 + .../PrivateLinkResourcesListResultImpl.java | 48 + ...java => RelayManagementClientBuilder.java} | 64 +- ...pl.java => RelayManagementClientImpl.java} | 149 +- .../implementation/RelayNamespaceImpl.java | 72 +- .../implementation/ResourceManagerUtils.java | 2 +- .../relay/implementation/WcfRelayImpl.java | 20 +- .../implementation/WcfRelaysClientImpl.java | 1686 +++++------- .../relay/implementation/WcfRelaysImpl.java | 152 +- .../models/AuthorizationRuleListResult.java | 56 +- .../models/HybridConnectionListResult.java | 56 +- .../models/OperationListResult.java | 32 +- .../PrivateEndpointConnectionListResult.java | 98 + .../models/RelayNamespaceListResult.java | 56 +- .../models/WcfRelaysListResult.java | 54 +- .../relay/implementation/package-info.java | 4 +- .../relay/models/AccessKeys.java | 2 +- .../relay/models/AccessRights.java | 57 +- .../relay/models/ActionType.java | 46 + .../relay/models/AuthorizationRule.java | 68 +- .../relay/models/CheckNameAvailability.java | 17 +- .../models/CheckNameAvailabilityResult.java | 2 +- .../relay/models/ConnectionState.java | 113 + .../relay/models/DefaultAction.java | 51 + .../models/EndPointProvisioningState.java | 71 + .../relay/models/HybridConnection.java | 34 +- .../relay/models/HybridConnections.java | 190 +- .../resourcemanager/relay/models/KeyType.java | 53 +- .../relay/models/NWRuleSetIpRules.java | 113 + .../relay/models/Namespaces.java | 286 ++- .../relay/models/NetworkRuleIPAction.java | 46 + .../relay/models/NetworkRuleSet.java | 79 + .../relay/models/Operation.java | 31 +- .../relay/models/OperationDisplay.java | 39 +- .../relay/models/Operations.java | 12 +- .../resourcemanager/relay/models/Origin.java | 57 + .../relay/models/PrivateEndpoint.java | 85 + .../models/PrivateEndpointConnection.java | 279 ++ .../models/PrivateEndpointConnections.java | 146 ++ .../models/PrivateLinkConnectionStatus.java | 61 + .../relay/models/PrivateLinkResource.java | 70 + .../relay/models/PrivateLinkResources.java | 67 + .../PrivateLinkResourcesListResult.java | 34 + .../relay/models/ProvisioningStateEnum.java | 76 - .../relay/models/PublicNetworkAccess.java | 56 + .../models/RegenerateAccessKeyParameters.java | 20 +- .../relay/models/RelayNamespace.java | 151 +- .../relay/models/RelayUpdateParameters.java | 114 +- .../relay/models/Relaytype.java | 2 +- .../relay/models/ResourceNamespacePatch.java | 38 +- .../resourcemanager/relay/models/Sku.java | 31 +- .../resourcemanager/relay/models/SkuName.java | 46 + .../resourcemanager/relay/models/SkuTier.java | 49 +- .../relay/models/TlsVersion.java | 51 + .../relay/models/UnavailableReason.java | 70 +- .../relay/models/WcfRelay.java | 34 +- .../relay/models/WcfRelays.java | 184 +- .../relay/models/package-info.java | 4 +- .../resourcemanager/relay/package-info.java | 4 +- .../src/main/java/module-info.java | 3 +- .../azure-resourcemanager-relay_metadata.json | 1 + .../proxy-config.json | 2 +- .../azure-resourcemanager-relay.properties | 1 + ...reateOrUpdateAuthorizationRuleSamples.java | 6 +- ...ybridConnectionsCreateOrUpdateSamples.java | 6 +- ...ectionsDeleteAuthorizationRuleSamples.java | 10 +- .../HybridConnectionsDeleteSamples.java | 6 +- ...onnectionsGetAuthorizationRuleSamples.java | 10 +- .../HybridConnectionsGetSamples.java | 6 +- ...nectionsListAuthorizationRulesSamples.java | 10 +- ...bridConnectionsListByNamespaceSamples.java | 6 +- .../HybridConnectionsListKeysSamples.java | 6 +- ...ybridConnectionsRegenerateKeysSamples.java | 10 +- ...amespacesCheckNameAvailabilitySamples.java | 7 +- ...reateOrUpdateAuthorizationRuleSamples.java | 5 +- ...esCreateOrUpdateNetworkRuleSetSamples.java | 38 + .../NamespacesCreateOrUpdateSamples.java | 15 +- ...espacesDeleteAuthorizationRuleSamples.java | 9 +- .../generated/NamespacesDeleteSamples.java | 8 +- ...NamespacesGetAuthorizationRuleSamples.java | 9 +- .../NamespacesGetByResourceGroupSamples.java | 7 +- .../NamespacesGetNetworkRuleSetSamples.java | 24 + ...mespacesListAuthorizationRulesSamples.java | 9 +- .../NamespacesListByResourceGroupSamples.java | 5 +- .../generated/NamespacesListKeysSamples.java | 5 +- .../generated/NamespacesListSamples.java | 5 +- .../NamespacesRegenerateKeysSamples.java | 9 +- .../generated/NamespacesUpdateSamples.java | 11 +- .../generated/OperationsListSamples.java | 5 +- ...pointConnectionsCreateOrUpdateSamples.java | 33 + ...ivateEndpointConnectionsDeleteSamples.java | 24 + .../PrivateEndpointConnectionsGetSamples.java | 24 + ...PrivateEndpointConnectionsListSamples.java | 23 + .../PrivateLinkResourcesGetSamples.java | 24 + .../PrivateLinkResourcesListSamples.java | 23 + ...reateOrUpdateAuthorizationRuleSamples.java | 5 +- .../WcfRelaysCreateOrUpdateSamples.java | 5 +- ...fRelaysDeleteAuthorizationRuleSamples.java | 10 +- .../generated/WcfRelaysDeleteSamples.java | 5 +- .../WcfRelaysGetAuthorizationRuleSamples.java | 10 +- .../relay/generated/WcfRelaysGetSamples.java | 5 +- ...cfRelaysListAuthorizationRulesSamples.java | 9 +- .../WcfRelaysListByNamespaceSamples.java | 5 +- .../generated/WcfRelaysListKeysSamples.java | 5 +- .../WcfRelaysRegenerateKeysSamples.java | 9 +- .../AuthorizationRuleInnerTests.java | 10 +- .../AuthorizationRuleListResultTests.java | 27 +- .../AuthorizationRulePropertiesTests.java | 10 +- ...CheckNameAvailabilityResultInnerTests.java | 21 +- .../generated/CheckNameAvailabilityTests.java | 11 +- .../relay/generated/ConnectionStateTests.java | 29 + ...uthorizationRuleWithResponseMockTests.java | 15 +- ...uthorizationRuleWithResponseMockTests.java | 8 +- ...onnectionsDeleteWithResponseMockTests.java | 9 +- ...uthorizationRuleWithResponseMockTests.java | 10 +- ...ctionsListAuthorizationRulesMockTests.java | 12 +- .../generated/NWRuleSetIpRulesTests.java | 29 + ...NameAvailabilityWithResponseMockTests.java | 15 +- ...uthorizationRuleWithResponseMockTests.java | 14 +- .../NamespacesCreateOrUpdateMockTests.java | 50 +- ...teNetworkRuleSetWithResponseMockTests.java | 56 + ...uthorizationRuleWithResponseMockTests.java | 9 +- .../generated/NamespacesDeleteMockTests.java | 8 +- ...uthorizationRuleWithResponseMockTests.java | 10 +- ...tByResourceGroupWithResponseMockTests.java | 23 +- ...etNetworkRuleSetWithResponseMockTests.java | 46 + ...spacesListAuthorizationRulesMockTests.java | 12 +- ...amespacesListByResourceGroupMockTests.java | 23 +- .../generated/NamespacesListMockTests.java | 22 +- .../generated/NetworkRuleSetInnerTests.java | 45 + .../NetworkRuleSetPropertiesTests.java | 44 + .../generated/OperationDisplayTests.java | 12 +- .../relay/generated/OperationInnerTests.java | 11 +- .../generated/OperationListResultTests.java | 14 +- .../generated/OperationsListMockTests.java | 8 +- .../PrivateEndpointConnectionInnerTests.java | 42 + ...vateEndpointConnectionListResultTests.java | 27 + ...vateEndpointConnectionPropertiesTests.java | 43 + ...nsCreateOrUpdateWithResponseMockTests.java | 52 + ...ateEndpointConnectionsDeleteMockTests.java | 33 + ...ntConnectionsGetWithResponseMockTests.java | 45 + ...ivateEndpointConnectionsListMockTests.java | 46 + .../relay/generated/PrivateEndpointTests.java | 24 + .../PrivateLinkResourceInnerTests.java | 21 + .../PrivateLinkResourcePropertiesTests.java | 21 + ...LinkResourcesGetWithResponseMockTests.java | 41 + ...vateLinkResourcesListResultInnerTests.java | 22 + ...inkResourcesListWithResponseMockTests.java | 42 + .../generated/RelayNamespaceInnerTests.java | 55 +- .../RelayNamespaceListResultTests.java | 53 +- .../RelayNamespacePropertiesTests.java | 41 +- .../generated/RelayUpdateParametersTests.java | 54 +- .../ResourceNamespacePatchTests.java | 12 +- .../relay/generated/SkuTests.java | 9 +- ...uthorizationRuleWithResponseMockTests.java | 12 +- ...uthorizationRuleWithResponseMockTests.java | 8 +- .../WcfRelaysDeleteWithResponseMockTests.java | 8 +- ...uthorizationRuleWithResponseMockTests.java | 10 +- ...RelaysListAuthorizationRulesMockTests.java | 12 +- .../tsp-location.yaml | 4 + 210 files changed, 11286 insertions(+), 6024 deletions(-) create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateLinkResourcesClient.java rename sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/{RelayApi.java => RelayManagementClient.java} (67%) create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetInner.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetProperties.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceInner.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceProperties.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourcesListResultInner.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NetworkRuleSetImpl.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesClientImpl.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesListResultImpl.java rename sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/{RelayApiBuilder.java => RelayManagementClientBuilder.java} (64%) rename sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/{RelayApiImpl.java => RelayManagementClientImpl.java} (75%) rename sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/{ => implementation}/models/AuthorizationRuleListResult.java (62%) rename sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/{ => implementation}/models/HybridConnectionListResult.java (62%) rename sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/{ => implementation}/models/OperationListResult.java (74%) create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/PrivateEndpointConnectionListResult.java rename sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/{ => implementation}/models/RelayNamespaceListResult.java (63%) rename sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/{ => implementation}/models/WcfRelaysListResult.java (63%) create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ActionType.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ConnectionState.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/DefaultAction.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/EndPointProvisioningState.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NWRuleSetIpRules.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleIPAction.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleSet.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Origin.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpoint.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnection.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnections.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkConnectionStatus.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResource.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResources.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResourcesListResult.java delete mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ProvisioningStateEnum.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PublicNetworkAccess.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/SkuName.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/TlsVersion.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/resources/META-INF/azure-resourcemanager-relay_metadata.json create mode 100644 sdk/relay/azure-resourcemanager-relay/src/main/resources/azure-resourcemanager-relay.properties create mode 100644 sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetNetworkRuleSetSamples.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsListSamples.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesGetSamples.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListSamples.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/ConnectionStateTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NWRuleSetIpRulesTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateNetworkRuleSetWithResponseMockTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetNetworkRuleSetWithResponseMockTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NetworkRuleSetInnerTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NetworkRuleSetPropertiesTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionInnerTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionListResultTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionPropertiesTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsDeleteMockTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsListMockTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourceInnerTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcePropertiesTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesGetWithResponseMockTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListResultInnerTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListWithResponseMockTests.java create mode 100644 sdk/relay/azure-resourcemanager-relay/tsp-location.yaml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 9774a0c2d7d5..85836f742e7f 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -308,7 +308,7 @@ com.azure.resourcemanager:azure-resourcemanager-mysql;1.0.2;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-postgresql;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hdinsight;1.0.0;1.1.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-sqlvirtualmachine;1.0.0-beta.5;1.0.0-beta.6 -com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0;1.1.0 com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.7.0;1.8.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-kusto;1.2.0;1.3.0-beta.1 diff --git a/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md b/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md index 3b5feab88f88..07beb2fabb57 100644 --- a/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md +++ b/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md @@ -1,14 +1,225 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0 (2026-07-25) -### Features Added +- Azure Resource Manager Relay client library for Java. This package contains Microsoft Azure SDK for Relay Management SDK. Use these API to manage Azure Relay resources through Azure Resource Manager. Package api-version 2026-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.RelayNamespaceListResult` was removed + +#### `models.HybridConnectionListResult` was removed + +#### `models.WcfRelaysListResult` was removed + +#### `models.ProvisioningStateEnum` was removed + +#### `models.AuthorizationRuleListResult` was removed + +#### `models.OperationListResult` was removed + +#### `models.AccessRights` was modified + +* `toString()` was removed +* `models.AccessRights[] values()` -> `java.util.Collection values()` +* `valueOf(java.lang.String)` was removed + +#### `models.Sku` was modified + +* `java.lang.String name()` -> `models.SkuName name()` +* `validate()` was removed + +#### `models.ResourceNamespacePatch` was modified + +* `validate()` was removed + +#### `models.RelayNamespace` was modified + +* `models.ProvisioningStateEnum provisioningState()` -> `java.lang.String provisioningState()` + +#### `models.UnavailableReason` was modified + +* `valueOf(java.lang.String)` was removed +* `toString()` was removed +* `models.UnavailableReason[] values()` -> `java.util.Collection values()` + +#### `models.CheckNameAvailability` was modified + +* `validate()` was removed + +#### `models.RegenerateAccessKeyParameters` was modified + +* `validate()` was removed + +#### `models.SkuTier` was modified + +* `valueOf(java.lang.String)` was removed +* `models.SkuTier[] values()` -> `java.util.Collection values()` +* `toString()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `validate()` was removed + +#### `models.RelayUpdateParameters` was modified + +* `validate()` was removed +* `models.ProvisioningStateEnum provisioningState()` -> `java.lang.String provisioningState()` + +#### `models.KeyType` was modified + +* `toString()` was removed +* `models.KeyType[] values()` -> `java.util.Collection values()` +* `valueOf(java.lang.String)` was removed + +#### `RelayManager` was modified + +* `fluent.RelayApi serviceClient()` -> `fluent.RelayManagementClient serviceClient()` + +### Features Added + +* `models.NetworkRuleSet` was added + +* `models.NWRuleSetIpRules` was added + +* `models.PrivateLinkConnectionStatus` was added + +* `models.DefaultAction` was added + +* `models.PublicNetworkAccess` was added + +* `models.PrivateLinkResource` was added + +* `models.PrivateEndpointConnection$Definition` was added + +* `models.PrivateEndpointConnection$UpdateStages` was added + +* `models.NetworkRuleIPAction` was added + +* `models.TlsVersion` was added + +* `models.ActionType` was added + +* `models.PrivateEndpointConnection$Update` was added + +* `models.EndPointProvisioningState` was added + +* `models.PrivateLinkResources` was added + +* `models.ConnectionState` was added + +* `models.PrivateEndpointConnection$DefinitionStages` was added + +* `models.PrivateEndpoint` was added + +* `models.PrivateLinkResourcesListResult` was added + +* `models.SkuName` was added + +* `models.Origin` was added + +* `models.PrivateEndpointConnection` was added + +* `models.PrivateEndpointConnections` was added + +#### `models.AccessRights` was modified + +* `AccessRights()` was added + +#### `models.Namespaces` was modified + +* `createOrUpdateNetworkRuleSet(java.lang.String,java.lang.String,fluent.models.NetworkRuleSetInner)` was added +* `getNetworkRuleSet(java.lang.String,java.lang.String)` was added +* `getNetworkRuleSetWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `createOrUpdateNetworkRuleSetWithResponse(java.lang.String,java.lang.String,fluent.models.NetworkRuleSetInner,com.azure.core.util.Context)` was added + +#### `models.Sku` was modified + +* `withName(models.SkuName)` was added + +#### `models.ResourceNamespacePatch` was modified + +* `systemData()` was added + +#### `models.RelayNamespace` was modified + +* `publicNetworkAccess()` was added +* `minimumTlsVersion()` was added +* `status()` was added +* `systemData()` was added +* `privateEndpointConnections()` was added + +#### `models.UnavailableReason` was modified + +* `UnavailableReason()` was added + +#### `models.HybridConnection` was modified + +* `region()` was added +* `systemData()` was added +* `regionName()` was added +* `location()` was added + +#### `models.SkuTier` was modified + +* `SkuTier()` was added + +#### `models.OperationDisplay` was modified + +* `description()` was added + +#### `models.Operation` was modified + +* `actionType()` was added +* `isDataAction()` was added +* `origin()` was added + +#### `models.WcfRelay` was modified + +* `systemData()` was added +* `location()` was added +* `regionName()` was added +* `region()` was added + +#### `models.RelayUpdateParameters` was modified + +* `minimumTlsVersion()` was added +* `withPrivateEndpointConnections(java.util.List)` was added +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was added +* `systemData()` was added +* `withMinimumTlsVersion(models.TlsVersion)` was added +* `privateEndpointConnections()` was added +* `publicNetworkAccess()` was added +* `status()` was added + +#### `models.KeyType` was modified + +* `KeyType()` was added + +#### `RelayManager` was modified + +* `privateEndpointConnections()` was added +* `privateLinkResources()` was added + +#### `models.RelayNamespace$Update` was modified + +* `withPrivateEndpointConnections(java.util.List)` was added +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was added +* `withMinimumTlsVersion(models.TlsVersion)` was added + +#### `models.RelayNamespace$Definition` was modified + +* `withPrivateEndpointConnections(java.util.List)` was added +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was added +* `withMinimumTlsVersion(models.TlsVersion)` was added + +#### `models.AuthorizationRule` was modified -### Other Changes +* `location()` was added +* `region()` was added +* `systemData()` was added +* `regionName()` was added ## 1.0.0 (2024-12-20) diff --git a/sdk/relay/azure-resourcemanager-relay/README.md b/sdk/relay/azure-resourcemanager-relay/README.md index bd3169daa6f9..8a8fe2b1b784 100644 --- a/sdk/relay/azure-resourcemanager-relay/README.md +++ b/sdk/relay/azure-resourcemanager-relay/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Relay client library for Java. -This package contains Microsoft Azure SDK for Relay Management SDK. Use these API to manage Azure Relay resources through Azure Resource Manager. Package tag package-2017-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Relay Management SDK. Use these API to manage Azure Relay resources through Azure Resource Manager. Package api-version 2026-01-01. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-relay - 1.1.0-beta.1 + 1.1.0 ``` [//]: # ({x-version-update-end}) @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ RelayManager manager = RelayManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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/relay/azure-resourcemanager-relay/SAMPLE.md b/sdk/relay/azure-resourcemanager-relay/SAMPLE.md index 4dff357308d5..8b1292c46c32 100644 --- a/sdk/relay/azure-resourcemanager-relay/SAMPLE.md +++ b/sdk/relay/azure-resourcemanager-relay/SAMPLE.md @@ -19,10 +19,12 @@ - [CheckNameAvailability](#namespaces_checknameavailability) - [CreateOrUpdate](#namespaces_createorupdate) - [CreateOrUpdateAuthorizationRule](#namespaces_createorupdateauthorizationrule) +- [CreateOrUpdateNetworkRuleSet](#namespaces_createorupdatenetworkruleset) - [Delete](#namespaces_delete) - [DeleteAuthorizationRule](#namespaces_deleteauthorizationrule) - [GetAuthorizationRule](#namespaces_getauthorizationrule) - [GetByResourceGroup](#namespaces_getbyresourcegroup) +- [GetNetworkRuleSet](#namespaces_getnetworkruleset) - [List](#namespaces_list) - [ListAuthorizationRules](#namespaces_listauthorizationrules) - [ListByResourceGroup](#namespaces_listbyresourcegroup) @@ -34,6 +36,18 @@ - [List](#operations_list) +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [List](#privatelinkresources_list) + ## WcfRelays - [CreateOrUpdate](#wcfrelays_createorupdate) @@ -54,9 +68,7 @@ */ public final class HybridConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionCreate.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionCreate.json */ /** * Sample code: RelayHybridConnectionCreate. @@ -85,9 +97,7 @@ import java.util.Arrays; */ public final class HybridConnectionsCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAuthorizationRuleCreate.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleCreate.json */ /** * Sample code: RelayHybridConnectionAuthorizationRuleCreate. @@ -113,9 +123,7 @@ public final class HybridConnectionsCreateOrUpdateAuthorizationRuleSamples { */ public final class HybridConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridconnectionDelete.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridconnectionDelete.json */ /** * Sample code: RelayHybridconnectionDelete. @@ -138,17 +146,15 @@ public final class HybridConnectionsDeleteSamples { */ public final class HybridConnectionsDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAutorizationRuleDelete.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleDelete.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleDelete. + * Sample code: RelayHybridConnectionAuthorizationRuleDelete. * * @param manager Entry point to RelayManager. */ public static void - relayHybridConnectionAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + relayHybridConnectionAuthorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { manager.hybridConnections() .deleteAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); @@ -164,9 +170,7 @@ public final class HybridConnectionsDeleteAuthorizationRuleSamples { */ public final class HybridConnectionsGetSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionGet.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionGet.json */ /** * Sample code: RelayHybridConnectionGet. @@ -189,16 +193,14 @@ public final class HybridConnectionsGetSamples { */ public final class HybridConnectionsGetAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAutorizationRuleGet.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleGet.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleGet. + * Sample code: RelayHybridConnectionAuthorizationRuleGet. * * @param manager Entry point to RelayManager. */ - public static void relayHybridConnectionAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayHybridConnectionAuthorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { manager.hybridConnections() .getAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); @@ -214,17 +216,15 @@ public final class HybridConnectionsGetAuthorizationRuleSamples { */ public final class HybridConnectionsListAuthorizationRulesSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAutorizationRuleListAll.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleListAll.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleListAll. + * Sample code: RelayHybridConnectionAuthorizationRuleListAll. * * @param manager Entry point to RelayManager. */ public static void - relayHybridConnectionAutorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { + relayHybridConnectionAuthorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { manager.hybridConnections() .listAuthorizationRules("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", com.azure.core.util.Context.NONE); @@ -240,9 +240,7 @@ public final class HybridConnectionsListAuthorizationRulesSamples { */ public final class HybridConnectionsListByNamespaceSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionListAll.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionListAll.json */ /** * Sample code: RelayHybridConnectionListAll. @@ -264,9 +262,7 @@ public final class HybridConnectionsListByNamespaceSamples { */ public final class HybridConnectionsListKeysSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAuthorizationRuleListKey.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleListKey.json */ /** * Sample code: RelayHybridConnectionAuthorizationRuleListKey. @@ -293,17 +289,15 @@ import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; */ public final class HybridConnectionsRegenerateKeysSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAuthorizationRuleRegenrateKey.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayHybridConnectionAuthorizationRuleRegenrateKey. + * Sample code: RelayHybridConnectionAuthorizationRuleRegenerateKey. * * @param manager Entry point to RelayManager. */ public static void - relayHybridConnectionAuthorizationRuleRegenrateKey(com.azure.resourcemanager.relay.RelayManager manager) { + relayHybridConnectionAuthorizationRuleRegenerateKey(com.azure.resourcemanager.relay.RelayManager manager) { manager.hybridConnections() .regenerateKeysWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", "example-RelayAuthRules-01", new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), @@ -322,8 +316,7 @@ import com.azure.resourcemanager.relay.models.CheckNameAvailability; */ public final class NamespacesCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceCheckNameAvailability.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceCheckNameAvailability.json */ /** * Sample code: RelayCheckNameAvailability. @@ -332,7 +325,7 @@ public final class NamespacesCheckNameAvailabilitySamples { */ public static void relayCheckNameAvailability(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() - .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("sdk-Namespace1321"), + .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("example-RelayNamespace1321"), com.azure.core.util.Context.NONE); } } @@ -342,7 +335,9 @@ public final class NamespacesCheckNameAvailabilitySamples { ```java import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.util.HashMap; import java.util.Map; @@ -351,9 +346,7 @@ import java.util.Map; */ public final class NamespacesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceCreate. - * json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceCreate.json */ /** * Sample code: RelayNamespaceCreate. @@ -362,11 +355,12 @@ public final class NamespacesCreateOrUpdateSamples { */ public static void relayNamespaceCreate(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() - .define("example-RelayNamespace-01") - .withRegion("West US") + .define("example-RelayNamespace-5849") + .withRegion("South Central US") .withExistingResourceGroup("resourcegroup") .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withSku(new Sku().withTier(SkuTier.STANDARD)) + .withSku(new Sku().withName(SkuName.STANDARD).withTier(SkuTier.STANDARD)) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) .create(); } @@ -395,8 +389,7 @@ import java.util.Arrays; */ public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAuthorizationRuleCreate.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleCreate.json */ /** * Sample code: RelayNameSpaceAuthorizationRuleCreate. @@ -413,6 +406,43 @@ public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { } ``` +### Namespaces_CreateOrUpdateNetworkRuleSet + +```java +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.NetworkRuleIPAction; +import java.util.Arrays; + +/** + * Samples for Namespaces CreateOrUpdateNetworkRuleSet. + */ +public final class NamespacesCreateOrUpdateNetworkRuleSetSamples { + /* + * x-ms-original-file: 2026-01-01/VirtualNetworkRules/RelayNetworkRuleSetCreate.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpaceNetworkRuleSetCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager.namespaces() + .createOrUpdateNetworkRuleSetWithResponse("ResourceGroup", "example-RelayNamespace-6019", + new NetworkRuleSetInner().withTrustedServiceAccessEnabled(false) + .withDefaultAction(DefaultAction.DENY) + .withIpRules(Arrays.asList( + new NWRuleSetIpRules().withIpMask("1.1.1.1").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.2").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.3").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.4").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.5").withAction(NetworkRuleIPAction.ALLOW))), + com.azure.core.util.Context.NONE); + } +} +``` + ### Namespaces_Delete ```java @@ -421,9 +451,7 @@ public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { */ public final class NamespacesDeleteSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceDelete. - * json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceDelete.json */ /** * Sample code: RelayNameSpaceDelete. @@ -431,7 +459,7 @@ public final class NamespacesDeleteSamples { * @param manager Entry point to RelayManager. */ public static void relayNameSpaceDelete(com.azure.resourcemanager.relay.RelayManager manager) { - manager.namespaces().delete("resourcegroup", "example-RelayNamespace-01", com.azure.core.util.Context.NONE); + manager.namespaces().delete("SouthCentralUS", "example-RelayNamespace-5849", com.azure.core.util.Context.NONE); } } ``` @@ -444,15 +472,14 @@ public final class NamespacesDeleteSamples { */ public final class NamespacesDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAutorizationRuleDelete.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleDelete.json */ /** - * Sample code: RelayNameSpaceAutorizationRuleDelete. + * Sample code: RelayNameSpaceAuthorizationRuleDelete. * * @param manager Entry point to RelayManager. */ - public static void relayNameSpaceAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayNameSpaceAuthorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() .deleteAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); @@ -468,15 +495,14 @@ public final class NamespacesDeleteAuthorizationRuleSamples { */ public final class NamespacesGetAuthorizationRuleSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAutorizationRuleGet.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleGet.json */ /** - * Sample code: RelayNameSpaceAutorizationRuleGet. + * Sample code: RelayNameSpaceAuthorizationRuleGet. * * @param manager Entry point to RelayManager. */ - public static void relayNameSpaceAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayNameSpaceAuthorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() .getAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); @@ -492,8 +518,7 @@ public final class NamespacesGetAuthorizationRuleSamples { */ public final class NamespacesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceGet.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceGet.json */ /** * Sample code: RelayNameSpaceGet. @@ -502,7 +527,30 @@ public final class NamespacesGetByResourceGroupSamples { */ public static void relayNameSpaceGet(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() - .getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", + .getByResourceGroupWithResponse("RG-eg", "example-RelayRelayNamespace-01", + com.azure.core.util.Context.NONE); + } +} +``` + +### Namespaces_GetNetworkRuleSet + +```java +/** + * Samples for Namespaces GetNetworkRuleSet. + */ +public final class NamespacesGetNetworkRuleSetSamples { + /* + * x-ms-original-file: 2026-01-01/VirtualNetworkRules/RelayNetworkRuleSetGet.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpaceNetworkRuleSetGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager.namespaces() + .getNetworkRuleSetWithResponse("ResourceGroup", "example-RelayNamespace-6019", com.azure.core.util.Context.NONE); } } @@ -516,8 +564,7 @@ public final class NamespacesGetByResourceGroupSamples { */ public final class NamespacesListSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceListBySubscription.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceListBySubscription.json */ /** * Sample code: RelayNameSpaceListBySubscription. @@ -538,15 +585,14 @@ public final class NamespacesListSamples { */ public final class NamespacesListAuthorizationRulesSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAutorizationRuleListAll.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleListAll.json */ /** - * Sample code: RelayNameSpaceAutorizationRuleListAll. + * Sample code: RelayNameSpaceAuthorizationRuleListAll. * * @param manager Entry point to RelayManager. */ - public static void relayNameSpaceAutorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayNameSpaceAuthorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() .listAuthorizationRules("resourcegroup", "example-RelayNamespace-01", com.azure.core.util.Context.NONE); } @@ -561,8 +607,7 @@ public final class NamespacesListAuthorizationRulesSamples { */ public final class NamespacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceListByResourceGroup.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceListByResourceGroup.json */ /** * Sample code: RelayNameSpaceListByResourceGroup. @@ -583,8 +628,7 @@ public final class NamespacesListByResourceGroupSamples { */ public final class NamespacesListKeysSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAuthorizationRuleListKey.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleListKey.json */ /** * Sample code: RelayNameSpaceAuthorizationRuleListKey. @@ -610,16 +654,15 @@ import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; */ public final class NamespacesRegenerateKeysSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAuthorizationRuleRegenrateKey.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayNameSpaceAuthorizationRuleRegenrateKey. + * Sample code: RelayNameSpaceAuthorizationRuleRegenerateKey. * * @param manager Entry point to RelayManager. */ public static void - relayNameSpaceAuthorizationRuleRegenrateKey(com.azure.resourcemanager.relay.RelayManager manager) { + relayNameSpaceAuthorizationRuleRegenerateKey(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() .regenerateKeysWithResponse("resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), com.azure.core.util.Context.NONE); @@ -631,6 +674,7 @@ public final class NamespacesRegenerateKeysSamples { ```java import com.azure.resourcemanager.relay.models.RelayNamespace; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.util.HashMap; import java.util.Map; @@ -639,9 +683,7 @@ import java.util.Map; */ public final class NamespacesUpdateSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceUpdate. - * json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceUpdate.json */ /** * Sample code: RelayNameSpaceUpdate. @@ -650,11 +692,11 @@ public final class NamespacesUpdateSamples { */ public static void relayNameSpaceUpdate(com.azure.resourcemanager.relay.RelayManager manager) { RelayNamespace resource = manager.namespaces() - .getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", - com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("RG-eg", "example-RelayRelayNamespace-01", com.azure.core.util.Context.NONE) .getValue(); resource.update() .withTags(mapOf("tag3", "value3", "tag4", "value4", "tag5", "value5", "tag6", "value6")) + .withMinimumTlsVersion(TlsVersion.ONE_THREE) .apply(); } @@ -680,8 +722,7 @@ public final class NamespacesUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/RelayOperations_List.json + * x-ms-original-file: 2026-01-01/RelayOperations_List.json */ /** * Sample code: RelayOperationsList. @@ -694,6 +735,151 @@ public final class OperationsListSamples { } ``` +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnectionsCreate.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateEndPointConnectionCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateEndpointConnections() + .define("{privateEndpointConnection name}") + .withExistingNamespace("resourcegroup", "example-RelayNamespace-5849") + .withPrivateEndpoint(new PrivateEndpoint().withId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourcegroup/providers/Microsoft.Network/privateEndpoints/ali-relay-pve-1")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.APPROVED).withDescription("You may pass")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnectionsDelete.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateEndPointConnectionDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateEndpointConnections() + .delete("myResourceGroup", "example-RelayNamespace-5849", "{privateEndpointConnection name}", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnectionsGet.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateEndPointConnectionGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateEndpointConnections() + .getWithResponse("myResourceGroup", "example-RelayNamespace-5849", "{privateEndpointConnection name}", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnectionsList.json + */ + /** + * Sample code: PrivateEndpointConnectionsList. + * + * @param manager Entry point to RelayManager. + */ + public static void privateEndpointConnectionsList(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateEndpointConnections() + .list("myResourceGroup", "example-RelayNamespace-5849", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateLinkResourcesGet.json + */ + /** + * Sample code: NameSpacePrivateLinkResourceGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateLinkResourceGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateLinkResources() + .getWithResponse("resourcegroup", "example-RelayNamespace-5849", "{PrivateLinkResource name}", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_List + +```java +/** + * Samples for PrivateLinkResources List. + */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateLinkResourcesList.json + */ + /** + * Sample code: NameSpacePrivateLinkResourcesGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateLinkResourcesGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateLinkResources() + .listWithResponse("resourcegroup", "example-RelayNamespace-5849", com.azure.core.util.Context.NONE); + } +} +``` + ### WcfRelays_CreateOrUpdate ```java @@ -704,8 +890,7 @@ import com.azure.resourcemanager.relay.models.Relaytype; */ public final class WcfRelaysCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayCreate.json + * x-ms-original-file: 2026-01-01/Relay/RelayCreate.json */ /** * Sample code: RelayCreate. @@ -736,8 +921,7 @@ import java.util.Arrays; */ public final class WcfRelaysCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/ - * RelayAuthorizationRuleCreate.json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleCreate.json */ /** * Sample code: RelayAuthorizationRuleCreate. @@ -762,8 +946,7 @@ public final class WcfRelaysCreateOrUpdateAuthorizationRuleSamples { */ public final class WcfRelaysDeleteSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayDelete.json + * x-ms-original-file: 2026-01-01/Relay/RelayDelete.json */ /** * Sample code: RelayDelete. @@ -786,16 +969,14 @@ public final class WcfRelaysDeleteSamples { */ public final class WcfRelaysDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayAutorizationRuleDelete - * .json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleDelete.json */ /** - * Sample code: RelayAutorizationRuleDelete. + * Sample code: RelayAuthorizationRuleDelete. * * @param manager Entry point to RelayManager. */ - public static void relayAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayAuthorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { manager.wcfRelays() .deleteAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-wcf-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); @@ -811,8 +992,7 @@ public final class WcfRelaysDeleteAuthorizationRuleSamples { */ public final class WcfRelaysGetSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayGet.json + * x-ms-original-file: 2026-01-01/Relay/RelayGet.json */ /** * Sample code: RelayGet. @@ -835,16 +1015,14 @@ public final class WcfRelaysGetSamples { */ public final class WcfRelaysGetAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayAutorizationRuleGet. - * json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleGet.json */ /** - * Sample code: RelayAutorizationRuleGet. + * Sample code: RelayAuthorizationRuleGet. * * @param manager Entry point to RelayManager. */ - public static void relayAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayAuthorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { manager.wcfRelays() .getAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-wcf-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); @@ -860,15 +1038,14 @@ public final class WcfRelaysGetAuthorizationRuleSamples { */ public final class WcfRelaysListAuthorizationRulesSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/ - * RelayAutorizationRuleListAll.json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleListAll.json */ /** - * Sample code: RelayAutorizationRuleListAll. + * Sample code: RelayAuthorizationRuleListAll. * * @param manager Entry point to RelayManager. */ - public static void relayAutorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayAuthorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { manager.wcfRelays() .listAuthorizationRules("resourcegroup", "example-RelayNamespace-01", "example-Relay-Wcf-01", com.azure.core.util.Context.NONE); @@ -884,8 +1061,7 @@ public final class WcfRelaysListAuthorizationRulesSamples { */ public final class WcfRelaysListByNamespaceSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayListAll.json + * x-ms-original-file: 2026-01-01/Relay/RelayListAll.json */ /** * Sample code: RelayListAll. @@ -907,8 +1083,7 @@ public final class WcfRelaysListByNamespaceSamples { */ public final class WcfRelaysListKeysSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/ - * RelayAuthorizationRuleListKey.json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleListKey.json */ /** * Sample code: RelayAuthorizationRuleListKey.json. @@ -934,15 +1109,14 @@ import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; */ public final class WcfRelaysRegenerateKeysSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/ - * RelayAuthorizationRuleRegenrateKey.json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayAuthorizationRuleRegenrateKey.json. + * Sample code: RelayAuthorizationRuleRegenerateKey.json. * * @param manager Entry point to RelayManager. */ - public static void relayAuthorizationRuleRegenrateKeyJson(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayAuthorizationRuleRegenerateKeyJson(com.azure.resourcemanager.relay.RelayManager manager) { manager.wcfRelays() .regenerateKeysWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-wcf-01", "example-RelayAuthRules-01", new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), diff --git a/sdk/relay/azure-resourcemanager-relay/pom.xml b/sdk/relay/azure-resourcemanager-relay/pom.xml index 0e3f83f9600d..389b0db0c797 100644 --- a/sdk/relay/azure-resourcemanager-relay/pom.xml +++ b/sdk/relay/azure-resourcemanager-relay/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-relay - 1.1.0-beta.1 + 1.1.0 jar Microsoft Azure SDK for Relay Management - This package contains Microsoft Azure SDK for Relay Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use these API to manage Azure Relay resources through Azure Resource Manager. Package tag package-2017-04. + This package contains Microsoft Azure SDK for Relay Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use these API to manage Azure Relay resources through Azure Resource Manager. Package api-version 2026-01-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + false diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/RelayManager.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/RelayManager.java index dd6f2154f63b..4ff27efe225b 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/RelayManager.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/RelayManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay; @@ -22,21 +22,27 @@ 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.relay.fluent.RelayApi; +import com.azure.resourcemanager.relay.fluent.RelayManagementClient; import com.azure.resourcemanager.relay.implementation.HybridConnectionsImpl; import com.azure.resourcemanager.relay.implementation.NamespacesImpl; import com.azure.resourcemanager.relay.implementation.OperationsImpl; -import com.azure.resourcemanager.relay.implementation.RelayApiBuilder; +import com.azure.resourcemanager.relay.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.relay.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.relay.implementation.RelayManagementClientBuilder; import com.azure.resourcemanager.relay.implementation.WcfRelaysImpl; import com.azure.resourcemanager.relay.models.HybridConnections; import com.azure.resourcemanager.relay.models.Namespaces; import com.azure.resourcemanager.relay.models.Operations; +import com.azure.resourcemanager.relay.models.PrivateEndpointConnections; +import com.azure.resourcemanager.relay.models.PrivateLinkResources; import com.azure.resourcemanager.relay.models.WcfRelays; 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; @@ -47,18 +53,22 @@ public final class RelayManager { private Operations operations; - private Namespaces namespaces; - private HybridConnections hybridConnections; private WcfRelays wcfRelays; - private final RelayApi clientObject; + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private Namespaces namespaces; + + private final RelayManagementClient clientObject; private RelayManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new RelayApiBuilder().pipeline(httpPipeline) + this.clientObject = new RelayManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -105,6 +115,9 @@ public static Configurable configure() { */ 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-relay.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -212,12 +225,14 @@ public RelayManager authenticate(TokenCredential credential, AzureProfile profil 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.relay") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -275,18 +290,6 @@ public Operations operations() { return operations; } - /** - * Gets the resource collection API of Namespaces. It manages RelayNamespace, AuthorizationRule. - * - * @return Resource collection API of Namespaces. - */ - public Namespaces namespaces() { - if (this.namespaces == null) { - this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this); - } - return namespaces; - } - /** * Gets the resource collection API of HybridConnections. It manages HybridConnection. * @@ -312,12 +315,49 @@ public WcfRelays wcfRelays() { } /** - * Gets wrapped service client RelayApi providing direct access to the underlying auto-generated API implementation, - * based on Azure REST API. + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of Namespaces. It manages AuthorizationRule, RelayNamespace. + * + * @return Resource collection API of Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this); + } + return namespaces; + } + + /** + * Gets wrapped service client RelayManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. * - * @return Wrapped service client RelayApi. + * @return Wrapped service client RelayManagementClient. */ - public RelayApi serviceClient() { + public RelayManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/HybridConnectionsClient.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/HybridConnectionsClient.java index 3b75825a4a52..f2157aefae7a 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/HybridConnectionsClient.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/HybridConnectionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent; @@ -19,135 +19,116 @@ */ public interface HybridConnectionsClient { /** - * Lists the hybrid connection within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list hybrid connection operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); - - /** - * Lists the hybrid connection within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list hybrid connection operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNamespace(String resourceGroupName, String namespaceName, - Context context); - - /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Hybrid connection authorization rule for a hybrid connection by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param parameters Parameters supplied to create a hybrid connection. + * @param authorizationRuleName The authorization rule name. * @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 description of hybrid connection resource along with {@link Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, HybridConnectionInner parameters, Context context); + Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, Context context); /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Hybrid connection authorization rule for a hybrid connection by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param parameters Parameters supplied to create a hybrid connection. + * @param authorizationRuleName The authorization rule name. * @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 description of hybrid connection resource. + * @return single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner createOrUpdate(String resourceGroupName, String namespaceName, String hybridConnectionName, - HybridConnectionInner parameters); + AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName); /** - * Deletes a hybrid connection. + * Creates or updates an authorization rule for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String namespaceName, String hybridConnectionName, - Context context); + Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String hybridConnectionName, String authorizationRuleName, + AuthorizationRuleInner parameters, Context context); /** - * Deletes a hybrid connection. + * Creates or updates an authorization rule for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, String hybridConnectionName); + AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, AuthorizationRuleInner parameters); /** - * Returns the description for the specified hybrid connection. + * Deletes a hybrid connection authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. * @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 description of hybrid connection resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, Context context); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, Context context); /** - * Returns the description for the specified hybrid connection. + * Deletes a hybrid connection authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. * @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 description of hybrid connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - HybridConnectionInner get(String resourceGroupName, String namespaceName, String hybridConnectionName); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName); /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, @@ -156,186 +137,205 @@ PagedIterable listAuthorizationRules(String resourceGrou /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); /** - * Creates or updates an authorization rule for a hybrid connection. + * Primary and secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response}. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters, Context context); + Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, Context context); /** - * Creates or updates an authorization rule for a hybrid connection. + * Primary and secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule. + * @return namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, AuthorizationRuleInner parameters); + AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName); /** - * Deletes a hybrid connection authorization rule. + * Regenerates the primary or secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 Response}. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, + Context context); /** - * Deletes a hybrid connection authorization rule. + * Regenerates the primary or secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName); + AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters); /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Returns the description for the specified hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @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 description of a namespace authorization rule along with {@link Response}. + * @return description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context); + Response getWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, Context context); /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Returns the description for the specified hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @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 description of a namespace authorization rule. + * @return description of hybrid connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName); + HybridConnectionInner get(String resourceGroupName, String namespaceName, String hybridConnectionName); /** - * Primary and secondary connection strings to the hybrid connection. + * Creates or updates a service hybrid connection. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a hybrid connection. * @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 namespace/Relay Connection String along with {@link Response}. + * @return description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, HybridConnectionInner parameters, Context context); /** - * Primary and secondary connection strings to the hybrid connection. + * Creates or updates a service hybrid connection. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a hybrid connection. * @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 namespace/Relay Connection String. + * @return description of hybrid connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName); + HybridConnectionInner createOrUpdate(String resourceGroupName, String namespaceName, String hybridConnectionName, + HybridConnectionInner parameters); /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Deletes a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, + Response deleteWithResponse(String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Deletes a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters); + void delete(String resourceGroupName, String namespaceName, String hybridConnectionName); + + /** + * Lists the hybrid connection within the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 HybridConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Lists the hybrid connection within the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 HybridConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName, + Context context); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/NamespacesClient.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/NamespacesClient.java index c7fccb2f2cf7..e03a1d101990 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/NamespacesClient.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/NamespacesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent; @@ -14,6 +14,7 @@ import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; import com.azure.resourcemanager.relay.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner; import com.azure.resourcemanager.relay.models.CheckNameAvailability; import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; @@ -24,224 +25,283 @@ */ public interface NamespacesClient { /** - * Check the specified namespace name availability. + * Authorization rule for a namespace by name. * - * @param parameters Parameters to check availability of the specified namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @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 description of the check name availability request properties along with {@link Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse(CheckNameAvailability parameters, - Context context); + Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Check the specified namespace name availability. + * Authorization rule for a namespace by name. * - * @param parameters Parameters to check availability of the specified namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @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 description of the check name availability request properties. + * @return single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters); + AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName); /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Creates or updates an authorization rule for a namespace. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 response from the list namespace operation as paginated response with {@link PagedIterable}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String authorizationRuleName, AuthorizationRuleInner parameters, Context context); /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Creates or updates an authorization rule for a namespace. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 single item in a List or Get AuthorizationRule operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName, AuthorizationRuleInner parameters); + + /** + * Deletes a namespace authorization rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Lists all the available namespaces within the ResourceGroup. + * Deletes a namespace authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Lists all the available namespaces within the ResourceGroup. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); /** - * Create Azure Relay namespace. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of description of a namespace resource. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RelayNamespaceInner> beginCreateOrUpdate(String resourceGroupName, - String namespaceName, RelayNamespaceInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, + Context context); /** - * Create Azure Relay namespace. + * Primary and secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param authorizationRuleName The authorization rule name. * @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 description of a namespace resource. + * @return namespace/Relay Connection String along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RelayNamespaceInner> beginCreateOrUpdate(String resourceGroupName, - String namespaceName, RelayNamespaceInner parameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Create Azure Relay namespace. + * Primary and secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param authorizationRuleName The authorization rule name. * @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 description of a namespace resource. + * @return namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - RelayNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, RelayNamespaceInner parameters); + AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Create Azure Relay namespace. + * Regenerates the primary or secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 description of a namespace resource. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RelayNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, - Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context); /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Regenerates the primary or secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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. + * @return namespace/Relay Connection String. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName); + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, + RegenerateAccessKeyParameters parameters); /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Returns the description for the specified namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @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. + * @return description of a namespace resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, + Context context); /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Returns the description for the specified namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @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 description of a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName); + RelayNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName); /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of description of a namespace resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RelayNamespaceInner> beginCreateOrUpdate(String resourceGroupName, + String namespaceName, RelayNamespaceInner parameters); /** - * Returns the description for the specified namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource along with {@link Response}. + * @return the {@link SyncPoller} for polling of description of a namespace resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RelayNamespaceInner> beginCreateOrUpdate(String resourceGroupName, + String namespaceName, RelayNamespaceInner parameters, Context context); + + /** + * Create Azure Relay namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, - Context context); + RelayNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, RelayNamespaceInner parameters); /** - * Returns the description for the specified namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return description of a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - RelayNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName); + RelayNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, + Context context); /** * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is * idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param parameters Parameters for updating a namespace resource. * @param context The context to associate with this operation. @@ -258,7 +318,7 @@ Response updateWithResponse(String resourceGroupName, Strin * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is * idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param parameters Parameters for updating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -270,186 +330,186 @@ Response updateWithResponse(String resourceGroupName, Strin RelayNamespaceInner update(String resourceGroupName, String namespaceName, RelayUpdateParameters parameters); /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName); /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, Context context); /** - * Creates or updates an authorization rule for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String authorizationRuleName, AuthorizationRuleInner parameters, Context context); + void delete(String resourceGroupName, String namespaceName); /** - * Creates or updates an authorization rule for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, - String authorizationRuleName, AuthorizationRuleInner parameters); + void delete(String resourceGroupName, String namespaceName, Context context); /** - * Deletes a namespace authorization rule. + * Lists all the available namespaces within the ResourceGroup. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @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 RelayNamespace list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the available namespaces within the ResourceGroup. + * + * @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 {@link Response}. + * @return the response of a RelayNamespace list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deletes a namespace authorization rule. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @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 RelayNamespace list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * + * @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 RelayNamespace list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** - * Authorization rule for a namespace by name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. * @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 description of a namespace authorization rule along with {@link Response}. + * @return networkRuleSet for a Namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context); + Response getNetworkRuleSetWithResponse(String resourceGroupName, String namespaceName, + Context context); /** - * Authorization rule for a namespace by name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. * @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 description of a namespace authorization rule. + * @return networkRuleSet for a Namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, - String authorizationRuleName); + NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName); /** - * Primary and secondary connection strings to the namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @param parameters The Namespace IpFilterRule. * @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 namespace/Relay Connection String along with {@link Response}. + * @return description of topic resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context); + Response createOrUpdateNetworkRuleSetWithResponse(String resourceGroupName, + String namespaceName, NetworkRuleSetInner parameters, Context context); /** - * Primary and secondary connection strings to the namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @param parameters The Namespace IpFilterRule. * @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 namespace/Relay Connection String. + * @return description of topic resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); + NetworkRuleSetInner createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, + NetworkRuleSetInner parameters); /** - * Regenerates the primary or secondary connection strings to the namespace. + * Check the specified namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String along with {@link Response}. + * @return description of the check name availability request properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context); + Response checkNameAvailabilityWithResponse(CheckNameAvailability parameters, + Context context); /** - * Regenerates the primary or secondary connection strings to the namespace. + * Check the specified namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String. + * @return description of the check name availability request properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, - RegenerateAccessKeyParameters parameters); + CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/OperationsClient.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/OperationsClient.java index 24c5c6c5ccb9..f1e991a3f4fd 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/OperationsClient.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent; @@ -15,23 +15,25 @@ */ public interface OperationsClient { /** - * Lists all available Relay REST API 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 result of the request to list Relay operations as paginated response with {@link PagedIterable}. + * @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(); /** - * Lists all available Relay REST API operations. + * 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 result of the request to list Relay operations as paginated response with {@link PagedIterable}. + * @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/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateEndpointConnectionsClient.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..67d969c6ae83 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.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.relay.fluent.models.PrivateEndpointConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public interface PrivateEndpointConnectionsClient { + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 description for the specified Private Endpoint Connection name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 description for the specified Private Endpoint Connection name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName); + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context); + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 namespaceName, + String privateEndpointConnectionName); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 namespaceName, + String privateEndpointConnectionName, Context context); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 namespaceName, String privateEndpointConnectionName); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 namespaceName, String privateEndpointConnectionName, Context context); + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 available PrivateEndpointConnections within a namespace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 available PrivateEndpointConnections within a namespace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName, Context context); +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateLinkResourcesClient.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..65e7dd390eb0 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourcesListResultInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public interface PrivateLinkResourcesClient { + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String namespaceName, + String privateLinkResourceName, Context context); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String namespaceName, String privateLinkResourceName); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 result of the List private link resources operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String namespaceName, + Context context); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 result of the List private link resources operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourcesListResultInner list(String resourceGroupName, String namespaceName); +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/RelayApi.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/RelayManagementClient.java similarity index 67% rename from sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/RelayApi.java rename to sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/RelayManagementClient.java index 9de65c258930..ecddeee50649 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/RelayApi.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/RelayManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent; @@ -8,31 +8,30 @@ import java.time.Duration; /** - * The interface for RelayApi class. + * The interface for RelayManagementClient class. */ -public interface RelayApi { +public interface RelayManagementClient { /** - * Gets Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * 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. * @@ -54,13 +53,6 @@ public interface RelayApi { */ OperationsClient getOperations(); - /** - * Gets the NamespacesClient object to access its operations. - * - * @return the NamespacesClient object. - */ - NamespacesClient getNamespaces(); - /** * Gets the HybridConnectionsClient object to access its operations. * @@ -74,4 +66,25 @@ public interface RelayApi { * @return the WcfRelaysClient object. */ WcfRelaysClient getWcfRelays(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + NamespacesClient getNamespaces(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/WcfRelaysClient.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/WcfRelaysClient.java index c7bedf470a00..ecba1f0076aa 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/WcfRelaysClient.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/WcfRelaysClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent; @@ -19,134 +19,116 @@ */ public interface WcfRelaysClient { /** - * Lists the WCF relays within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list WCF relay operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); - - /** - * Lists the WCF relays within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list WCF relay operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); - - /** - * Creates or updates a WCF relay. This operation is idempotent. + * Get authorizationRule for a WCF relay by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. + * @param authorizationRuleName The authorization rule name. * @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 description of the WCF relay resource along with {@link Response}. + * @return authorizationRule for a WCF relay by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, String relayName, - WcfRelayInner parameters, Context context); + Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName, Context context); /** - * Creates or updates a WCF relay. This operation is idempotent. + * Get authorizationRule for a WCF relay by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. + * @param authorizationRuleName The authorization rule name. * @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 description of the WCF relay resource. + * @return authorizationRule for a WCF relay by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - WcfRelayInner createOrUpdate(String resourceGroupName, String namespaceName, String relayName, - WcfRelayInner parameters); + AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName); /** - * Deletes a WCF relay. + * Creates or updates an authorization rule for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String namespaceName, String relayName, + Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String relayName, String authorizationRuleName, AuthorizationRuleInner parameters, Context context); /** - * Deletes a WCF relay. + * Creates or updates an authorization rule for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, String relayName); + AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName, AuthorizationRuleInner parameters); /** - * Returns the description for the specified WCF relay. + * Deletes a WCF relay authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @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 description of the WCF relay resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String namespaceName, String relayName, - Context context); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, Context context); /** - * Returns the description for the specified WCF relay. + * Deletes a WCF relay authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @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 description of the WCF relay resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - WcfRelayInner get(String resourceGroupName, String namespaceName, String relayName); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName); /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, @@ -155,185 +137,203 @@ PagedIterable listAuthorizationRules(String resourceGrou /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String relayName, Context context); /** - * Creates or updates an authorization rule for a WCF relay. + * Primary and secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response}. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName, AuthorizationRuleInner parameters, - Context context); + Response listKeysWithResponse(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, Context context); /** - * Creates or updates an authorization rule for a WCF relay. + * Primary and secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule. + * @return namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, AuthorizationRuleInner parameters); + AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName); /** - * Deletes a WCF relay authorization rule. + * Regenerates the primary or secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 Response}. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context); /** - * Deletes a WCF relay authorization rule. + * Regenerates the primary or secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName); + AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters); /** - * Get authorizationRule for a WCF relay by name. + * Returns the description for the specified WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @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 authorizationRule for a WCF relay by name along with {@link Response}. + * @return description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, Context context); + Response getWithResponse(String resourceGroupName, String namespaceName, String relayName, + Context context); /** - * Get authorizationRule for a WCF relay by name. + * Returns the description for the specified WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @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 authorizationRule for a WCF relay by name. + * @return description of the WCF relay resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName); + WcfRelayInner get(String resourceGroupName, String namespaceName, String relayName); /** - * Primary and secondary connection strings to the WCF relay. + * Creates or updates a WCF relay. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a WCF relay. * @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 namespace/Relay Connection String along with {@link Response}. + * @return description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, String relayName, + WcfRelayInner parameters, Context context); /** - * Primary and secondary connection strings to the WCF relay. + * Creates or updates a WCF relay. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a WCF relay. * @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 namespace/Relay Connection String. + * @return description of the WCF relay resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName); + WcfRelayInner createOrUpdate(String resourceGroupName, String namespaceName, String relayName, + WcfRelayInner parameters); /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * Deletes a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context); + Response deleteWithResponse(String resourceGroupName, String namespaceName, String relayName, + Context context); /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * Deletes a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters); + void delete(String resourceGroupName, String namespaceName, String relayName); + + /** + * Lists the WCF relays within the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 the list WCF relay operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + + /** + * Lists the WCF relays within the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 the list WCF relay operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AccessKeysInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AccessKeysInner.java index b3b7c9f53c42..6117c9fe1cf2 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AccessKeysInner.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AccessKeysInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Namespace/Relay Connection String. */ -@Fluent +@Immutable public final class AccessKeysInner implements JsonSerializable { /* * Primary connection string of the created namespace authorization rule. @@ -44,7 +44,7 @@ public final class AccessKeysInner implements JsonSerializable /** * Creates an instance of AccessKeysInner class. */ - public AccessKeysInner() { + private AccessKeysInner() { } /** @@ -56,17 +56,6 @@ public String primaryConnectionString() { return this.primaryConnectionString; } - /** - * Set the primaryConnectionString property: Primary connection string of the created namespace authorization rule. - * - * @param primaryConnectionString the primaryConnectionString value to set. - * @return the AccessKeysInner object itself. - */ - public AccessKeysInner withPrimaryConnectionString(String primaryConnectionString) { - this.primaryConnectionString = primaryConnectionString; - return this; - } - /** * Get the secondaryConnectionString property: Secondary connection string of the created namespace authorization * rule. @@ -77,18 +66,6 @@ public String secondaryConnectionString() { return this.secondaryConnectionString; } - /** - * Set the secondaryConnectionString property: Secondary connection string of the created namespace authorization - * rule. - * - * @param secondaryConnectionString the secondaryConnectionString value to set. - * @return the AccessKeysInner object itself. - */ - public AccessKeysInner withSecondaryConnectionString(String secondaryConnectionString) { - this.secondaryConnectionString = secondaryConnectionString; - return this; - } - /** * Get the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. * @@ -98,17 +75,6 @@ public String primaryKey() { return this.primaryKey; } - /** - * Set the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. - * - * @param primaryKey the primaryKey value to set. - * @return the AccessKeysInner object itself. - */ - public AccessKeysInner withPrimaryKey(String primaryKey) { - this.primaryKey = primaryKey; - return this; - } - /** * Get the secondaryKey property: A base64-encoded 256-bit secondary key for signing and validating the SAS token. * @@ -118,17 +84,6 @@ public String secondaryKey() { return this.secondaryKey; } - /** - * Set the secondaryKey property: A base64-encoded 256-bit secondary key for signing and validating the SAS token. - * - * @param secondaryKey the secondaryKey value to set. - * @return the AccessKeysInner object itself. - */ - public AccessKeysInner withSecondaryKey(String secondaryKey) { - this.secondaryKey = secondaryKey; - return this; - } - /** * Get the keyName property: A string that describes the authorization rule. * @@ -138,25 +93,6 @@ public String keyName() { return this.keyName; } - /** - * Set the keyName property: A string that describes the authorization rule. - * - * @param keyName the keyName value to set. - * @return the AccessKeysInner object itself. - */ - public AccessKeysInner withKeyName(String keyName) { - this.keyName = keyName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleInner.java index 6e79f15bb44b..9ac076d95cc3 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleInner.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleInner.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -15,14 +15,24 @@ import java.util.List; /** - * Description of a namespace authorization rule. + * Single item in a List or Get AuthorizationRule operation. */ @Fluent public final class AuthorizationRuleInner extends ProxyResource { /* - * Authorization rule properties. + * Properties supplied to create or update AuthorizationRule */ - private AuthorizationRuleProperties innerProperties = new AuthorizationRuleProperties(); + private AuthorizationRuleProperties innerProperties; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -46,7 +56,7 @@ public AuthorizationRuleInner() { } /** - * Get the innerProperties property: Authorization rule properties. + * Get the innerProperties property: Properties supplied to create or update AuthorizationRule. * * @return the innerProperties value. */ @@ -54,6 +64,24 @@ private AuthorizationRuleProperties innerProperties() { return this.innerProperties; } + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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. * @@ -107,23 +135,6 @@ public AuthorizationRuleInner withRights(List rights) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model AuthorizationRuleInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AuthorizationRuleInner.class); - /** * {@inheritDoc} */ @@ -158,6 +169,10 @@ public static AuthorizationRuleInner fromJson(JsonReader jsonReader) throws IOEx deserializedAuthorizationRuleInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedAuthorizationRuleInner.innerProperties = AuthorizationRuleProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedAuthorizationRuleInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedAuthorizationRuleInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleProperties.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleProperties.java index 1c7a69e2de50..160e271553d3 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleProperties.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +14,7 @@ import java.util.List; /** - * Authorization rule properties. + * Properties supplied to create or update AuthorizationRule. */ @Fluent public final class AuthorizationRuleProperties implements JsonSerializable { @@ -50,21 +49,6 @@ public AuthorizationRuleProperties withRights(List rights) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rights() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property rights in model AuthorizationRuleProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AuthorizationRuleProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/CheckNameAvailabilityResultInner.java index 00310dc89301..de67203061d1 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/CheckNameAvailabilityResultInner.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/CheckNameAvailabilityResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Description of the check name availability request properties. */ -@Fluent +@Immutable public final class CheckNameAvailabilityResultInner implements JsonSerializable { /* * The detailed info regarding the reason associated with the namespace. @@ -35,7 +35,7 @@ public final class CheckNameAvailabilityResultInner implements JsonSerializable< /** * Creates an instance of CheckNameAvailabilityResultInner class. */ - public CheckNameAvailabilityResultInner() { + private CheckNameAvailabilityResultInner() { } /** @@ -57,18 +57,6 @@ public Boolean nameAvailable() { return this.nameAvailable; } - /** - * Set the nameAvailable property: Value indicating namespace is available. Returns true if the namespace is - * available; otherwise, false. - * - * @param nameAvailable the nameAvailable value to set. - * @return the CheckNameAvailabilityResultInner object itself. - */ - public CheckNameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - /** * Get the reason property: The reason for unavailability of a namespace. * @@ -78,25 +66,6 @@ public UnavailableReason reason() { return this.reason; } - /** - * Set the reason property: The reason for unavailability of a namespace. - * - * @param reason the reason value to set. - * @return the CheckNameAvailabilityResultInner object itself. - */ - public CheckNameAvailabilityResultInner withReason(UnavailableReason reason) { - this.reason = reason; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionInner.java index 3804f6f9b28a..f835879f037e 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionInner.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionInner.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -22,6 +23,16 @@ public final class HybridConnectionInner extends ProxyResource { */ private HybridConnectionProperties innerProperties; + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -52,6 +63,24 @@ private HybridConnectionProperties innerProperties() { return this.innerProperties; } + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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. * @@ -162,17 +191,6 @@ public HybridConnectionInner withUserMetadata(String userMetadata) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -207,6 +225,10 @@ public static HybridConnectionInner fromJson(JsonReader jsonReader) throws IOExc deserializedHybridConnectionInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedHybridConnectionInner.innerProperties = HybridConnectionProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedHybridConnectionInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedHybridConnectionInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionProperties.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionProperties.java index f5ae8a3db939..31aa9f6988c9 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionProperties.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; @@ -125,14 +125,6 @@ public HybridConnectionProperties withUserMetadata(String userMetadata) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetInner.java new file mode 100644 index 000000000000..bd91850c611e --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetInner.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import java.io.IOException; +import java.util.List; + +/** + * Description of topic resource. + */ +@Fluent +public final class NetworkRuleSetInner extends ProxyResource { + /* + * NetworkRuleSet properties + */ + private NetworkRuleSetProperties innerProperties; + + /* + * 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 NetworkRuleSetInner class. + */ + public NetworkRuleSetInner() { + } + + /** + * Get the innerProperties property: NetworkRuleSet properties. + * + * @return the innerProperties value. + */ + private NetworkRuleSetProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the trustedServiceAccessEnabled property: Value that indicates whether Trusted Service Access is Enabled or + * not. + * + * @return the trustedServiceAccessEnabled value. + */ + public Boolean trustedServiceAccessEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().trustedServiceAccessEnabled(); + } + + /** + * Set the trustedServiceAccessEnabled property: Value that indicates whether Trusted Service Access is Enabled or + * not. + * + * @param trustedServiceAccessEnabled the trustedServiceAccessEnabled value to set. + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withTrustedServiceAccessEnabled(Boolean trustedServiceAccessEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRuleSetProperties(); + } + this.innerProperties().withTrustedServiceAccessEnabled(trustedServiceAccessEnabled); + return this; + } + + /** + * Get the defaultAction property: Default Action for Network Rule Set. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.innerProperties() == null ? null : this.innerProperties().defaultAction(); + } + + /** + * Set the defaultAction property: Default Action for Network Rule Set. + * + * @param defaultAction the defaultAction value to set. + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withDefaultAction(DefaultAction defaultAction) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRuleSetProperties(); + } + this.innerProperties().withDefaultAction(defaultAction); + return this; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRuleSetProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the ipRules property: List of IpRules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.innerProperties() == null ? null : this.innerProperties().ipRules(); + } + + /** + * Set the ipRules property: List of IpRules. + * + * @param ipRules the ipRules value to set. + * @return the NetworkRuleSetInner object itself. + */ + public NetworkRuleSetInner withIpRules(List ipRules) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkRuleSetProperties(); + } + this.innerProperties().withIpRules(ipRules); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkRuleSetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkRuleSetInner 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 NetworkRuleSetInner. + */ + public static NetworkRuleSetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkRuleSetInner deserializedNetworkRuleSetInner = new NetworkRuleSetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkRuleSetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkRuleSetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkRuleSetInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkRuleSetInner.innerProperties = NetworkRuleSetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkRuleSetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkRuleSetInner; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetProperties.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetProperties.java new file mode 100644 index 000000000000..1dcc81fb3953 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetProperties.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.relay.fluent.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 com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import java.io.IOException; +import java.util.List; + +/** + * NetworkRuleSet properties. + */ +@Fluent +public final class NetworkRuleSetProperties implements JsonSerializable { + /* + * Value that indicates whether Trusted Service Access is Enabled or not. + */ + private Boolean trustedServiceAccessEnabled; + + /* + * Default Action for Network Rule Set + */ + private DefaultAction defaultAction; + + /* + * This determines if traffic is allowed over public network. By default it is enabled + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * List of IpRules + */ + private List ipRules; + + /** + * Creates an instance of NetworkRuleSetProperties class. + */ + public NetworkRuleSetProperties() { + } + + /** + * Get the trustedServiceAccessEnabled property: Value that indicates whether Trusted Service Access is Enabled or + * not. + * + * @return the trustedServiceAccessEnabled value. + */ + public Boolean trustedServiceAccessEnabled() { + return this.trustedServiceAccessEnabled; + } + + /** + * Set the trustedServiceAccessEnabled property: Value that indicates whether Trusted Service Access is Enabled or + * not. + * + * @param trustedServiceAccessEnabled the trustedServiceAccessEnabled value to set. + * @return the NetworkRuleSetProperties object itself. + */ + public NetworkRuleSetProperties withTrustedServiceAccessEnabled(Boolean trustedServiceAccessEnabled) { + this.trustedServiceAccessEnabled = trustedServiceAccessEnabled; + return this; + } + + /** + * Get the defaultAction property: Default Action for Network Rule Set. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Default Action for Network Rule Set. + * + * @param defaultAction the defaultAction value to set. + * @return the NetworkRuleSetProperties object itself. + */ + public NetworkRuleSetProperties withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the NetworkRuleSetProperties object itself. + */ + public NetworkRuleSetProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the ipRules property: List of IpRules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: List of IpRules. + * + * @param ipRules the ipRules value to set. + * @return the NetworkRuleSetProperties object itself. + */ + public NetworkRuleSetProperties withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("trustedServiceAccessEnabled", this.trustedServiceAccessEnabled); + jsonWriter.writeStringField("defaultAction", this.defaultAction == null ? null : this.defaultAction.toString()); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkRuleSetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkRuleSetProperties 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 NetworkRuleSetProperties. + */ + public static NetworkRuleSetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkRuleSetProperties deserializedNetworkRuleSetProperties = new NetworkRuleSetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trustedServiceAccessEnabled".equals(fieldName)) { + deserializedNetworkRuleSetProperties.trustedServiceAccessEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultAction".equals(fieldName)) { + deserializedNetworkRuleSetProperties.defaultAction = DefaultAction.fromString(reader.getString()); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedNetworkRuleSetProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("ipRules".equals(fieldName)) { + List ipRules = reader.readArray(reader1 -> NWRuleSetIpRules.fromJson(reader1)); + deserializedNetworkRuleSetProperties.ipRules = ipRules; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkRuleSetProperties; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/OperationInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/OperationInner.java index e42c93d25e6b..507e531611ee 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/OperationInner.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/OperationInner.java @@ -1,40 +1,63 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; -import com.azure.core.annotation.Fluent; +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.relay.models.ActionType; import com.azure.resourcemanager.relay.models.OperationDisplay; +import com.azure.resourcemanager.relay.models.Origin; import java.io.IOException; /** - * A Relay REST API operation. + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* - * Operation name: {provider}/{resource}/{operation} + * 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; /* - * The object that represents the operation. + * 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. */ - public OperationInner() { + private OperationInner() { } /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. + * 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. */ @@ -43,7 +66,17 @@ public String name() { } /** - * Get the display property: The object that represents the operation. + * 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. */ @@ -52,25 +85,23 @@ public OperationDisplay display() { } /** - * Set the display property: The object that represents the operation. + * 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". * - * @param display the display value to set. - * @return the OperationInner object itself. + * @return the origin value. */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; + public Origin origin() { + return this.origin; } /** - * Validates the instance. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the actionType value. */ - public void validate() { - if (display() != null) { - display().validate(); - } + public ActionType actionType() { + return this.actionType; } /** @@ -100,8 +131,14 @@ public static OperationInner fromJson(JsonReader jsonReader) throws IOException 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(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..345f1dbe4632 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import java.io.IOException; + +/** + * Properties of the PrivateEndpointConnection. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Properties of the PrivateEndpointConnection. + */ + private PrivateEndpointConnectionProperties innerProperties; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * 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 PrivateEndpointConnectionInner class. + */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the PrivateEndpointConnection. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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; + } + + /** + * Get the privateEndpoint property: The Private Endpoint resource for this Connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The Private Endpoint resource for this Connection. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Details about the state of the connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public ConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: Details about the state of the connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @return the provisioningState value. + */ + public EndPointProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState(EndPointProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..8140c9e5496b --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionProperties.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.relay.fluent.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 com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import java.io.IOException; + +/** + * Properties of the private endpoint connection resource. + */ +@Fluent +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The Private Endpoint resource for this Connection. + */ + private PrivateEndpoint privateEndpoint; + + /* + * Details about the state of the connection. + */ + private ConnectionState privateLinkServiceConnectionState; + + /* + * Provisioning state of the Private Endpoint Connection. + */ + private EndPointProvisioningState provisioningState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the privateEndpoint property: The Private Endpoint resource for this Connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The Private Endpoint resource for this Connection. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Details about the state of the connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public ConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Details about the state of the connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @return the provisioningState value. + */ + public EndPointProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withProvisioningState(EndPointProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = ConnectionState.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = EndPointProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..aaa808b6cc21 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A resource that supports private link capabilities. + */ +@Immutable +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * A resource that supports private link capabilities. + */ + private PrivateLinkResourceProperties innerProperties; + + /* + * 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 PrivateLinkResourceInner class. + */ + private PrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: A resource that supports private link capabilities. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner 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 PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.innerProperties + = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceProperties.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..ef98d5dafabe --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of PrivateLinkResource. + */ +@Immutable +public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * The private link resource group id. + */ + private String groupId; + + /* + * The private link resource required member names. + */ + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + private PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeArrayField("requiredMembers", this.requiredMembers, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties 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 PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourcesListResultInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourcesListResultInner.java new file mode 100644 index 000000000000..b017e2301b68 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourcesListResultInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Result of the List private link resources operation. + */ +@Immutable +public final class PrivateLinkResourcesListResultInner + implements JsonSerializable { + /* + * A collection of private link resources + */ + private List value; + + /* + * A link for the next page of private link resources. + */ + private String nextLink; + + /** + * Creates an instance of PrivateLinkResourcesListResultInner class. + */ + private PrivateLinkResourcesListResultInner() { + } + + /** + * Get the value property: A collection of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: A link for the next page of private link resources. + * + * @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 PrivateLinkResourcesListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourcesListResultInner 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 PrivateLinkResourcesListResultInner. + */ + public static PrivateLinkResourcesListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourcesListResultInner deserializedPrivateLinkResourcesListResultInner + = new PrivateLinkResourcesListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourcesListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourcesListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourcesListResultInner; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceInner.java index 4cc495ffcf8d..34f156bebb1d 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceInner.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceInner.java @@ -1,18 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.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.relay.models.ProvisioningStateEnum; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.io.IOException; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** @@ -20,15 +23,20 @@ */ @Fluent public final class RelayNamespaceInner extends Resource { + /* + * Description of Relay namespace + */ + private RelayNamespaceProperties innerProperties; + /* * SKU of the namespace. */ private Sku sku; /* - * Description of Relay namespace + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private RelayNamespaceProperties innerProperties; + private SystemData systemData; /* * The type of the resource. @@ -51,6 +59,15 @@ public final class RelayNamespaceInner extends Resource { public RelayNamespaceInner() { } + /** + * Get the innerProperties property: Description of Relay namespace. + * + * @return the innerProperties value. + */ + private RelayNamespaceProperties innerProperties() { + return this.innerProperties; + } + /** * Get the sku property: SKU of the namespace. * @@ -72,12 +89,12 @@ public RelayNamespaceInner withSku(Sku sku) { } /** - * Get the innerProperties property: Description of Relay namespace. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the innerProperties value. + * @return the systemData value. */ - private RelayNamespaceProperties innerProperties() { - return this.innerProperties; + public SystemData systemData() { + return this.systemData; } /** @@ -129,14 +146,23 @@ public RelayNamespaceInner withTags(Map tags) { } /** - * Get the provisioningState property: The provisioningState property. + * Get the provisioningState property: Provisioning state of the Namespace. * * @return the provisioningState value. */ - public ProvisioningStateEnum provisioningState() { + public String provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Get the status property: Status of the Namespace. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + /** * Get the createdAt property: The time the namespace was created. * @@ -174,17 +200,81 @@ public String metricId() { } /** - * Validates the instance. + * Get the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the RelayNamespaceInner object itself. */ - public void validate() { - if (sku() != null) { - sku().validate(); + public RelayNamespaceInner + withPrivateEndpointConnections(List privateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new RelayNamespaceProperties(); } - if (innerProperties() != null) { - innerProperties().validate(); + this.innerProperties().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RelayNamespaceInner object itself. + */ + public RelayNamespaceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new RelayNamespaceProperties(); } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the minimumTlsVersion property: The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the RelayNamespaceInner object itself. + */ + public RelayNamespaceInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RelayNamespaceProperties(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; } /** @@ -195,8 +285,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("sku", this.sku); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("sku", this.sku); return jsonWriter.writeEndObject(); } @@ -227,10 +317,12 @@ public static RelayNamespaceInner fromJson(JsonReader jsonReader) throws IOExcep } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedRelayNamespaceInner.withTags(tags); - } else if ("sku".equals(fieldName)) { - deserializedRelayNamespaceInner.sku = Sku.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedRelayNamespaceInner.innerProperties = RelayNamespaceProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedRelayNamespaceInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRelayNamespaceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceProperties.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceProperties.java index 8544e5a2123b..86bf0ba18e88 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceProperties.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceProperties.java @@ -1,28 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.relay.models.ProvisioningStateEnum; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.io.IOException; import java.time.OffsetDateTime; +import java.util.List; /** * Properties of the namespace. */ -@Immutable +@Fluent public final class RelayNamespaceProperties implements JsonSerializable { /* - * The provisioningState property. + * Provisioning state of the Namespace. */ - private ProvisioningStateEnum provisioningState; + private String provisioningState; + + /* + * Status of the Namespace. + */ + private String status; /* * The time the namespace was created. @@ -44,6 +51,24 @@ public final class RelayNamespaceProperties implements JsonSerializable privateEndpointConnections; + + /* + * This determines if traffic is allowed over public network. By default it is enabled. + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. + */ + private TlsVersion minimumTlsVersion; + /** * Creates an instance of RelayNamespaceProperties class. */ @@ -51,14 +76,23 @@ public RelayNamespaceProperties() { } /** - * Get the provisioningState property: The provisioningState property. + * Get the provisioningState property: Provisioning state of the Namespace. * * @return the provisioningState value. */ - public ProvisioningStateEnum provisioningState() { + public String provisioningState() { return this.provisioningState; } + /** + * Get the status property: Status of the Namespace. + * + * @return the status value. + */ + public String status() { + return this.status; + } + /** * Get the createdAt property: The time the namespace was created. * @@ -96,11 +130,72 @@ public String metricId() { } /** - * Validates the instance. + * Get the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the RelayNamespaceProperties object itself. + */ + public RelayNamespaceProperties + withPrivateEndpointConnections(List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RelayNamespaceProperties object itself. + */ + public RelayNamespaceProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the RelayNamespaceProperties object itself. */ - public void validate() { + public RelayNamespaceProperties withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; } /** @@ -109,6 +204,12 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("privateEndpointConnections", this.privateEndpointConnections, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeStringField("minimumTlsVersion", + this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); return jsonWriter.writeEndObject(); } @@ -128,8 +229,9 @@ public static RelayNamespaceProperties fromJson(JsonReader jsonReader) throws IO reader.nextToken(); if ("provisioningState".equals(fieldName)) { - deserializedRelayNamespaceProperties.provisioningState - = ProvisioningStateEnum.fromString(reader.getString()); + deserializedRelayNamespaceProperties.provisioningState = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedRelayNamespaceProperties.status = reader.getString(); } else if ("createdAt".equals(fieldName)) { deserializedRelayNamespaceProperties.createdAt = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); @@ -140,6 +242,15 @@ public static RelayNamespaceProperties fromJson(JsonReader jsonReader) throws IO deserializedRelayNamespaceProperties.serviceBusEndpoint = reader.getString(); } else if ("metricId".equals(fieldName)) { deserializedRelayNamespaceProperties.metricId = reader.getString(); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedRelayNamespaceProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedRelayNamespaceProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedRelayNamespaceProperties.minimumTlsVersion = TlsVersion.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayInner.java index dbb564772c99..98ccf27a58e1 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayInner.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayInner.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -23,6 +24,16 @@ public final class WcfRelayInner extends ProxyResource { */ private WcfRelayProperties innerProperties; + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -53,6 +64,24 @@ private WcfRelayProperties innerProperties() { return this.innerProperties; } + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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. * @@ -220,17 +249,6 @@ public WcfRelayInner withUserMetadata(String userMetadata) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -265,6 +283,10 @@ public static WcfRelayInner fromJson(JsonReader jsonReader) throws IOException { deserializedWcfRelayInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedWcfRelayInner.innerProperties = WcfRelayProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedWcfRelayInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedWcfRelayInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayProperties.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayProperties.java index 4abf60d33f13..f4cf951248af 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayProperties.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.fluent.models; @@ -192,14 +192,6 @@ public WcfRelayProperties withUserMetadata(String userMetadata) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/package-info.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/package-info.java index 0ba92b05852b..dd4167d20c04 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/package-info.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for RelayApi. + * Package containing the inner data models for Relay. * Use these API to manage Azure Relay resources through Azure Resource Manager. */ package com.azure.resourcemanager.relay.fluent.models; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/package-info.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/package-info.java index 765a0edf833c..794956b1ceed 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/package-info.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for RelayApi. + * Package containing the service clients for Relay. * Use these API to manage Azure Relay resources through Azure Resource Manager. */ package com.azure.resourcemanager.relay.fluent; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AccessKeysImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AccessKeysImpl.java index d28735428fe6..2b1532bc8138 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AccessKeysImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AccessKeysImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AuthorizationRuleImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AuthorizationRuleImpl.java index 685115c50e6f..1f6aaf1793d8 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AuthorizationRuleImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AuthorizationRuleImpl.java @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; import com.azure.resourcemanager.relay.models.AccessKeys; @@ -32,6 +34,14 @@ public String type() { return this.innerModel().type(); } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public List rights() { List inner = this.innerModel().rights(); if (inner != null) { @@ -41,6 +51,14 @@ public List rights() { } } + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + public String resourceGroupName() { return resourceGroupName; } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/CheckNameAvailabilityResultImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/CheckNameAvailabilityResultImpl.java index c06029c80633..bb018924a30f 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/CheckNameAvailabilityResultImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/CheckNameAvailabilityResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionImpl.java index 3d436e840e32..c53b1d25188f 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionImpl.java @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.relay.fluent.models.HybridConnectionInner; import com.azure.resourcemanager.relay.models.HybridConnection; @@ -27,6 +29,14 @@ public String type() { return this.innerModel().type(); } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public OffsetDateTime createdAt() { return this.innerModel().createdAt(); } @@ -47,6 +57,14 @@ public String userMetadata() { return this.innerModel().userMetadata(); } + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + public String resourceGroupName() { return resourceGroupName; } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsClientImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsClientImpl.java index 6b4b632ccb17..d6c39d4415bb 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsClientImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; @@ -33,8 +33,8 @@ import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; import com.azure.resourcemanager.relay.fluent.models.HybridConnectionInner; -import com.azure.resourcemanager.relay.models.AuthorizationRuleListResult; -import com.azure.resourcemanager.relay.models.HybridConnectionListResult; +import com.azure.resourcemanager.relay.implementation.models.AuthorizationRuleListResult; +import com.azure.resourcemanager.relay.implementation.models.HybridConnectionListResult; import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; import reactor.core.publisher.Mono; @@ -50,139 +50,228 @@ public final class HybridConnectionsClientImpl implements HybridConnectionsClien /** * The service client containing this operation class. */ - private final RelayApiImpl client; + private final RelayManagementClientImpl client; /** * Initializes an instance of HybridConnectionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - HybridConnectionsClientImpl(RelayApiImpl client) { + HybridConnectionsClientImpl(RelayManagementClientImpl client) { this.service = RestProxy.create(HybridConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for RelayApiHybridConnections to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for RelayManagementClientHybridConnections to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RelayApiHybridConnec") + @Host("{endpoint}") + @ServiceInterface(name = "RelayManagementClientHybridConnections") public interface HybridConnectionsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespace(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + Mono> getAuthorizationRule(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("hybridConnectionName") String hybridConnectionName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Response getAuthorizationRuleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("hybridConnectionName") String hybridConnectionName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") HybridConnectionInner parameters, @HeaderParam("Accept") String accept, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}") - @ExpectedResponses({ 200, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, + Mono> createOrUpdateAuthorizationRule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("hybridConnectionName") String hybridConnectionName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AuthorizationRuleInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response createOrUpdateAuthorizationRuleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("hybridConnectionName") String hybridConnectionName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AuthorizationRuleInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("hybridConnectionName") String hybridConnectionName, + @PathParam("authorizationRuleName") String authorizationRuleName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteAuthorizationRuleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("hybridConnectionName") String hybridConnectionName, + @PathParam("authorizationRuleName") String authorizationRuleName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules(@HostParam("$host") String endpoint, + Mono> listAuthorizationRules(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("hybridConnectionName") String hybridConnectionName, + @PathParam("hybridConnectionName") String hybridConnectionName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAuthorizationRulesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("hybridConnectionName") String hybridConnectionName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule(@HostParam("$host") String endpoint, + Mono> listKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("hybridConnectionName") String hybridConnectionName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AuthorizationRuleInner parameters, @HeaderParam("Accept") String accept, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({ 200, 204 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule(@HostParam("$host") String endpoint, + Response listKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("hybridConnectionName") String hybridConnectionName, - @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule(@HostParam("$host") String endpoint, + Mono> regenerateKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("hybridConnectionName") String hybridConnectionName, @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/listKeys") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, + Response regenerateKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("hybridConnectionName") String hybridConnectionName, @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("hybridConnectionName") String hybridConnectionName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}") + @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("namespaceName") String namespaceName, + @PathParam("hybridConnectionName") String hybridConnectionName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("hybridConnectionName") String hybridConnectionName, - @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HybridConnectionInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateAccessKeyParameters parameters, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("hybridConnectionName") String hybridConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HybridConnectionInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("hybridConnectionName") String hybridConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections/{hybridConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("hybridConnectionName") String hybridConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/hybridConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespaceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listByNamespaceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -190,609 +279,311 @@ Mono> listByNamespaceNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists the hybrid connection within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the list hybrid connection operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync(String resourceGroupName, - String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByNamespace(this.client.getEndpoint(), resourceGroupName, namespaceName, - 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())); - } - /** - * Lists the hybrid connection within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list hybrid connection operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync(String resourceGroupName, - String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByNamespace(this.client.getEndpoint(), resourceGroupName, namespaceName, 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)); - } - - /** - * Lists the hybrid connection within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the list hybrid connection operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { - return new PagedFlux<>(() -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); - } - - /** - * Lists the hybrid connection within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list hybrid connection operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName, - Context context) { - return new PagedFlux<>(() -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAuthorizationRulesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * Lists the hybrid connection within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the list hybrid connection operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * Lists the hybrid connection within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list hybrid connection operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName, - Context context) { - return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByNamespaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Hybrid connection authorization rule for a hybrid connection by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param parameters Parameters supplied to create a hybrid connection. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of hybrid connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, HybridConnectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> getAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String hybridConnectionName, String authorizationRuleName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context)) + .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a service hybrid connection. This operation is idempotent. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param parameters Parameters supplied to create a hybrid connection. - * @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 description of hybrid connection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, HybridConnectionInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); - } - - /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Hybrid connection authorization rule for a hybrid connection by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param parameters Parameters supplied to create a hybrid connection. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of hybrid connection resource on successful completion of {@link Mono}. + * @return single item in a List or Get AuthorizationRule operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName, HybridConnectionInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Hybrid connection authorization rule for a hybrid connection by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param parameters Parameters supplied to create a hybrid connection. + * @param authorizationRuleName The authorization rule name. * @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 description of hybrid connection resource along with {@link Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, HybridConnectionInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, parameters, - context).block(); - } - - /** - * Creates or updates a service hybrid connection. This operation is idempotent. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param parameters Parameters supplied to create a hybrid connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of hybrid connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner createOrUpdate(String resourceGroupName, String namespaceName, - String hybridConnectionName, HybridConnectionInner parameters) { - return createOrUpdateWithResponse(resourceGroupName, namespaceName, hybridConnectionName, parameters, - Context.NONE).getValue(); - } - - /** - * Deletes a hybrid connection. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 namespaceName, - String hybridConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String hybridConnectionName, String authorizationRuleName, Context context) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.getAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, accept, context); } /** - * Deletes a hybrid connection. + * Hybrid connection authorization rule for a hybrid connection by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param context The context to associate with this operation. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, Context.NONE).getValue(); } /** - * Deletes a hybrid connection. + * Creates or updates an authorization rule for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName, String hybridConnectionName) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName) - .flatMap(ignored -> Mono.empty()); + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, + AuthorizationRuleInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + hybridConnectionName, authorizationRuleName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a hybrid connection. + * Creates or updates an authorization rule for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param context The context to associate with this operation. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 Response}. + * @return single item in a List or Get AuthorizationRule operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, Context context) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, context).block(); + private Mono createOrUpdateAuthorizationRuleAsync(String resourceGroupName, + String namespaceName, String hybridConnectionName, String authorizationRuleName, + AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a hybrid connection. + * Creates or updates an authorization rule for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, String hybridConnectionName) { - deleteWithResponse(resourceGroupName, namespaceName, hybridConnectionName, Context.NONE); + public Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String hybridConnectionName, String authorizationRuleName, + AuthorizationRuleInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, contentType, accept, parameters, context); } /** - * Returns the description for the specified hybrid connection. + * Creates or updates an authorization rule for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 description of hybrid connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, parameters, Context.NONE).getValue(); } /** - * Returns the description for the specified hybrid connection. + * Deletes a hybrid connection authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param context The context to associate with this operation. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of hybrid connection resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String hybridConnectionName, String authorizationRuleName) { + return FluxUtil + .withContext(context -> service.deleteAuthorizationRule(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + hybridConnectionName, authorizationRuleName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns the description for the specified hybrid connection. + * Deletes a hybrid connection authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of hybrid connection resource on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName) { - return getWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName).flatMap(ignored -> Mono.empty()); } /** - * Returns the description for the specified hybrid connection. + * Deletes a hybrid connection authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. * @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 description of hybrid connection resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, context).block(); + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, Context context) { + return service.deleteAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, context); } /** - * Returns the description for the specified hybrid connection. + * Deletes a hybrid connection authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of hybrid connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner get(String resourceGroupName, String namespaceName, String hybridConnectionName) { - return getWithResponse(resourceGroupName, namespaceName, hybridConnectionName, Context.NONE).getValue(); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName) { + deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, Context.NONE); } /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync(String resourceGroupName, String namespaceName, String hybridConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAuthorizationRules(this.client.getEndpoint(), resourceGroupName, - namespaceName, hybridConnectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.listAuthorizationRules(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + hybridConnectionName, 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())); @@ -801,908 +592,647 @@ private Mono> listAuthorizationRulesSingle /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAuthorizationRules(this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - 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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + String namespaceName, String hybridConnectionName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, hybridConnectionName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); } /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation as paginated response with {@link PagedFlux}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAuthorizationRulesSinglePage(String resourceGroupName, String namespaceName, String hybridConnectionName) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, hybridConnectionName), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + final String accept = "application/json"; + Response res = service.listAuthorizationRulesSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + hybridConnectionName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @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 from the list namespace operation as paginated response with {@link PagedFlux}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAuthorizationRulesSinglePage(String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { - return new PagedFlux<>(() -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, - hybridConnectionName, context), nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listAuthorizationRulesSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + hybridConnectionName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String hybridConnectionName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, hybridConnectionName)); + return new PagedIterable<>( + () -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName, hybridConnectionName), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink)); } /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { return new PagedIterable<>( - listAuthorizationRulesAsync(resourceGroupName, namespaceName, hybridConnectionName, context)); + () -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName, hybridConnectionName, context), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink, context)); } /** - * Creates or updates an authorization rule for a hybrid connection. + * Primary and secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> listKeysWithResponseAsync(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates an authorization rule for a hybrid connection. + * Primary and secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Primary and secondary connection strings to the hybrid connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + public Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, accept, context); + return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, accept, context); } /** - * Creates or updates an authorization rule for a hybrid connection. + * Primary and secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule on successful completion of {@link Mono}. + * @return namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAuthorizationRuleAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, + Context.NONE).getValue(); } /** - * Creates or updates an authorization rule for a hybrid connection. + * Regenerates the primary or secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace authorization rule along with {@link Response}. + * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, + private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters, Context context) { - return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, parameters, context).block(); + RegenerateAccessKeyParameters parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates an authorization rule for a hybrid connection. + * Regenerates the primary or secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. + * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace authorization rule. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, parameters, Context.NONE).getValue(); + private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a hybrid connection authorization rule. + * Regenerates the primary or secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. + * @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 Response} on successful completion of {@link Mono}. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, + Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteAuthorizationRule(this.client.getEndpoint(), resourceGroupName, - namespaceName, hybridConnectionName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.regenerateKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, contentType, accept, parameters, context); } /** - * Deletes a hybrid connection authorization rule. + * Regenerates the primary or secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponse(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, + parameters, Context.NONE).getValue(); + } + + /** + * Returns the description for the specified hybrid connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param hybridConnectionName The hybrid connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of hybrid connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String namespaceName, + String hybridConnectionName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - accept, context); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a hybrid connection authorization rule. + * Returns the description for the specified hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return description of hybrid connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName).flatMap(ignored -> Mono.empty()); + private Mono getAsync(String resourceGroupName, String namespaceName, + String hybridConnectionName) { + return getWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a hybrid connection authorization rule. + * Returns the description for the specified hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @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 Response}. + * @return description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, context).block(); + public Response getWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, hybridConnectionName, accept, context); } /** - * Deletes a hybrid connection authorization rule. + * Returns the description for the specified hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of hybrid connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName) { - deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, Context.NONE); + public HybridConnectionInner get(String resourceGroupName, String namespaceName, String hybridConnectionName) { + return getWithResponse(resourceGroupName, namespaceName, hybridConnectionName, Context.NONE).getValue(); } /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Creates or updates a service hybrid connection. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a hybrid connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace authorization rule along with {@link Response} on successful completion of + * @return description of hybrid connection resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String namespaceName, String hybridConnectionName, HybridConnectionInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), resourceGroupName, - namespaceName, hybridConnectionName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, contentType, + accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Creates or updates a service hybrid connection. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to create a hybrid connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return description of hybrid connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - accept, context); + private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, + String hybridConnectionName, HybridConnectionInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Creates or updates a service hybrid connection. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a hybrid connection. + * @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 description of a namespace authorization rule on successful completion of {@link Mono}. + * @return description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, HybridConnectionInner parameters, 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, namespaceName, hybridConnectionName, contentType, + accept, parameters, context); } /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Creates or updates a service hybrid connection. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to create a hybrid connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace authorization rule along with {@link Response}. + * @return description of hybrid connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName, Context context) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, context).block(); + public HybridConnectionInner createOrUpdate(String resourceGroupName, String namespaceName, + String hybridConnectionName, HybridConnectionInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, namespaceName, hybridConnectionName, parameters, + Context.NONE).getValue(); } /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Deletes a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace authorization rule. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName) { - return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, Context.NONE).getValue(); + private Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, + String hybridConnectionName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Primary and secondary connection strings to the hybrid connection. + * Deletes a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono deleteAsync(String resourceGroupName, String namespaceName, String hybridConnectionName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName) + .flatMap(ignored -> Mono.empty()); } /** - * Primary and secondary connection strings to the hybrid connection. + * Deletes a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @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 namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + public Response deleteWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, hybridConnectionName, context); } /** - * Primary and secondary connection strings to the hybrid connection. + * Deletes a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public void delete(String resourceGroupName, String namespaceName, String hybridConnectionName) { + deleteWithResponse(resourceGroupName, namespaceName, hybridConnectionName, Context.NONE); } /** - * Primary and secondary connection strings to the hybrid connection. + * Lists the hybrid connection within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @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 namespace/Relay Connection String along with {@link Response}. + * @return the response of a HybridConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, - context).block(); + private Mono> listByNamespaceSinglePageAsync(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByNamespace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, 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())); } /** - * Primary and secondary connection strings to the hybrid connection. + * Lists the hybrid connection within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String. + * @return the response of a HybridConnection list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName) { - return listKeysWithResponse(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, - Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>(() -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Lists the hybrid connection within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a HybridConnection list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private PagedResponse listByNamespaceSinglePage(String resourceGroupName, + String namespaceName) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByNamespaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Lists the hybrid connection within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a HybridConnection list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName, - RegenerateAccessKeyParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (hybridConnectionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hybridConnectionName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private PagedResponse listByNamespaceSinglePage(String resourceGroupName, + String namespaceName, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerateKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context); + Response res + = service.listByNamespaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Lists the hybrid connection within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String on successful completion of {@link Mono}. + * @return the response of a HybridConnection list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(() -> listByNamespaceSinglePage(resourceGroupName, namespaceName), + nextLink -> listByNamespaceNextSinglePage(nextLink)); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Lists the hybrid connection within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String along with {@link Response}. + * @return the response of a HybridConnection list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context) { - return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, parameters, context).block(); + return new PagedIterable<>(() -> listByNamespaceSinglePage(resourceGroupName, namespaceName, context), + nextLink -> listByNamespaceNextSinglePage(nextLink, context)); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Get the next page of items. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @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 namespace/Relay Connection String. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponse(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, - parameters, Context.NONE).getValue(); + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAuthorizationRulesNext(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())); } /** @@ -1712,24 +1242,15 @@ public AccessKeysInner regenerateKeys(String resourceGroupName, String namespace * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the list hybrid connection operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listAuthorizationRulesNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByNamespaceNext(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())); + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1740,24 +1261,16 @@ private Mono> listByNamespaceNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the list hybrid connection operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync(String nextLink, + private PagedResponse listAuthorizationRulesNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1767,27 +1280,37 @@ private Mono> listByNamespaceNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a HybridConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + .withContext(context -> service.listByNamespaceNext(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 HybridConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByNamespaceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByNamespaceNextSync(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. * @@ -1796,23 +1319,14 @@ private Mono> listAuthorizationRulesNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a HybridConnection list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByNamespaceNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByNamespaceNextSync(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/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsImpl.java index 9863ca894747..3e950ce30e9a 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; @@ -32,75 +32,34 @@ public HybridConnectionsImpl(HybridConnectionsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { - PagedIterable inner - = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HybridConnectionImpl(inner1, this.manager())); - } - - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName, - Context context) { - PagedIterable inner - = this.serviceClient().listByNamespace(resourceGroupName, namespaceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HybridConnectionImpl(inner1, this.manager())); - } - - public Response deleteWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, hybridConnectionName, context); - } - - public void delete(String resourceGroupName, String namespaceName, String hybridConnectionName) { - this.serviceClient().delete(resourceGroupName, namespaceName, hybridConnectionName); - } - - public Response getWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, namespaceName, hybridConnectionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new HybridConnectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, Context context) { + Response inner = this.serviceClient() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AuthorizationRuleImpl(inner.getValue(), this.manager())); } - public HybridConnection get(String resourceGroupName, String namespaceName, String hybridConnectionName) { - HybridConnectionInner inner = this.serviceClient().get(resourceGroupName, namespaceName, hybridConnectionName); + public AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName) { + AuthorizationRuleInner inner = this.serviceClient() + .getAuthorizationRule(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName); if (inner != null) { - return new HybridConnectionImpl(inner, this.manager()); + return new AuthorizationRuleImpl(inner, this.manager()); } else { return null; } } - public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, - String hybridConnectionName) { - PagedIterable inner - = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, hybridConnectionName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); - } - - public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, - String hybridConnectionName, Context context) { - PagedIterable inner = this.serviceClient() - .listAuthorizationRules(resourceGroupName, namespaceName, hybridConnectionName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); - } - public Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, AuthorizationRuleInner parameters, Context context) { Response inner = this.serviceClient() .createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AuthorizationRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AuthorizationRuleImpl(inner.getValue(), this.manager())); } public AuthorizationRule createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, @@ -128,28 +87,18 @@ public void deleteAuthorizationRule(String resourceGroupName, String namespaceNa .deleteAuthorizationRule(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName); } - public Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context) { - Response inner = this.serviceClient() - .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AuthorizationRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, + String hybridConnectionName) { + PagedIterable inner + = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, hybridConnectionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } - public AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName) { - AuthorizationRuleInner inner = this.serviceClient() - .getAuthorizationRule(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName); - if (inner != null) { - return new AuthorizationRuleImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, + String hybridConnectionName, Context context) { + PagedIterable inner = this.serviceClient() + .listAuthorizationRules(resourceGroupName, namespaceName, hybridConnectionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } public Response listKeysWithResponse(String resourceGroupName, String namespaceName, @@ -157,12 +106,8 @@ public Response listKeysWithResponse(String resourceGroupName, Strin Response inner = this.serviceClient() .listKeysWithResponse(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccessKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); } public AccessKeys listKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, @@ -182,12 +127,8 @@ public Response regenerateKeysWithResponse(String resourceGroupName, Response inner = this.serviceClient() .regenerateKeysWithResponse(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccessKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); } public AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, @@ -201,6 +142,45 @@ public AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, } } + public Response getWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, namespaceName, hybridConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HybridConnectionImpl(inner.getValue(), this.manager())); + } + + public HybridConnection get(String resourceGroupName, String namespaceName, String hybridConnectionName) { + HybridConnectionInner inner = this.serviceClient().get(resourceGroupName, namespaceName, hybridConnectionName); + if (inner != null) { + return new HybridConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, hybridConnectionName, context); + } + + public void delete(String resourceGroupName, String namespaceName, String hybridConnectionName) { + this.serviceClient().delete(resourceGroupName, namespaceName, hybridConnectionName); + } + + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + PagedIterable inner + = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HybridConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName, + Context context) { + PagedIterable inner + = this.serviceClient().listByNamespace(resourceGroupName, namespaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HybridConnectionImpl(inner1, this.manager())); + } + public HybridConnection getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesClientImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesClientImpl.java index f269788f704d..ed44e1f94c05 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesClientImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; @@ -29,6 +29,7 @@ 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; @@ -37,11 +38,12 @@ import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; import com.azure.resourcemanager.relay.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner; -import com.azure.resourcemanager.relay.models.AuthorizationRuleListResult; +import com.azure.resourcemanager.relay.implementation.models.AuthorizationRuleListResult; +import com.azure.resourcemanager.relay.implementation.models.RelayNamespaceListResult; import com.azure.resourcemanager.relay.models.CheckNameAvailability; import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; -import com.azure.resourcemanager.relay.models.RelayNamespaceListResult; import com.azure.resourcemanager.relay.models.RelayUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -59,156 +61,314 @@ public final class NamespacesClientImpl implements NamespacesClient { /** * The service client containing this operation class. */ - private final RelayApiImpl client; + private final RelayManagementClientImpl client; /** * Initializes an instance of NamespacesClientImpl. * * @param client the instance of the service client containing this operation class. */ - NamespacesClientImpl(RelayApiImpl client) { + NamespacesClientImpl(RelayManagementClientImpl client) { this.service = RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for RelayApiNamespaces to be used by the proxy service to perform REST - * calls. + * The interface defining all the services for RelayManagementClientNamespaces to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RelayApiNamespaces") + @Host("{endpoint}") + @ServiceInterface(name = "RelayManagementClientNamespaces") public interface NamespacesService { @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, + Mono> getAuthorizationRule(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CheckNameAvailability parameters, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response getAuthorizationRuleSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AuthorizationRuleInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateAuthorizationRuleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AuthorizationRuleInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteAuthorizationRuleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> listAuthorizationRules(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Response listAuthorizationRulesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RelayNamespaceInner parameters, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") - @ExpectedResponses({ 200, 202, 204 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response listKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response regenerateKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") + @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("namespaceName") String namespaceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") + @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("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RelayNamespaceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") + @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("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RelayNamespaceInner parameters, Context context); + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RelayUpdateParameters parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RelayUpdateParameters parameters, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RelayUpdateParameters parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") + @ExpectedResponses({ 200, 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("namespaceName") String namespaceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}") + @ExpectedResponses({ 200, 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("namespaceName") String namespaceName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AuthorizationRuleInner parameters, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/networkRuleSets/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + Mono> getNetworkRuleSet(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/networkRuleSets/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys(@HostParam("$host") String endpoint, + Response getNetworkRuleSetSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/networkRuleSets/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateNetworkRuleSet(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NetworkRuleSetInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/networkRuleSets/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateNetworkRuleSetSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NetworkRuleSetInner parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailability parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateAccessKeyParameters parameters, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailability parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @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> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listAuthorizationRulesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -216,963 +376,806 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @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> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + 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> 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); } /** - * Check the specified namespace name availability. + * Authorization rule for a namespace by name. * - * @param parameters Parameters to check availability of the specified namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the check name availability request properties along with {@link Response} on successful + * @return single item in a List or Get AuthorizationRule operation along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - checkNameAvailabilityWithResponseAsync(CheckNameAvailability parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> getAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Check the specified namespace name availability. - * - * @param parameters Parameters to check availability of the specified namespace name. - * @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 description of the check name availability request properties along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - checkNameAvailabilityWithResponseAsync(CheckNameAvailability parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); - } - - /** - * Check the specified namespace name availability. + * Authorization rule for a namespace by name. * - * @param parameters Parameters to check availability of the specified namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the check name availability request properties on successful completion of {@link Mono}. + * @return single item in a List or Get AuthorizationRule operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync(CheckNameAvailability parameters) { - return checkNameAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Check the specified namespace name availability. + * Authorization rule for a namespace by name. * - * @param parameters Parameters to check availability of the specified namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @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 description of the check name availability request properties along with {@link Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response - checkNameAvailabilityWithResponse(CheckNameAvailability parameters, Context context) { - return checkNameAvailabilityWithResponseAsync(parameters, context).block(); + public Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String authorizationRuleName, Context context) { + final String accept = "application/json"; + return service.getAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, accept, context); } /** - * Check the specified namespace name availability. + * Authorization rule for a namespace by name. * - * @param parameters Parameters to check availability of the specified namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the check name availability request properties. + * @return single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters) { - return checkNameAvailabilityWithResponse(parameters, Context.NONE).getValue(); + public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); } /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Creates or updates an authorization rule for a namespace. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 response from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, + AuthorizationRuleInner parameters) { + final String contentType = "application/json"; 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)) + .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + authorizationRuleName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Creates or updates an authorization rule for a namespace. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 response from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return single item in a List or Get AuthorizationRule operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); - } - - /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. - * - * @throws 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 from the list namespace operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + private Mono createOrUpdateAuthorizationRuleAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName, AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Creates or updates an authorization rule for a namespace. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 response from the list namespace operation as paginated response with {@link PagedFlux}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. - * - * @throws 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 from the list namespace operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String authorizationRuleName, AuthorizationRuleInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, contentType, + accept, parameters, context); } /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Creates or updates an authorization rule for a namespace. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 response from the list namespace operation as paginated response with {@link PagedIterable}. + * @return single item in a List or Get AuthorizationRule operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName, AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, + parameters, Context.NONE).getValue(); } /** - * Lists all the available namespaces within the ResourceGroup. + * Deletes a namespace authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; + private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName) { return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - 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)) + .withContext( + context -> service.deleteAuthorizationRule(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the available namespaces within the ResourceGroup. + * Deletes a namespace authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, 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)); - } - - /** - * Lists all the available namespaces within the ResourceGroup. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 from the list namespace operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the available namespaces within the ResourceGroup. - * - * @param resourceGroupName Name of the Resource group within the Azure 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 from the list namespace operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(ignored -> Mono.empty()); } /** - * Lists all the available namespaces within the ResourceGroup. + * Deletes a namespace authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + return service.deleteAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, context); } /** - * Lists all the available namespaces within the ResourceGroup. + * Deletes a namespace authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE); } /** - * Create Azure Relay namespace. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String namespaceName, RelayNamespaceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> listAuthorizationRulesSinglePageAsync(String resourceGroupName, + String namespaceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, namespaceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext( + context -> service.listAuthorizationRules(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, 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())); } /** - * Create Azure Relay namespace. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String namespaceName, RelayNamespaceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, namespaceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + String namespaceName) { + return new PagedFlux<>(() -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); } /** - * Create Azure Relay namespace. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of description of a namespace resource. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RelayNamespaceInner> - beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - RelayNamespaceInner.class, RelayNamespaceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAuthorizationRulesSinglePage(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + Response res + = service.listAuthorizationRulesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create Azure Relay namespace. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of description of a namespace resource. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RelayNamespaceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - RelayNamespaceInner.class, RelayNamespaceInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAuthorizationRulesSinglePage(String resourceGroupName, + String namespaceName, Context context) { + final String accept = "application/json"; + Response res + = service.listAuthorizationRulesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create Azure Relay namespace. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of description of a namespace resource. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RelayNamespaceInner> - beginCreateOrUpdate(String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName) { + return new PagedIterable<>(() -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink)); } /** - * Create Azure Relay namespace. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of description of a namespace resource. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( - String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, + Context context) { + return new PagedIterable<>(() -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName, context), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink, context)); } /** - * Create Azure Relay namespace. + * Primary and secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource on successful completion of {@link Mono}. + * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, - RelayNamespaceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> listKeysWithResponseAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create Azure Relay namespace. + * Primary and secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. - * @param context The context to associate with this operation. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource on successful completion of {@link Mono}. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, - RelayNamespaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono listKeysAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create Azure Relay namespace. + * Primary and secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. + * @param authorizationRuleName The authorization rule name. + * @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 description of a namespace resource. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelayNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, - RelayNamespaceInner parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, parameters).block(); + public Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + final String accept = "application/json"; + return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, accept, context); } /** - * Create Azure Relay namespace. + * Primary and secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a namespace resource. - * @param context The context to associate with this operation. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource. + * @return namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelayNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, - RelayNamespaceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).block(); + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE).getValue(); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Regenerates the primary or secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, contentType, + accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Regenerates the primary or secondary connection strings to the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerates the primary or secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 Response} on successful completion of {@link Mono}. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String namespaceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.regenerateKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, contentType, + accept, parameters, context); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Regenerates the primary or secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return namespace/Relay Connection String. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String namespaceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, namespaceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, + Context.NONE).getValue(); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Returns the description for the specified namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @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 PollerFlux} for polling of long-running operation. + * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String namespaceName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, namespaceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Returns the description for the specified namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return description of a namespace resource on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName) { - return this.beginDeleteAsync(resourceGroupName, namespaceName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Returns the description for the specified namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @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. + * @return description of a namespace resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, namespaceName, context).getSyncPoller(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Returns the description for the specified namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return description of a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName) { - return beginDeleteAsync(resourceGroupName, namespaceName).last().flatMap(this.client::getLroFinalResultOrError); + public RelayNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String namespaceName, RelayNamespaceInner parameters) { + 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, namespaceName, contentType, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName) { - deleteAsync(resourceGroupName, namespaceName).block(); + private Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, + RelayNamespaceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + Context.NONE); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a namespace resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, Context context) { - deleteAsync(resourceGroupName, namespaceName, context).block(); + private Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, + RelayNamespaceInner parameters, 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, namespaceName, contentType, accept, parameters, + context); } /** - * Returns the description for the specified namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of description of a namespace resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - namespaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RelayNamespaceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RelayNamespaceInner.class, RelayNamespaceInner.class, this.client.getContext()); } /** - * Returns the description for the specified namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of description of a namespace resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, namespaceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RelayNamespaceInner> + beginCreateOrUpdate(String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { + Response response = createOrUpdateWithResponse(resourceGroupName, namespaceName, parameters); + return this.client.getLroResult(response, RelayNamespaceInner.class, + RelayNamespaceInner.class, Context.NONE); } /** - * Returns the description for the specified namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of description of a namespace resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, namespaceName, parameters, context); + return this.client.getLroResult(response, RelayNamespaceInner.class, + RelayNamespaceInner.class, context); } /** - * Returns the description for the specified namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource along with {@link Response}. + * @return description of a namespace resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); + private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, + RelayNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Returns the description for the specified namespace. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param parameters Parameters supplied to create a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return description of a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelayNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); + public RelayNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, + RelayNamespaceInner parameters) { + return beginCreateOrUpdate(resourceGroupName, namespaceName, parameters).getFinalResult(); } /** - * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is - * idempotent. + * Create Azure Relay namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param parameters Parameters for updating a namespace resource. + * @param parameters Parameters supplied to create a namespace resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. + * @return description of a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String namespaceName, - RelayUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, namespaceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public RelayNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, + RelayNamespaceInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, context).getFinalResult(); } /** * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is * idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param parameters Parameters for updating a namespace resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1180,38 +1183,21 @@ private Mono> updateWithResponseAsync(String resou */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String namespaceName, - RelayUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + RelayUpdateParameters parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, namespaceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is * idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param parameters Parameters for updating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1230,7 +1216,7 @@ private Mono updateAsync(String resourceGroupName, String n * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is * idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param parameters Parameters for updating a namespace resource. * @param context The context to associate with this operation. @@ -1242,14 +1228,18 @@ private Mono updateAsync(String resourceGroupName, String n @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String namespaceName, RelayUpdateParameters parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + context); } /** * Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is * idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param parameters Parameters for updating a namespace resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1264,859 +1254,585 @@ public RelayNamespaceInner update(String resourceGroupName, String namespaceName } /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync(String resourceGroupName, - String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; + private Mono>> deleteWithResponseAsync(String resourceGroupName, String namespaceName) { return FluxUtil - .withContext(context -> service.listAuthorizationRules(this.client.getEndpoint(), resourceGroupName, - namespaceName, 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync(String resourceGroupName, - String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAuthorizationRules(this.client.getEndpoint(), resourceGroupName, namespaceName, - 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)); + private Response deleteWithResponse(String resourceGroupName, String namespaceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, Context.NONE); } /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @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 from the list namespace operation as paginated response with {@link PagedFlux}. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, - String namespaceName) { - return new PagedFlux<>(() -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String namespaceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, context); } /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @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 from the list namespace operation as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, - String namespaceName, Context context) { - return new PagedFlux<>(() -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String namespaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, namespaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules(String resourceGroupName, - String namespaceName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName) { + Response response = deleteWithResponse(resourceGroupName, namespaceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, Context context) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, context)); + Response response = deleteWithResponse(resourceGroupName, namespaceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Creates or updates an authorization rule for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, - AuthorizationRuleInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), - resourceGroupName, namespaceName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono deleteAsync(String resourceGroupName, String namespaceName) { + return beginDeleteAsync(resourceGroupName, namespaceName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates an authorization rule for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 namespaceName) { + beginDelete(resourceGroupName, namespaceName).getFinalResult(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, AuthorizationRuleInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + public void delete(String resourceGroupName, String namespaceName, Context context) { + beginDelete(resourceGroupName, namespaceName, context).getFinalResult(); + } + + /** + * Lists all the available namespaces within the ResourceGroup. + * + * @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 RelayNamespace 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"; - context = this.client.mergeContext(context); - return service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context); + 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())); } /** - * Creates or updates an authorization rule for a namespace. + * Lists all the available namespaces within the ResourceGroup. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. + * @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 RelayNamespace 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)); + } + + /** + * Lists all the available namespaces within the ResourceGroup. + * + * @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 description of a namespace authorization rule on successful completion of {@link Mono}. + * @return the response of a RelayNamespace list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAuthorizationRuleAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName, AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, - parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + 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); } /** - * Creates or updates an authorization rule for a namespace. + * Lists all the available namespaces within the ResourceGroup. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. + * @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 description of a namespace authorization rule along with {@link Response}. + * @return the response of a RelayNamespace list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String authorizationRuleName, AuthorizationRuleInner parameters, Context context) { - return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, - parameters, context).block(); + 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); } /** - * Creates or updates an authorization rule for a namespace. + * Lists all the available namespaces within the ResourceGroup. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. + * @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 description of a namespace authorization rule. + * @return the response of a RelayNamespace list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, - String authorizationRuleName, AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, - parameters, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Lists all the available namespaces within the ResourceGroup. + * + * @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 RelayNamespace 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)); } /** - * Deletes a namespace authorization rule. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return the response of a RelayNamespace list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> listSinglePageAsync() { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAuthorizationRule(this.client.getEndpoint(), resourceGroupName, - namespaceName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - accept, context)) + .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())); } /** - * Deletes a namespace authorization rule. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @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 Response} on successful completion of {@link Mono}. + * @return the response of a RelayNamespace list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Deletes a namespace authorization rule. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return the response of a RelayNamespace list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap(ignored -> Mono.empty()); + 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); } /** - * Deletes a namespace authorization rule. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. * @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 Response}. + * @return the response of a RelayNamespace list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, - context).block(); + 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); } /** - * Deletes a namespace authorization rule. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 RelayNamespace list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Authorization rule for a namespace by name. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @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 description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a RelayNamespace list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), resourceGroupName, - namespaceName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** - * Authorization rule for a namespace by name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @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 description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return networkRuleSet for a Namespace along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> getNetworkRuleSetWithResponseAsync(String resourceGroupName, + String namespaceName) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return FluxUtil + .withContext(context -> service.getNetworkRuleSet(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Authorization rule for a namespace by name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace authorization rule on successful completion of {@link Mono}. + * @return networkRuleSet for a Namespace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + private Mono getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Authorization rule for a namespace by name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. * @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 description of a namespace authorization rule along with {@link Response}. + * @return networkRuleSet for a Namespace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String authorizationRuleName, Context context) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context) - .block(); + public Response getNetworkRuleSetWithResponse(String resourceGroupName, String namespaceName, + Context context) { + final String accept = "application/json"; + return service.getNetworkRuleSetSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context); } /** - * Authorization rule for a namespace by name. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace authorization rule. + * @return networkRuleSet for a Namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) - .getValue(); + public NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); } /** - * Primary and secondary connection strings to the namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return description of topic resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> createOrUpdateNetworkRuleSetWithResponseAsync(String resourceGroupName, + String namespaceName, NetworkRuleSetInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.createOrUpdateNetworkRuleSet(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Primary and secondary connection strings to the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @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 namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, authorizationRuleName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Primary and secondary connection strings to the namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String on successful completion of {@link Mono}. + * @return description of topic resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + private Mono createOrUpdateNetworkRuleSetAsync(String resourceGroupName, String namespaceName, + NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Primary and secondary connection strings to the namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @param parameters The Namespace IpFilterRule. * @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 namespace/Relay Connection String along with {@link Response}. + * @return description of topic resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context).block(); + public Response createOrUpdateNetworkRuleSetWithResponse(String resourceGroupName, + String namespaceName, NetworkRuleSetInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateNetworkRuleSetSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + context); } /** - * Primary and secondary connection strings to the namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @param parameters The Namespace IpFilterRule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String. + * @return description of topic resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE).getValue(); + public NetworkRuleSetInner createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, + NetworkRuleSetInner parameters) { + return createOrUpdateNetworkRuleSetWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE) + .getValue(); } /** - * Regenerates the primary or secondary connection strings to the namespace. + * Check the specified namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return description of the check name availability request properties along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailability parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context)) + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Regenerates the primary or secondary connection strings to the namespace. + * Check the specified namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @param context The context to associate with this operation. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return description of the check name availability request properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerateKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context); + private Mono checkNameAvailabilityAsync(CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Regenerates the primary or secondary connection strings to the namespace. + * Check the specified namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @param parameters The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String on successful completion of {@link Mono}. + * @return description of the check name availability request properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response + checkNameAvailabilityWithResponse(CheckNameAvailability parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, parameters, context); } /** - * Regenerates the primary or secondary connection strings to the namespace. + * Check the specified namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @param context The context to associate with this operation. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String along with {@link Response}. + * @return description of the check name availability request properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context) { - return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters, - context).block(); + public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponse(parameters, Context.NONE).getValue(); } /** - * Regenerates the primary or secondary connection strings to the namespace. + * Get the next page of items. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @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 namespace/Relay Connection String. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, - Context.NONE).getValue(); + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAuthorizationRulesNext(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())); } /** @@ -2126,23 +1842,15 @@ public AccessKeysInner regenerateKeys(String resourceGroupName, String namespace * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listAuthorizationRulesNextSinglePage(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())); + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2153,23 +1861,16 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listAuthorizationRulesNextSinglePage(String nextLink, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2179,18 +1880,11 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion + * @return the response of a RelayNamespace list operation along with {@link PagedResponse} on successful completion * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -2200,6 +1894,24 @@ private Mono> listByResourceGroupNextSinglePa .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 RelayNamespace 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. * @@ -2208,24 +1920,15 @@ private Mono> listByResourceGroupNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a RelayNamespace list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + 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); } /** @@ -2235,27 +1938,36 @@ private Mono> listByResourceGroupNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion + * @return the response of a RelayNamespace list operation along with {@link PagedResponse} on successful completion * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listNextSinglePageAsync(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + 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 the response of a RelayNamespace list operation 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. * @@ -2264,23 +1976,14 @@ private Mono> listAuthorizationRulesNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a RelayNamespace list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + 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/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesImpl.java index 63f81fadf8c4..33ad69ce932e 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; @@ -13,12 +13,14 @@ import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; import com.azure.resourcemanager.relay.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner; import com.azure.resourcemanager.relay.models.AccessKeys; import com.azure.resourcemanager.relay.models.AuthorizationRule; import com.azure.resourcemanager.relay.models.CheckNameAvailability; import com.azure.resourcemanager.relay.models.CheckNameAvailabilityResult; import com.azure.resourcemanager.relay.models.Namespaces; +import com.azure.resourcemanager.relay.models.NetworkRuleSet; import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; import com.azure.resourcemanager.relay.models.RelayNamespace; @@ -34,67 +36,92 @@ public NamespacesImpl(NamespacesClient innerClient, com.azure.resourcemanager.re this.serviceManager = serviceManager; } - public Response checkNameAvailabilityWithResponse(CheckNameAvailability parameters, - Context context) { - Response inner - = this.serviceClient().checkNameAvailabilityWithResponse(parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + Response inner = this.serviceClient() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AuthorizationRuleImpl(inner.getValue(), this.manager())); } - public CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters) { - CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(parameters); + public AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + AuthorizationRuleInner inner + = this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); if (inner != null) { - return new CheckNameAvailabilityResultImpl(inner, this.manager()); + return new AuthorizationRuleImpl(inner, this.manager()); } else { return null; } } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + return this.serviceClient() + .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName) { + PagedIterable inner + = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, + Context context) { + PagedIterable inner + = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } - public void deleteByResourceGroup(String resourceGroupName, String namespaceName) { - this.serviceClient().delete(resourceGroupName, namespaceName); + public Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + Response inner = this.serviceClient() + .listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); } - public void delete(String resourceGroupName, String namespaceName, Context context) { - this.serviceClient().delete(resourceGroupName, namespaceName, context); + public AccessKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + AccessKeysInner inner = this.serviceClient().listKeys(resourceGroupName, namespaceName, authorizationRuleName); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); + } else { + return null; + } } - public Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); + public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context) { + Response inner = this.serviceClient() + .regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); + } + + public AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + AccessKeysInner inner + = this.serviceClient().regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RelayNamespaceImpl(inner.getValue(), this.manager())); + return new AccessKeysImpl(inner, this.manager()); } else { return null; } } + public Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RelayNamespaceImpl(inner.getValue(), this.manager())); + } + public RelayNamespace getByResourceGroup(String resourceGroupName, String namespaceName) { RelayNamespaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); if (inner != null) { @@ -104,122 +131,85 @@ public RelayNamespace getByResourceGroup(String resourceGroupName, String namesp } } - public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName) { - PagedIterable inner - = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + public void deleteByResourceGroup(String resourceGroupName, String namespaceName) { + this.serviceClient().delete(resourceGroupName, namespaceName); } - public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, - Context context) { - PagedIterable inner - = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + public void delete(String resourceGroupName, String namespaceName, Context context) { + this.serviceClient().delete(resourceGroupName, namespaceName, context); } - public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - return this.serviceClient() - .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); } - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); } - public Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - Response inner = this.serviceClient() - .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AuthorizationRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); } - public AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - AuthorizationRuleInner inner - = this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); - if (inner != null) { - return new AuthorizationRuleImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); } - public Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - Response inner = this.serviceClient() - .listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccessKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getNetworkRuleSetWithResponse(String resourceGroupName, String namespaceName, + Context context) { + Response inner + = this.serviceClient().getNetworkRuleSetWithResponse(resourceGroupName, namespaceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkRuleSetImpl(inner.getValue(), this.manager())); } - public AccessKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { - AccessKeysInner inner = this.serviceClient().listKeys(resourceGroupName, namespaceName, authorizationRuleName); + public NetworkRuleSet getNetworkRuleSet(String resourceGroupName, String namespaceName) { + NetworkRuleSetInner inner = this.serviceClient().getNetworkRuleSet(resourceGroupName, namespaceName); if (inner != null) { - return new AccessKeysImpl(inner, this.manager()); + return new NetworkRuleSetImpl(inner, this.manager()); } else { return null; } } - public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context) { - Response inner = this.serviceClient() - .regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccessKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response createOrUpdateNetworkRuleSetWithResponse(String resourceGroupName, + String namespaceName, NetworkRuleSetInner parameters, Context context) { + Response inner = this.serviceClient() + .createOrUpdateNetworkRuleSetWithResponse(resourceGroupName, namespaceName, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkRuleSetImpl(inner.getValue(), this.manager())); } - public AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - AccessKeysInner inner - = this.serviceClient().regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); + public NetworkRuleSet createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, + NetworkRuleSetInner parameters) { + NetworkRuleSetInner inner + = this.serviceClient().createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, parameters); if (inner != null) { - return new AccessKeysImpl(inner, this.manager()); + return new NetworkRuleSetImpl(inner, this.manager()); } else { return null; } } - public RelayNamespace 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 namespaceName = ResourceManagerUtils.getValueFromIdByName(id, "namespaces"); - if (namespaceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); + public Response checkNameAvailabilityWithResponse(CheckNameAvailability parameters, + Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); } - 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 namespaceName = ResourceManagerUtils.getValueFromIdByName(id, "namespaces"); - if (namespaceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + public CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; } - return this.getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); } public AuthorizationRule getAuthorizationRuleById(String id) { @@ -262,7 +252,7 @@ public Response getAuthorizationRuleByIdWithResponse(String i return this.getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); } - public void deleteById(String id) { + public RelayNamespace getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -273,10 +263,10 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - this.delete(resourceGroupName, namespaceName, Context.NONE); + return this.getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); } - public void deleteByIdWithResponse(String id, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -287,7 +277,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - this.delete(resourceGroupName, namespaceName, context); + return this.getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); } public void deleteAuthorizationRuleById(String id) { @@ -329,6 +319,34 @@ public Response deleteAuthorizationRuleByIdWithResponse(String id, Context 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 namespaceName = ResourceManagerUtils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + this.delete(resourceGroupName, namespaceName, 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 namespaceName = ResourceManagerUtils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + this.delete(resourceGroupName, namespaceName, context); + } + private NamespacesClient serviceClient() { return this.innerClient; } @@ -337,11 +355,11 @@ private com.azure.resourcemanager.relay.RelayManager manager() { return this.serviceManager; } - public RelayNamespaceImpl define(String name) { - return new RelayNamespaceImpl(name, this.manager()); - } - public AuthorizationRuleImpl defineAuthorizationRule(String name) { return new AuthorizationRuleImpl(name, this.manager()); } + + public RelayNamespaceImpl define(String name) { + return new RelayNamespaceImpl(name, this.manager()); + } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NetworkRuleSetImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NetworkRuleSetImpl.java new file mode 100644 index 000000000000..20a8f9277489 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NetworkRuleSetImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.NetworkRuleSet; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import java.util.Collections; +import java.util.List; + +public final class NetworkRuleSetImpl implements NetworkRuleSet { + private NetworkRuleSetInner innerObject; + + private final com.azure.resourcemanager.relay.RelayManager serviceManager; + + NetworkRuleSetImpl(NetworkRuleSetInner innerObject, com.azure.resourcemanager.relay.RelayManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public Boolean trustedServiceAccessEnabled() { + return this.innerModel().trustedServiceAccessEnabled(); + } + + public DefaultAction defaultAction() { + return this.innerModel().defaultAction(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public List ipRules() { + List inner = this.innerModel().ipRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkRuleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.relay.RelayManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationImpl.java index b7835ab36aac..852910c20eba 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationImpl.java @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; import com.azure.resourcemanager.relay.fluent.models.OperationInner; +import com.azure.resourcemanager.relay.models.ActionType; import com.azure.resourcemanager.relay.models.Operation; import com.azure.resourcemanager.relay.models.OperationDisplay; +import com.azure.resourcemanager.relay.models.Origin; public final class OperationImpl implements Operation { private OperationInner innerObject; @@ -22,10 +24,22 @@ 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; } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsClientImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsClientImpl.java index f3fbffd165e1..3f92536b6d6a 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsClientImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.relay.fluent.OperationsClient; import com.azure.resourcemanager.relay.fluent.models.OperationInner; -import com.azure.resourcemanager.relay.models.OperationListResult; +import com.azure.resourcemanager.relay.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -42,31 +42,38 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final RelayApiImpl client; + private final RelayManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(RelayApiImpl client) { + OperationsClientImpl(RelayManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for RelayApiOperations to be used by the proxy service to perform REST - * calls. + * The interface defining all the services for RelayManagementClientOperations to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RelayApiOperations") + @Host("{endpoint}") + @ServiceInterface(name = "RelayManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Relay/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + 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.Relay/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" }) @@ -74,23 +81,26 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @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); } /** - * Lists all available Relay REST API operations. + * 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 result of the request to list Relay operations along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @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() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -101,79 +111,78 @@ private Mono> listSinglePageAsync() { } /** - * Lists all available Relay REST API operations. + * 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 result of the request to list Relay operations along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all available Relay REST API operations. + * 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 result of the request to list Relay operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @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); } /** - * Lists all available Relay REST API operations. + * 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 result of the request to list Relay operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @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); } /** - * Lists all available Relay REST API operations. + * 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 result of the request to list Relay operations as paginated response with {@link PagedIterable}. + * @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<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Lists all available Relay REST API operations. + * 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 result of the request to list Relay operations as paginated response with {@link PagedIterable}. + * @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<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -183,18 +192,11 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @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) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } 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(), @@ -202,6 +204,24 @@ private Mono> listNextSinglePageAsync(String nextL .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. * @@ -210,22 +230,13 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + 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/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsImpl.java index d274da587bff..9317f196961f 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..e65abeca4ed4 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionImpl.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.relay.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PrivateEndpointConnection; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.relay.RelayManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public ConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public EndPointProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.relay.RelayManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String namespaceName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingNamespace(String resourceGroupName, String namespaceName) { + this.resourceGroupName = resourceGroupName; + this.namespaceName = namespaceName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, + this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.relay.RelayManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdateWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, + this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.relay.RelayManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl + withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + public PrivateEndpointConnectionImpl withProvisioningState(EndPointProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..8cf30cbfa5ae --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,673 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.relay.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.relay.implementation.models.PrivateEndpointConnectionListResult; +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 PrivateEndpointConnectionsClient. + */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateEndpointConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final RelayManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(RelayManagementClientImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RelayManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RelayManagementClientPrivateEndpointConnections") + public interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @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("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @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("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 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("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 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("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @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); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 description for the specified Private Endpoint Connection name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String namespaceName, String privateEndpointConnectionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 description for the specified Private Endpoint Connection name on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 description for the specified Private Endpoint Connection name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, privateEndpointConnectionName, accept, context); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 description for the specified Private Endpoint Connection name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String namespaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + 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, namespaceName, privateEndpointConnectionName, + contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String namespaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, + 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, namespaceName, privateEndpointConnectionName, + contentType, accept, parameters, context); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @param parameters Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the PrivateEndpointConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, + Context.NONE).getValue(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 namespaceName, + String privateEndpointConnectionName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 namespaceName, + String privateEndpointConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, + Context.NONE); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 namespaceName, + String privateEndpointConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, context); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 namespaceName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 namespaceName, + String privateEndpointConnectionName) { + Response response + = deleteWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 namespaceName, + String privateEndpointConnectionName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 namespaceName, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 namespaceName, String privateEndpointConnectionName) { + beginDelete(resourceGroupName, namespaceName, privateEndpointConnectionName).getFinalResult(); + } + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 namespaceName, String privateEndpointConnectionName, + Context context) { + beginDelete(resourceGroupName, namespaceName, privateEndpointConnectionName, context).getFinalResult(); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available PrivateEndpointConnections within a namespace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, 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())); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available PrivateEndpointConnections within a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available PrivateEndpointConnections within a namespace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 available PrivateEndpointConnections within a namespace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String namespaceName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 available PrivateEndpointConnections within a namespace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, namespaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 available PrivateEndpointConnections within a namespace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, namespaceName, 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 the available PrivateEndpointConnections within a namespace 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 the available PrivateEndpointConnections within a namespace 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 the available PrivateEndpointConnections within a namespace 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/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..409538c82c66 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.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.relay.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.relay.models.PrivateEndpointConnection; +import com.azure.resourcemanager.relay.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.relay.RelayManager serviceManager; + + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.relay.RelayManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } + + public PrivateEndpointConnection get(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, namespaceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, namespaceName, privateEndpointConnectionName); + } + + public void delete(String resourceGroupName, String namespaceName, String privateEndpointConnectionName, + Context context) { + this.serviceClient().delete(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + } + + public PagedIterable list(String resourceGroupName, String namespaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, namespaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String namespaceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, namespaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection 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 namespaceName = ResourceManagerUtils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, 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 namespaceName = ResourceManagerUtils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, 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 namespaceName = ResourceManagerUtils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.delete(resourceGroupName, namespaceName, privateEndpointConnectionName, 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 namespaceName = ResourceManagerUtils.getValueFromIdByName(id, "namespaces"); + if (namespaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.delete(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.relay.RelayManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourceImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..c6c6a66adbb4 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.relay.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.relay.RelayManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.relay.RelayManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.relay.RelayManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesClientImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..6128b1618025 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.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.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.relay.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourcesListResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final RelayManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(RelayManagementClientImpl client) { + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RelayManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RelayManagementClientPrivateLinkResources") + public interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateLinkResources/{privateLinkResourceName}") + @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("namespaceName") String namespaceName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateLinkResources/{privateLinkResourceName}") + @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("namespaceName") String namespaceName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String namespaceName, String privateLinkResourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateLinkResourceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, + String privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, namespaceName, privateLinkResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String namespaceName, + String privateLinkResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, privateLinkResourceName, accept, context); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String namespaceName, + String privateLinkResourceName) { + return getWithResponse(resourceGroupName, namespaceName, privateLinkResourceName, Context.NONE).getValue(); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List private link resources operation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List private link resources operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String namespaceName) { + return listWithResponseAsync(resourceGroupName, namespaceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 result of the List private link resources operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String namespaceName, Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, accept, context); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List private link resources operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourcesListResultInner list(String resourceGroupName, String namespaceName) { + return listWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..f2e68c754e17 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesImpl.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.relay.implementation; + +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.relay.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.relay.models.PrivateLinkResource; +import com.azure.resourcemanager.relay.models.PrivateLinkResources; +import com.azure.resourcemanager.relay.models.PrivateLinkResourcesListResult; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.relay.RelayManager serviceManager; + + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.relay.RelayManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String namespaceName, + String privateLinkResourceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, namespaceName, privateLinkResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String namespaceName, String privateLinkResourceName) { + PrivateLinkResourceInner inner + = this.serviceClient().get(resourceGroupName, namespaceName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String resourceGroupName, String namespaceName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, namespaceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourcesListResultImpl(inner.getValue(), this.manager())); + } + + public PrivateLinkResourcesListResult list(String resourceGroupName, String namespaceName) { + PrivateLinkResourcesListResultInner inner = this.serviceClient().list(resourceGroupName, namespaceName); + if (inner != null) { + return new PrivateLinkResourcesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.relay.RelayManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesListResultImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesListResultImpl.java new file mode 100644 index 000000000000..0abc7ecb4f21 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesListResultImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.implementation; + +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.relay.models.PrivateLinkResource; +import com.azure.resourcemanager.relay.models.PrivateLinkResourcesListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateLinkResourcesListResultImpl implements PrivateLinkResourcesListResult { + private PrivateLinkResourcesListResultInner innerObject; + + private final com.azure.resourcemanager.relay.RelayManager serviceManager; + + PrivateLinkResourcesListResultImpl(PrivateLinkResourcesListResultInner innerObject, + com.azure.resourcemanager.relay.RelayManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public PrivateLinkResourcesListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.relay.RelayManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayApiBuilder.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayManagementClientBuilder.java similarity index 64% rename from sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayApiBuilder.java rename to sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayManagementClientBuilder.java index dc8ff964d0f8..f14ac24f9b28 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayApiBuilder.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; @@ -15,41 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the RelayApiImpl type. + * A builder for creating a new instance of the RelayManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { RelayApiImpl.class }) -public final class RelayApiBuilder { +@ServiceClientBuilder(serviceClients = { RelayManagementClientImpl.class }) +public final class RelayManagementClientBuilder { /* - * Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part - * of the URI for every service call. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the RelayApiBuilder. + * @param endpoint the endpoint value. + * @return the RelayManagementClientBuilder. */ - public RelayApiBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public RelayManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the RelayApiBuilder. + * @param subscriptionId the subscriptionId value. + * @return the RelayManagementClientBuilder. */ - public RelayApiBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public RelayManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -62,9 +60,9 @@ public RelayApiBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the RelayApiBuilder. + * @return the RelayManagementClientBuilder. */ - public RelayApiBuilder environment(AzureEnvironment environment) { + public RelayManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -78,9 +76,9 @@ public RelayApiBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the RelayApiBuilder. + * @return the RelayManagementClientBuilder. */ - public RelayApiBuilder pipeline(HttpPipeline pipeline) { + public RelayManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -94,9 +92,9 @@ public RelayApiBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the RelayApiBuilder. + * @return the RelayManagementClientBuilder. */ - public RelayApiBuilder defaultPollInterval(Duration defaultPollInterval) { + public RelayManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -110,19 +108,19 @@ public RelayApiBuilder defaultPollInterval(Duration defaultPollInterval) { * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the RelayApiBuilder. + * @return the RelayManagementClientBuilder. */ - public RelayApiBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public RelayManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of RelayApiImpl with the provided parameters. + * Builds an instance of RelayManagementClientImpl with the provided parameters. * - * @return an instance of RelayApiImpl. + * @return an instance of RelayManagementClientImpl. */ - public RelayApiImpl buildClient() { + public RelayManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -133,8 +131,8 @@ public RelayApiImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - RelayApiImpl client = new RelayApiImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, - localEnvironment, this.subscriptionId, localEndpoint); + RelayManagementClientImpl client = new RelayManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayApiImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayManagementClientImpl.java similarity index 75% rename from sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayApiImpl.java rename to sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayManagementClientImpl.java index df3ee65d8ebf..a2195d25d499 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayApiImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; @@ -15,18 +15,23 @@ 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.relay.fluent.HybridConnectionsClient; import com.azure.resourcemanager.relay.fluent.NamespacesClient; import com.azure.resourcemanager.relay.fluent.OperationsClient; -import com.azure.resourcemanager.relay.fluent.RelayApi; +import com.azure.resourcemanager.relay.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.relay.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.relay.fluent.RelayManagementClient; import com.azure.resourcemanager.relay.fluent.WcfRelaysClient; import java.io.IOException; import java.lang.reflect.Type; @@ -38,33 +43,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the RelayApiImpl type. + * Initializes a new instance of the RelayManagementClientImpl type. */ -@ServiceClient(builder = RelayApiBuilder.class) -public final class RelayApiImpl implements RelayApi { +@ServiceClient(builder = RelayManagementClientBuilder.class) +public final class RelayManagementClientImpl implements RelayManagementClient { /** - * Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part - * of the URI for every service call. - */ - private final String subscriptionId; - - /** - * Gets Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -73,12 +62,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -86,6 +75,20 @@ 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. */ @@ -142,20 +145,6 @@ public OperationsClient getOperations() { return this.operations; } - /** - * The NamespacesClient object to access its operations. - */ - private final NamespacesClient namespaces; - - /** - * Gets the NamespacesClient object to access its operations. - * - * @return the NamespacesClient object. - */ - public NamespacesClient getNamespaces() { - return this.namespaces; - } - /** * The HybridConnectionsClient object to access its operations. */ @@ -185,28 +174,71 @@ public WcfRelaysClient getWcfRelays() { } /** - * Initializes an instance of RelayApi client. + * The PrivateEndpointConnectionsClient object to access its operations. + */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesClient object to access its operations. + */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** + * The NamespacesClient object to access its operations. + */ + private final NamespacesClient namespaces; + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + public NamespacesClient getNamespaces() { + return this.namespaces; + } + + /** + * Initializes an instance of RelayManagementClient 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 subscriptionId Subscription credentials which uniquely identify the Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ - RelayApiImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId, String endpoint) { + RelayManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2017-04-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-01-01"; this.operations = new OperationsClientImpl(this); - this.namespaces = new NamespacesClientImpl(this); this.hybridConnections = new HybridConnectionsClientImpl(this); this.wcfRelays = new WcfRelaysClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.namespaces = new NamespacesClientImpl(this); } /** @@ -246,6 +278,23 @@ public PollerFlux, U> getLroResult(Mono 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. * @@ -303,7 +352,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { @@ -335,5 +384,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(RelayApiImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RelayManagementClientImpl.class); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayNamespaceImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayNamespaceImpl.java index 829eb2f50b0b..16929adfdb7f 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayNamespaceImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayNamespaceImpl.java @@ -1,19 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner; -import com.azure.resourcemanager.relay.models.ProvisioningStateEnum; +import com.azure.resourcemanager.relay.models.PrivateEndpointConnection; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.azure.resourcemanager.relay.models.RelayNamespace; import com.azure.resourcemanager.relay.models.RelayUpdateParameters; import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class RelayNamespaceImpl implements RelayNamespace, RelayNamespace.Definition, RelayNamespace.Update { private RelayNamespaceInner innerObject; @@ -49,10 +55,18 @@ public Sku sku() { return this.innerModel().sku(); } - public ProvisioningStateEnum provisioningState() { + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { return this.innerModel().provisioningState(); } + public String status() { + return this.innerModel().status(); + } + public OffsetDateTime createdAt() { return this.innerModel().createdAt(); } @@ -69,6 +83,25 @@ public String metricId() { return this.innerModel().metricId(); } + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public TlsVersion minimumTlsVersion() { + return this.innerModel().minimumTlsVersion(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -194,7 +227,38 @@ public RelayNamespaceImpl withSku(Sku sku) { } } + public RelayNamespaceImpl + withPrivateEndpointConnections(List privateEndpointConnections) { + if (isInCreateMode()) { + this.innerModel().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } else { + this.updateParameters.withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + } + + public RelayNamespaceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public RelayNamespaceImpl withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + if (isInCreateMode()) { + this.innerModel().withMinimumTlsVersion(minimumTlsVersion); + return this; + } else { + this.updateParameters.withMinimumTlsVersion(minimumTlsVersion); + return this; + } + } + private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/ResourceManagerUtils.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/ResourceManagerUtils.java index 184a9695d10f..c83f7acbf128 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/ResourceManagerUtils.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelayImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelayImpl.java index 4e76c6454486..0dccd96e7b44 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelayImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelayImpl.java @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.relay.fluent.models.WcfRelayInner; import com.azure.resourcemanager.relay.models.Relaytype; @@ -27,6 +29,14 @@ public String type() { return this.innerModel().type(); } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public Boolean isDynamic() { return this.innerModel().isDynamic(); } @@ -59,6 +69,14 @@ public String userMetadata() { return this.innerModel().userMetadata(); } + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + public String resourceGroupName() { return resourceGroupName; } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysClientImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysClientImpl.java index 61a965619c42..8d890aa1aacc 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysClientImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; @@ -33,9 +33,9 @@ import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; import com.azure.resourcemanager.relay.fluent.models.WcfRelayInner; -import com.azure.resourcemanager.relay.models.AuthorizationRuleListResult; +import com.azure.resourcemanager.relay.implementation.models.AuthorizationRuleListResult; +import com.azure.resourcemanager.relay.implementation.models.WcfRelaysListResult; import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; -import com.azure.resourcemanager.relay.models.WcfRelaysListResult; import reactor.core.publisher.Mono; /** @@ -50,130 +50,216 @@ public final class WcfRelaysClientImpl implements WcfRelaysClient { /** * The service client containing this operation class. */ - private final RelayApiImpl client; + private final RelayManagementClientImpl client; /** * Initializes an instance of WcfRelaysClientImpl. * * @param client the instance of the service client containing this operation class. */ - WcfRelaysClientImpl(RelayApiImpl client) { + WcfRelaysClientImpl(RelayManagementClientImpl client) { this.service = RestProxy.create(WcfRelaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for RelayApiWcfRelays to be used by the proxy service to perform REST - * calls. + * The interface defining all the services for RelayManagementClientWcfRelays to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "RelayApiWcfRelays") + @Host("{endpoint}") + @ServiceInterface(name = "RelayManagementClientWcfRelays") public interface WcfRelaysService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespace(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + Mono> getAuthorizationRule(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Response getAuthorizationRuleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") WcfRelayInner parameters, + @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AuthorizationRuleInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateAuthorizationRuleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AuthorizationRuleInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, + Mono> deleteAuthorizationRule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, + Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}") + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response deleteAuthorizationRuleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules(@HostParam("$host") String endpoint, + Mono> listAuthorizationRules(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("relayName") String relayName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, + Response listAuthorizationRulesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AuthorizationRuleInner parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({ 200, 204 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule(@HostParam("$host") String endpoint, + Mono> listKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule(@HostParam("$host") String endpoint, + Response listKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, + Mono> regenerateKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys(@HostParam("$host") String endpoint, + Response regenerateKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @PathParam("relayName") String relayName, @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateAccessKeyParameters parameters, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WcfRelayInner parameters, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WcfRelayInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays/{relayName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("relayName") String relayName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/wcfRelays") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespaceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listByNamespaceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -181,599 +267,310 @@ Mono> listByNamespaceNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - /** - * Lists the WCF relays within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the list WCF relay operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync(String resourceGroupName, - String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByNamespace(this.client.getEndpoint(), resourceGroupName, namespaceName, - 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())); - } - - /** - * Lists the WCF relays within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list WCF relay operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync(String resourceGroupName, - String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByNamespace(this.client.getEndpoint(), resourceGroupName, namespaceName, 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)); - } - - /** - * Lists the WCF relays within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the list WCF relay operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { - return new PagedFlux<>(() -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); - } - - /** - * Lists the WCF relays within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list WCF relay operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName, - Context context) { - return new PagedFlux<>(() -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAuthorizationRulesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * Lists the WCF relays within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the list WCF relay operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNamespaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * Lists the WCF relays within the namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @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 the list WCF relay operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName, - Context context) { - return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByNamespaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Creates or updates a WCF relay. This operation is idempotent. + * Get authorizationRule for a WCF relay by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the WCF relay resource along with {@link Response} on successful completion of + * @return authorizationRule for a WCF relay by name along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String namespaceName, String relayName, WcfRelayInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> getAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String relayName, String authorizationRuleName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, namespaceName, - relayName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, authorizationRuleName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a WCF relay. This operation is idempotent. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. - * @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 description of the WCF relay resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String namespaceName, String relayName, WcfRelayInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); - } - - /** - * Creates or updates a WCF relay. This operation is idempotent. + * Get authorizationRule for a WCF relay by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the WCF relay resource on successful completion of {@link Mono}. + * @return authorizationRule for a WCF relay by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, String relayName, - WcfRelayInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, relayName, parameters) + private Mono getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a WCF relay. This operation is idempotent. + * Get authorizationRule for a WCF relay by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. + * @param authorizationRuleName The authorization rule name. * @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 description of the WCF relay resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, - String relayName, WcfRelayInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, relayName, parameters, context) - .block(); - } - - /** - * Creates or updates a WCF relay. This operation is idempotent. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param parameters Parameters supplied to create a WCF relay. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the WCF relay resource. + * @return authorizationRule for a WCF relay by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WcfRelayInner createOrUpdate(String resourceGroupName, String namespaceName, String relayName, - WcfRelayInner parameters) { - return createOrUpdateWithResponse(resourceGroupName, namespaceName, relayName, parameters, Context.NONE) - .getValue(); + public Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String relayName, String authorizationRuleName, Context context) { + final String accept = "application/json"; + return service.getAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, authorizationRuleName, accept, + context); } /** - * Deletes a WCF relay. + * Get authorizationRule for a WCF relay by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return authorizationRule for a WCF relay by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, - String relayName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, - relayName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName) { + return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, + Context.NONE).getValue(); } /** - * Deletes a WCF relay. + * Creates or updates an authorization rule for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param context The context to associate with this operation. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 Response} on successful completion of {@link Mono}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, - String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, + AuthorizationRuleInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return FluxUtil + .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + relayName, authorizationRuleName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a WCF relay. + * Creates or updates an authorization rule for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return single item in a List or Get AuthorizationRule operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName, String relayName) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, relayName).flatMap(ignored -> Mono.empty()); + private Mono createOrUpdateAuthorizationRuleAsync(String resourceGroupName, + String namespaceName, String relayName, String authorizationRuleName, AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, + authorizationRuleName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a WCF relay. + * Creates or updates an authorization rule for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String namespaceName, String relayName, + public Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String relayName, String authorizationRuleName, AuthorizationRuleInner parameters, Context context) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, relayName, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, authorizationRuleName, + contentType, accept, parameters, context); } /** - * Deletes a WCF relay. + * Creates or updates an authorization rule for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, String relayName) { - deleteWithResponse(resourceGroupName, namespaceName, relayName, Context.NONE); + public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName, AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, relayName, + authorizationRuleName, parameters, Context.NONE).getValue(); } /** - * Returns the description for the specified WCF relay. + * Deletes a WCF relay authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the WCF relay resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String namespaceName, - String relayName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; + private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String relayName, String authorizationRuleName) { return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.deleteAuthorizationRule(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + relayName, authorizationRuleName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns the description for the specified WCF relay. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param relayName The relay name. - * @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 description of the WCF relay resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String namespaceName, - String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Returns the description for the specified WCF relay. + * Deletes a WCF relay authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the WCF relay resource on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String namespaceName, String relayName) { - return getWithResponseAsync(resourceGroupName, namespaceName, relayName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, + authorizationRuleName).flatMap(ignored -> Mono.empty()); } /** - * Returns the description for the specified WCF relay. + * Deletes a WCF relay authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @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 description of the WCF relay resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String namespaceName, String relayName, - Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, relayName, context).block(); + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName, Context context) { + return service.deleteAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, authorizationRuleName, + context); } /** - * Returns the description for the specified WCF relay. + * Deletes a WCF relay authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the WCF relay resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WcfRelayInner get(String resourceGroupName, String namespaceName, String relayName) { - return getWithResponse(resourceGroupName, namespaceName, relayName, Context.NONE).getValue(); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName) { + deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, + Context.NONE); } /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync(String resourceGroupName, String namespaceName, String relayName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listAuthorizationRules(this.client.getEndpoint(), resourceGroupName, namespaceName, - relayName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + context -> service.listAuthorizationRules(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, 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())); @@ -782,892 +579,642 @@ private Mono> listAuthorizationRulesSingle /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesSinglePageAsync(String resourceGroupName, - String namespaceName, String relayName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAuthorizationRules(this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - 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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + String namespaceName, String relayName) { + return new PagedFlux<>(() -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, relayName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); } /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation as paginated response with {@link PagedFlux}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAuthorizationRulesSinglePage(String resourceGroupName, String namespaceName, String relayName) { - return new PagedFlux<>(() -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, relayName), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + final String accept = "application/json"; + Response res + = service.listAuthorizationRulesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @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 from the list namespace operation as paginated response with {@link PagedFlux}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAuthorizationRulesSinglePage(String resourceGroupName, String namespaceName, String relayName, Context context) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, relayName, context), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res + = service.listAuthorizationRulesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String relayName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, relayName)); + return new PagedIterable<>(() -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName, relayName), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink)); } /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String relayName, Context context) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, relayName, context)); + return new PagedIterable<>( + () -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName, relayName, context), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink, context)); } /** - * Creates or updates an authorization rule for a WCF relay. + * Primary and secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> listKeysWithResponseAsync(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), - resourceGroupName, namespaceName, relayName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, authorizationRuleName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates an authorization rule for a WCF relay. + * Primary and secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - relayName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, - accept, context); + private Mono listKeysAsync(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates an authorization rule for a WCF relay. + * Primary and secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule on successful completion of {@link Mono}. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAuthorizationRuleAsync(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName, AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, - authorizationRuleName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName, Context context) { + final String accept = "application/json"; + return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, authorizationRuleName, accept, + context); } /** - * Creates or updates an authorization rule for a WCF relay. + * Primary and secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response}. + * @return namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName, AuthorizationRuleInner parameters, - Context context) { - return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, - authorizationRuleName, parameters, context).block(); + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, Context.NONE) + .getValue(); } /** - * Creates or updates an authorization rule for a WCF relay. + * Regenerates the primary or secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule parameters. + * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace authorization rule. + * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, relayName, - authorizationRuleName, parameters, Context.NONE).getValue(); + private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String relayName, String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, authorizationRuleName, + contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a WCF relay authorization rule. + * Regenerates the primary or secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteAuthorizationRule(this.client.getEndpoint(), resourceGroupName, - namespaceName, relayName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a WCF relay authorization rule. + * Regenerates the primary or secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 Response} on successful completion of {@link Mono}. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.regenerateKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, authorizationRuleName, + contentType, accept, parameters, context); } /** - * Deletes a WCF relay authorization rule. + * Regenerates the primary or secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, - authorizationRuleName).flatMap(ignored -> Mono.empty()); + public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, + parameters, Context.NONE).getValue(); + } + + /** + * Returns the description for the specified WCF relay. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param relayName The relay name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of the WCF relay resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String namespaceName, + String relayName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the description for the specified WCF relay. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param relayName The relay name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of the WCF relay resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String namespaceName, String relayName) { + return getWithResponseAsync(resourceGroupName, namespaceName, relayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a WCF relay authorization rule. + * Returns the description for the specified WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @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 Response}. + * @return description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, Context context) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, - authorizationRuleName, context).block(); + public Response getWithResponse(String resourceGroupName, String namespaceName, String relayName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, relayName, accept, context); } /** - * Deletes a WCF relay authorization rule. + * Returns the description for the specified WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of the WCF relay resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName) { - deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, - Context.NONE); + public WcfRelayInner get(String resourceGroupName, String namespaceName, String relayName) { + return getWithResponse(resourceGroupName, namespaceName, relayName, Context.NONE).getValue(); } /** - * Get authorizationRule for a WCF relay by name. + * Creates or updates a WCF relay. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a WCF relay. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorizationRule for a WCF relay by name along with {@link Response} on successful completion of + * @return description of the WCF relay resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String namespaceName, String relayName, WcfRelayInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), resourceGroupName, - namespaceName, relayName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get authorizationRule for a WCF relay by name. + * Creates or updates a WCF relay. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to create a WCF relay. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorizationRule for a WCF relay by name along with {@link Response} on successful completion of - * {@link Mono}. + * @return description of the WCF relay resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, String relayName, + WcfRelayInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, relayName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get authorizationRule for a WCF relay by name. + * Creates or updates a WCF relay. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to create a WCF relay. + * @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 authorizationRule for a WCF relay by name on successful completion of {@link Mono}. + * @return description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAuthorizationRuleAsync(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, + String relayName, WcfRelayInner parameters, 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, namespaceName, relayName, contentType, accept, + parameters, context); } /** - * Get authorizationRule for a WCF relay by name. + * Creates or updates a WCF relay. This operation is idempotent. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @param parameters Parameters supplied to create a WCF relay. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorizationRule for a WCF relay by name along with {@link Response}. + * @return description of the WCF relay resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName, Context context) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName, - context).block(); + public WcfRelayInner createOrUpdate(String resourceGroupName, String namespaceName, String relayName, + WcfRelayInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, namespaceName, relayName, parameters, Context.NONE) + .getValue(); } /** - * Get authorizationRule for a WCF relay by name. + * Deletes a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return authorizationRule for a WCF relay by name. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner getAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName) { - return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, - Context.NONE).getValue(); + private Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName, + String relayName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Primary and secondary connection strings to the WCF relay. + * Deletes a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - relayName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono deleteAsync(String resourceGroupName, String namespaceName, String relayName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, relayName).flatMap(ignored -> Mono.empty()); } /** - * Primary and secondary connection strings to the WCF relay. + * Deletes a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @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 namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + public Response deleteWithResponse(String resourceGroupName, String namespaceName, String relayName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, relayName, context); } /** - * Primary and secondary connection strings to the WCF relay. + * Deletes a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public void delete(String resourceGroupName, String namespaceName, String relayName) { + deleteWithResponse(resourceGroupName, namespaceName, relayName, Context.NONE); } /** - * Primary and secondary connection strings to the WCF relay. + * Lists the WCF relays within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @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 namespace/Relay Connection String along with {@link Response}. + * @return the response of the list WCF relay operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName, context) - .block(); + private Mono> listByNamespaceSinglePageAsync(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByNamespace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, 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())); } /** - * Primary and secondary connection strings to the WCF relay. + * Lists the WCF relays within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String. + * @return the response of the list WCF relay operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName) { - return listKeysWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>(() -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * Lists the WCF relays within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return the response of the list WCF relay operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private PagedResponse listByNamespaceSinglePage(String resourceGroupName, String namespaceName) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - relayName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByNamespaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * Lists the WCF relays within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String along with {@link Response} on successful completion of {@link Mono}. + * @return the response of the list WCF relay operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, + private PagedResponse listByNamespaceSinglePage(String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (relayName == null) { - return Mono.error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerateKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context); + Response res + = service.listByNamespaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * Lists the WCF relays within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return namespace/Relay Connection String on successful completion of {@link Mono}. + * @return the response of the list WCF relay operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName, - parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(() -> listByNamespaceSinglePage(resourceGroupName, namespaceName), + nextLink -> listByNamespaceNextSinglePage(nextLink)); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * Lists the WCF relays within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String along with {@link Response}. + * @return the response of the list WCF relay operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context) { - return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName, - parameters, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName, + Context context) { + return new PagedIterable<>(() -> listByNamespaceSinglePage(resourceGroupName, namespaceName, context), + nextLink -> listByNamespaceNextSinglePage(nextLink, context)); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * Get the next page of items. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @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 namespace/Relay Connection String. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, - parameters, Context.NONE).getValue(); + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAuthorizationRulesNext(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())); } /** @@ -1677,24 +1224,15 @@ public AccessKeysInner regenerateKeys(String resourceGroupName, String namespace * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the list WCF relay operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listAuthorizationRulesNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByNamespaceNext(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())); + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1705,23 +1243,16 @@ private Mono> listByNamespaceNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the list WCF relay operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a AuthorizationRule list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listAuthorizationRulesNextSinglePage(String nextLink, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1731,27 +1262,37 @@ private Mono> listByNamespaceNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of the list WCF relay operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.listByNamespaceNext(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 the list WCF relay operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByNamespaceNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByNamespaceNextSync(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. * @@ -1760,23 +1301,14 @@ private Mono> listAuthorizationRulesNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response of the list WCF relay operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByNamespaceNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByNamespaceNextSync(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/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysImpl.java index ad1e7aa19d8f..4163114ccb0e 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.implementation; @@ -31,73 +31,34 @@ public WcfRelaysImpl(WcfRelaysClient innerClient, com.azure.resourcemanager.rela this.serviceManager = serviceManager; } - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { - PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WcfRelayImpl(inner1, this.manager())); - } - - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context) { - PagedIterable inner - = this.serviceClient().listByNamespace(resourceGroupName, namespaceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WcfRelayImpl(inner1, this.manager())); - } - - public Response deleteWithResponse(String resourceGroupName, String namespaceName, String relayName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, relayName, context); - } - - public void delete(String resourceGroupName, String namespaceName, String relayName) { - this.serviceClient().delete(resourceGroupName, namespaceName, relayName); - } - - public Response getWithResponse(String resourceGroupName, String namespaceName, String relayName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, namespaceName, relayName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new WcfRelayImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName, Context context) { + Response inner = this.serviceClient() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, + context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AuthorizationRuleImpl(inner.getValue(), this.manager())); } - public WcfRelay get(String resourceGroupName, String namespaceName, String relayName) { - WcfRelayInner inner = this.serviceClient().get(resourceGroupName, namespaceName, relayName); + public AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName) { + AuthorizationRuleInner inner = this.serviceClient() + .getAuthorizationRule(resourceGroupName, namespaceName, relayName, authorizationRuleName); if (inner != null) { - return new WcfRelayImpl(inner, this.manager()); + return new AuthorizationRuleImpl(inner, this.manager()); } else { return null; } } - public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, - String relayName) { - PagedIterable inner - = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, relayName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); - } - - public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, - String relayName, Context context) { - PagedIterable inner - = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, relayName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); - } - public Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, AuthorizationRuleInner parameters, Context context) { Response inner = this.serviceClient() .createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AuthorizationRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AuthorizationRuleImpl(inner.getValue(), this.manager())); } public AuthorizationRule createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, @@ -125,40 +86,26 @@ public void deleteAuthorizationRule(String resourceGroupName, String namespaceNa .deleteAuthorizationRule(resourceGroupName, namespaceName, relayName, authorizationRuleName); } - public Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, Context context) { - Response inner = this.serviceClient() - .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, - context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AuthorizationRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, + String relayName) { + PagedIterable inner + = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, relayName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } - public AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName) { - AuthorizationRuleInner inner = this.serviceClient() - .getAuthorizationRule(resourceGroupName, namespaceName, relayName, authorizationRuleName); - if (inner != null) { - return new AuthorizationRuleImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, + String relayName, Context context) { + PagedIterable inner + = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, relayName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } public Response listKeysWithResponse(String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, Context context) { Response inner = this.serviceClient() .listKeysWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccessKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); } public AccessKeys listKeys(String resourceGroupName, String namespaceName, String relayName, @@ -177,12 +124,8 @@ public Response regenerateKeysWithResponse(String resourceGroupName, Response inner = this.serviceClient() .regenerateKeysWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccessKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessKeysImpl(inner.getValue(), this.manager())); } public AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String relayName, @@ -196,6 +139,43 @@ public AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, } } + public Response getWithResponse(String resourceGroupName, String namespaceName, String relayName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, namespaceName, relayName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WcfRelayImpl(inner.getValue(), this.manager())); + } + + public WcfRelay get(String resourceGroupName, String namespaceName, String relayName) { + WcfRelayInner inner = this.serviceClient().get(resourceGroupName, namespaceName, relayName); + if (inner != null) { + return new WcfRelayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String namespaceName, String relayName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, relayName, context); + } + + public void delete(String resourceGroupName, String namespaceName, String relayName) { + this.serviceClient().delete(resourceGroupName, namespaceName, relayName); + } + + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WcfRelayImpl(inner1, this.manager())); + } + + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner + = this.serviceClient().listByNamespace(resourceGroupName, namespaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WcfRelayImpl(inner1, this.manager())); + } + public WcfRelay getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AuthorizationRuleListResult.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/AuthorizationRuleListResult.java similarity index 62% rename from sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AuthorizationRuleListResult.java rename to sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/AuthorizationRuleListResult.java index 64f1fcbfaa31..0c3ac5ae4fd2 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AuthorizationRuleListResult.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/AuthorizationRuleListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.relay.models; +package com.azure.resourcemanager.relay.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * The response from the list namespace operation. + * The response of a AuthorizationRule list operation. */ -@Fluent +@Immutable public final class AuthorizationRuleListResult implements JsonSerializable { /* - * Result of the list authorization rules operation. + * The AuthorizationRule items on this page */ private List value; /* - * Link to the next set of results. Not empty if value contains incomplete list of authorization rules. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of AuthorizationRuleListResult class. */ - public AuthorizationRuleListResult() { + private AuthorizationRuleListResult() { } /** - * Get the value property: Result of the list authorization rules operation. + * Get the value property: The AuthorizationRule items on this page. * * @return the value value. */ @@ -44,19 +44,7 @@ public List value() { } /** - * Set the value property: Result of the list authorization rules operation. - * - * @param value the value value to set. - * @return the AuthorizationRuleListResult object itself. - */ - public AuthorizationRuleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of - * authorization rules. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of - * authorization rules. - * - * @param nextLink the nextLink value to set. - * @return the AuthorizationRuleListResult object itself. - */ - public AuthorizationRuleListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -104,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AuthorizationRuleListResult 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 AuthorizationRuleListResult. */ public static AuthorizationRuleListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnectionListResult.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/HybridConnectionListResult.java similarity index 62% rename from sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnectionListResult.java rename to sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/HybridConnectionListResult.java index 70ad45e23e84..5e04b41547d9 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnectionListResult.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/HybridConnectionListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.relay.models; +package com.azure.resourcemanager.relay.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * The response of the list hybrid connection operation. + * The response of a HybridConnection list operation. */ -@Fluent +@Immutable public final class HybridConnectionListResult implements JsonSerializable { /* - * Result of the list hybrid connections. + * The HybridConnection items on this page */ private List value; /* - * Link to the next set of results. Not empty if value contains incomplete list hybrid connection operation. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of HybridConnectionListResult class. */ - public HybridConnectionListResult() { + private HybridConnectionListResult() { } /** - * Get the value property: Result of the list hybrid connections. + * Get the value property: The HybridConnection items on this page. * * @return the value value. */ @@ -44,19 +44,7 @@ public List value() { } /** - * Set the value property: Result of the list hybrid connections. - * - * @param value the value value to set. - * @return the HybridConnectionListResult object itself. - */ - public HybridConnectionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list hybrid - * connection operation. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link to the next set of results. Not empty if value contains incomplete list hybrid - * connection operation. - * - * @param nextLink the nextLink value to set. - * @return the HybridConnectionListResult object itself. - */ - public HybridConnectionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -104,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of HybridConnectionListResult 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 HybridConnectionListResult. */ public static HybridConnectionListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/OperationListResult.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/OperationListResult.java similarity index 74% rename from sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/OperationListResult.java rename to sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/OperationListResult.java index 56363502982c..e0bc9f6612a4 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/OperationListResult.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/OperationListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.relay.models; +package com.azure.resourcemanager.relay.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -14,29 +14,29 @@ import java.util.List; /** - * Result of the request to list Relay operations. It contains a list of operations and a URL link to get the next set - * of results. + * 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 { /* - * List of Relay operations supported by resource provider. + * The Operation items on this page */ private List value; /* - * URL to get the next set of operation list results if there are any. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: List of Relay operations supported by resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -45,7 +45,7 @@ public List value() { } /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -53,23 +53,14 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@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(); } @@ -79,6 +70,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @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 { diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/PrivateEndpointConnectionListResult.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..b2cf9d4684a3 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.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.relay.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PrivateEndpointConnection list operation. + */ +@Immutable +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { + /* + * The PrivateEndpointConnection items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ + private PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: The PrivateEndpointConnection 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 PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult 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 PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayNamespaceListResult.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/RelayNamespaceListResult.java similarity index 63% rename from sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayNamespaceListResult.java rename to sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/RelayNamespaceListResult.java index 7b287a98717d..303f4f0c282e 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayNamespaceListResult.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/RelayNamespaceListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.relay.models; +package com.azure.resourcemanager.relay.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * The response from the list namespace operation. + * The response of a RelayNamespace list operation. */ -@Fluent +@Immutable public final class RelayNamespaceListResult implements JsonSerializable { /* - * Result of the list namespace operation. + * The RelayNamespace items on this page */ private List value; /* - * Link to the next set of results. Not empty if value contains incomplete list of namespaces. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of RelayNamespaceListResult class. */ - public RelayNamespaceListResult() { + private RelayNamespaceListResult() { } /** - * Get the value property: Result of the list namespace operation. + * Get the value property: The RelayNamespace items on this page. * * @return the value value. */ @@ -44,19 +44,7 @@ public List value() { } /** - * Set the value property: Result of the list namespace operation. - * - * @param value the value value to set. - * @return the RelayNamespaceListResult object itself. - */ - public RelayNamespaceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of - * namespaces. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of - * namespaces. - * - * @param nextLink the nextLink value to set. - * @return the RelayNamespaceListResult object itself. - */ - public RelayNamespaceListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -104,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of RelayNamespaceListResult 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 RelayNamespaceListResult. */ public static RelayNamespaceListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelaysListResult.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/WcfRelaysListResult.java similarity index 63% rename from sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelaysListResult.java rename to sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/WcfRelaysListResult.java index 5d691d957cc9..a244cc515b7c 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelaysListResult.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/models/WcfRelaysListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.relay.models; +package com.azure.resourcemanager.relay.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The response of the list WCF relay operation. */ -@Fluent +@Immutable public final class WcfRelaysListResult implements JsonSerializable { /* - * Result of the list WCF relay operation. + * The WcfRelay items on this page */ private List value; /* - * Link to the next set of results. Not empty if value contains incomplete list of WCF relays. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of WcfRelaysListResult class. */ - public WcfRelaysListResult() { + private WcfRelaysListResult() { } /** - * Get the value property: Result of the list WCF relay operation. + * Get the value property: The WcfRelay items on this page. * * @return the value value. */ @@ -44,19 +44,7 @@ public List value() { } /** - * Set the value property: Result of the list WCF relay operation. - * - * @param value the value value to set. - * @return the WcfRelaysListResult object itself. - */ - public WcfRelaysListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of WCF - * relays. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of WCF - * relays. - * - * @param nextLink the nextLink value to set. - * @return the WcfRelaysListResult object itself. - */ - public WcfRelaysListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -104,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of WcfRelaysListResult 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 WcfRelaysListResult. */ public static WcfRelaysListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/package-info.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/package-info.java index 137f01f838ed..23acf440bec4 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/package-info.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for RelayApi. + * Package containing the implementations for Relay. * Use these API to manage Azure Relay resources through Azure Resource Manager. */ package com.azure.resourcemanager.relay.implementation; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AccessKeys.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AccessKeys.java index 2932b7f96c49..91e2961a6050 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AccessKeys.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AccessKeys.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AccessRights.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AccessRights.java index d01e60c1d40d..3bb1a747d466 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AccessRights.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AccessRights.java @@ -1,61 +1,56 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** * Defines values for AccessRights. */ -public enum AccessRights { +public final class AccessRights extends ExpandableStringEnum { /** - * Enum value Manage. + * Static value Manage for AccessRights. */ - MANAGE("Manage"), + public static final AccessRights MANAGE = fromString("Manage"); /** - * Enum value Send. + * Static value Send for AccessRights. */ - SEND("Send"), + public static final AccessRights SEND = fromString("Send"); /** - * Enum value Listen. + * Static value Listen for AccessRights. */ - LISTEN("Listen"); + public static final AccessRights LISTEN = fromString("Listen"); /** - * The actual serialized value for a AccessRights instance. + * Creates a new instance of AccessRights value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - AccessRights(String value) { - this.value = value; + @Deprecated + public AccessRights() { } /** - * Parses a serialized value to a AccessRights instance. + * Creates or finds a AccessRights from its string representation. * - * @param value the serialized value to parse. - * @return the parsed AccessRights object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding AccessRights. */ - public static AccessRights fromString(String value) { - if (value == null) { - return null; - } - AccessRights[] items = AccessRights.values(); - for (AccessRights item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static AccessRights fromString(String name) { + return fromString(name, AccessRights.class); } /** - * {@inheritDoc} + * Gets known AccessRights values. + * + * @return known AccessRights values. */ - @Override - public String toString() { - return this.value; + public static Collection values() { + return values(AccessRights.class); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ActionType.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ActionType.java new file mode 100644 index 000000000000..3a2b2fa392f3 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/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.relay.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/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AuthorizationRule.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AuthorizationRule.java index 4a51d7e58ab3..a251624725bd 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AuthorizationRule.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AuthorizationRule.java @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; import java.util.List; @@ -34,6 +36,20 @@ public interface AuthorizationRule { */ String type(); + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the rights property: The rights associated with the rule. * @@ -41,6 +57,20 @@ public interface AuthorizationRule { */ List rights(); + /** + * 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. * @@ -58,8 +88,8 @@ public interface AuthorizationRule { /** * The entirety of the AuthorizationRule definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithRights, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -79,31 +109,18 @@ interface WithParentResource { /** * Specifies resourceGroupName, namespaceName. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @return the next definition stage. */ - WithRights withExistingNamespace(String resourceGroupName, String namespaceName); - } - - /** - * The stage of the AuthorizationRule definition allowing to specify rights. - */ - interface WithRights { - /** - * Specifies the rights property: The rights associated with the rule.. - * - * @param rights The rights associated with the rule. - * @return the next definition stage. - */ - WithCreate withRights(List rights); + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); } /** * The stage of the AuthorizationRule 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 { + interface WithCreate extends DefinitionStages.WithRights { /** * Executes the create request. * @@ -119,6 +136,19 @@ interface WithCreate { */ AuthorizationRule create(Context context); } + + /** + * The stage of the AuthorizationRule definition allowing to specify rights. + */ + interface WithRights { + /** + * Specifies the rights property: The rights associated with the rule.. + * + * @param rights The rights associated with the rule. + * @return the next definition stage. + */ + WithCreate withRights(List rights); + } } /** diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailability.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailability.java index def7cd02e7c0..e7f4cf0c1def 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailability.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailability.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -51,20 +50,6 @@ public CheckNameAvailability withName(String name) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model CheckNameAvailability")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailability.class); - /** * {@inheritDoc} */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailabilityResult.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailabilityResult.java index f583c45b62c4..4804db284050 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailabilityResult.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailabilityResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ConnectionState.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ConnectionState.java new file mode 100644 index 000000000000..04da61fdc2ce --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ConnectionState.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.relay.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; + +/** + * ConnectionState information. + */ +@Fluent +public final class ConnectionState implements JsonSerializable { + /* + * Status of the connection. + */ + private PrivateLinkConnectionStatus status; + + /* + * Description of the connection state. + */ + private String description; + + /** + * Creates an instance of ConnectionState class. + */ + public ConnectionState() { + } + + /** + * Get the status property: Status of the connection. + * + * @return the status value. + */ + public PrivateLinkConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the connection. + * + * @param status the status value to set. + * @return the ConnectionState object itself. + */ + public ConnectionState withStatus(PrivateLinkConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: Description of the connection state. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the connection state. + * + * @param description the description value to set. + * @return the ConnectionState object itself. + */ + public ConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionState 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 ConnectionState. + */ + public static ConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionState deserializedConnectionState = new ConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedConnectionState.status = PrivateLinkConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedConnectionState.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionState; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/DefaultAction.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/DefaultAction.java new file mode 100644 index 000000000000..d8297087106f --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/DefaultAction.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.relay.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Default Action for Network Rule Set. + */ +public final class DefaultAction extends ExpandableStringEnum { + /** + * Static value Allow for DefaultAction. + */ + public static final DefaultAction ALLOW = fromString("Allow"); + + /** + * Static value Deny for DefaultAction. + */ + public static final DefaultAction DENY = fromString("Deny"); + + /** + * Creates a new instance of DefaultAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultAction() { + } + + /** + * Creates or finds a DefaultAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultAction. + */ + public static DefaultAction fromString(String name) { + return fromString(name, DefaultAction.class); + } + + /** + * Gets known DefaultAction values. + * + * @return known DefaultAction values. + */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/EndPointProvisioningState.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/EndPointProvisioningState.java new file mode 100644 index 000000000000..801d43b4c639 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/EndPointProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the Private Endpoint Connection. + */ +public final class EndPointProvisioningState extends ExpandableStringEnum { + /** + * Static value Creating for EndPointProvisioningState. + */ + public static final EndPointProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for EndPointProvisioningState. + */ + public static final EndPointProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for EndPointProvisioningState. + */ + public static final EndPointProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Succeeded for EndPointProvisioningState. + */ + public static final EndPointProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for EndPointProvisioningState. + */ + public static final EndPointProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Failed for EndPointProvisioningState. + */ + public static final EndPointProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of EndPointProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EndPointProvisioningState() { + } + + /** + * Creates or finds a EndPointProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndPointProvisioningState. + */ + public static EndPointProvisioningState fromString(String name) { + return fromString(name, EndPointProvisioningState.class); + } + + /** + * Gets known EndPointProvisioningState values. + * + * @return known EndPointProvisioningState values. + */ + public static Collection values() { + return values(EndPointProvisioningState.class); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnection.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnection.java index b62e00f41f30..51e286fd29af 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnection.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnection.java @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.relay.fluent.models.HybridConnectionInner; import java.time.OffsetDateTime; @@ -33,6 +35,20 @@ public interface HybridConnection { */ String type(); + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the createdAt property: The time the hybrid connection was created. * @@ -72,6 +88,20 @@ public interface HybridConnection { */ String userMetadata(); + /** + * 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. * @@ -110,7 +140,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, namespaceName. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @return the next definition stage. */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnections.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnections.java index 6c444196ccbb..cc85cf9ea43a 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnections.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/HybridConnections.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; @@ -14,95 +14,110 @@ */ public interface HybridConnections { /** - * Lists the hybrid connection within the namespace. + * Hybrid connection authorization rule for a hybrid connection by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @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 the list hybrid connection operation as paginated response with {@link PagedIterable}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, Context context); /** - * Lists the hybrid connection within the namespace. + * Hybrid connection authorization rule for a hybrid connection by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. * @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 the list hybrid connection operation as paginated response with {@link PagedIterable}. + * @return single item in a List or Get AuthorizationRule operation. */ - PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); + AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName); /** - * Deletes a hybrid connection. + * Creates or updates an authorization rule for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String namespaceName, String hybridConnectionName, - Context context); + Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String hybridConnectionName, String authorizationRuleName, + AuthorizationRuleInner parameters, Context context); /** - * Deletes a hybrid connection. + * Creates or updates an authorization rule for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 single item in a List or Get AuthorizationRule operation. */ - void delete(String resourceGroupName, String namespaceName, String hybridConnectionName); + AuthorizationRule createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, AuthorizationRuleInner parameters); /** - * Returns the description for the specified hybrid connection. + * Deletes a hybrid connection authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. * @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 description of hybrid connection resource along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, Context context); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, Context context); /** - * Returns the description for the specified hybrid connection. + * Deletes a hybrid connection authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. + * @param authorizationRuleName The authorization rule name. * @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 description of hybrid connection resource. */ - HybridConnection get(String resourceGroupName, String namespaceName, String hybridConnectionName); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName); /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String hybridConnectionName); @@ -110,177 +125,162 @@ PagedIterable listAuthorizationRules(String resourceGroupName /** * Authorization rules for a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); /** - * Creates or updates an authorization rule for a hybrid connection. + * Primary and secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response}. + * @return namespace/Relay Connection String along with {@link Response}. */ - Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters, Context context); + Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, Context context); /** - * Creates or updates an authorization rule for a hybrid connection. + * Primary and secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule. + * @return namespace/Relay Connection String. */ - AuthorizationRule createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, AuthorizationRuleInner parameters); + AccessKeys listKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName); /** - * Deletes a hybrid connection authorization rule. + * Regenerates the primary or secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 Response}. + * @return namespace/Relay Connection String along with {@link Response}. */ - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, + Context context); /** - * Deletes a hybrid connection authorization rule. + * Regenerates the primary or secondary connection strings to the hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String. */ - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName); + AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters); /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Returns the description for the specified hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @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 description of a namespace authorization rule along with {@link Response}. + * @return description of hybrid connection resource along with {@link Response}. */ - Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context); + Response getWithResponse(String resourceGroupName, String namespaceName, + String hybridConnectionName, Context context); /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Returns the description for the specified hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @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 description of a namespace authorization rule. + * @return description of hybrid connection resource. */ - AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName); + HybridConnection get(String resourceGroupName, String namespaceName, String hybridConnectionName); /** - * Primary and secondary connection strings to the hybrid connection. + * Deletes a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @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 namespace/Relay Connection String along with {@link Response}. + * @return the {@link Response}. */ - Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, Context context); + Response deleteWithResponse(String resourceGroupName, String namespaceName, String hybridConnectionName, + Context context); /** - * Primary and secondary connection strings to the hybrid connection. + * Deletes a hybrid connection. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. * @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 namespace/Relay Connection String. */ - AccessKeys listKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName); + void delete(String resourceGroupName, String namespaceName, String hybridConnectionName); /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Lists the hybrid connection within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @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 namespace/Relay Connection String along with {@link Response}. + * @return the response of a HybridConnection list operation as paginated response with {@link PagedIterable}. */ - Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String hybridConnectionName, String authorizationRuleName, RegenerateAccessKeyParameters parameters, - Context context); + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Lists the hybrid connection within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param hybridConnectionName The hybrid connection name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @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 namespace/Relay Connection String. + * @return the response of a HybridConnection list operation as paginated response with {@link PagedIterable}. */ - AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters); + PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); /** * Returns the description for the specified hybrid connection. diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/KeyType.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/KeyType.java index 640399d1775f..132d2aa57b5a 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/KeyType.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/KeyType.java @@ -1,56 +1,51 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** * The access key to regenerate. */ -public enum KeyType { +public final class KeyType extends ExpandableStringEnum { /** - * Enum value PrimaryKey. + * Static value PrimaryKey for KeyType. */ - PRIMARY_KEY("PrimaryKey"), + public static final KeyType PRIMARY_KEY = fromString("PrimaryKey"); /** - * Enum value SecondaryKey. + * Static value SecondaryKey for KeyType. */ - SECONDARY_KEY("SecondaryKey"); + public static final KeyType SECONDARY_KEY = fromString("SecondaryKey"); /** - * The actual serialized value for a KeyType instance. + * Creates a new instance of KeyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - KeyType(String value) { - this.value = value; + @Deprecated + public KeyType() { } /** - * Parses a serialized value to a KeyType instance. + * Creates or finds a KeyType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed KeyType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding KeyType. */ - public static KeyType fromString(String value) { - if (value == null) { - return null; - } - KeyType[] items = KeyType.values(); - for (KeyType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static KeyType fromString(String name) { + return fromString(name, KeyType.class); } /** - * {@inheritDoc} + * Gets known KeyType values. + * + * @return known KeyType values. */ - @Override - public String toString() { - return this.value; + public static Collection values() { + return values(KeyType.class); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NWRuleSetIpRules.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NWRuleSetIpRules.java new file mode 100644 index 000000000000..50f777f82dc8 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NWRuleSetIpRules.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.relay.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; + +/** + * The response from the List namespace operation. + */ +@Fluent +public final class NWRuleSetIpRules implements JsonSerializable { + /* + * IP Mask + */ + private String ipMask; + + /* + * The IP Filter Action + */ + private NetworkRuleIPAction action; + + /** + * Creates an instance of NWRuleSetIpRules class. + */ + public NWRuleSetIpRules() { + } + + /** + * Get the ipMask property: IP Mask. + * + * @return the ipMask value. + */ + public String ipMask() { + return this.ipMask; + } + + /** + * Set the ipMask property: IP Mask. + * + * @param ipMask the ipMask value to set. + * @return the NWRuleSetIpRules object itself. + */ + public NWRuleSetIpRules withIpMask(String ipMask) { + this.ipMask = ipMask; + return this; + } + + /** + * Get the action property: The IP Filter Action. + * + * @return the action value. + */ + public NetworkRuleIPAction action() { + return this.action; + } + + /** + * Set the action property: The IP Filter Action. + * + * @param action the action value to set. + * @return the NWRuleSetIpRules object itself. + */ + public NWRuleSetIpRules withAction(NetworkRuleIPAction action) { + this.action = action; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipMask", this.ipMask); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NWRuleSetIpRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NWRuleSetIpRules 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 NWRuleSetIpRules. + */ + public static NWRuleSetIpRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NWRuleSetIpRules deserializedNWRuleSetIpRules = new NWRuleSetIpRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipMask".equals(fieldName)) { + deserializedNWRuleSetIpRules.ipMask = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedNWRuleSetIpRules.action = NetworkRuleIPAction.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNWRuleSetIpRules; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Namespaces.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Namespaces.java index dcc786737b3b..7b6dd61e2166 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Namespaces.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Namespaces.java @@ -1,111 +1,163 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; /** * Resource collection API of Namespaces. */ public interface Namespaces { /** - * Check the specified namespace name availability. + * Authorization rule for a namespace by name. * - * @param parameters Parameters to check availability of the specified namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @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 description of the check name availability request properties along with {@link Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ - Response checkNameAvailabilityWithResponse(CheckNameAvailability parameters, - Context context); + Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Check the specified namespace name availability. + * Authorization rule for a namespace by name. * - * @param parameters Parameters to check availability of the specified namespace name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @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 description of the check name availability request properties. + * @return single item in a List or Get AuthorizationRule operation. */ - CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters); + AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName); /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Deletes a namespace authorization rule. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Deletes a namespace authorization rule. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Lists all the available namespaces within the ResourceGroup. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); /** - * Lists all the available namespaces within the ResourceGroup. + * Authorization rules for a namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, + Context context); /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Primary and secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @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 namespace/Relay Connection String along with {@link Response}. */ - void deleteByResourceGroup(String resourceGroupName, String namespaceName); + Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Primary and secondary connection strings to the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @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 namespace/Relay Connection String. + */ + AccessKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); + + /** + * Regenerates the primary or secondary connection strings to the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String along with {@link Response}. */ - void delete(String resourceGroupName, String namespaceName, Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context); + + /** + * Regenerates the primary or secondary connection strings to the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. + * @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 namespace/Relay Connection String. + */ + AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, + RegenerateAccessKeyParameters parameters); /** * Returns the description for the specified namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -119,7 +171,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName /** * Returns the description for the specified namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -129,168 +181,149 @@ Response getByResourceGroupWithResponse(String resourceGroupName RelayNamespace getByResourceGroup(String resourceGroupName, String namespaceName); /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. */ - PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); + void deleteByResourceGroup(String resourceGroupName, String namespaceName); /** - * Authorization rules for a namespace. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. */ - PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, - Context context); + void delete(String resourceGroupName, String namespaceName, Context context); /** - * Deletes a namespace authorization rule. + * Lists all the available namespaces within the ResourceGroup. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @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 {@link Response}. + * @return the response of a RelayNamespace list operation as paginated response with {@link PagedIterable}. */ - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Deletes a namespace authorization rule. + * Lists all the available namespaces within the ResourceGroup. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @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 RelayNamespace list operation as paginated response with {@link PagedIterable}. */ - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Authorization rule for a namespace by name. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @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 description of a namespace authorization rule along with {@link Response}. + * @return the response of a RelayNamespace list operation as paginated response with {@link PagedIterable}. */ - Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context); + PagedIterable list(); /** - * Authorization rule for a namespace by name. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @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 description of a namespace authorization rule. + * @return the response of a RelayNamespace list operation as paginated response with {@link PagedIterable}. */ - AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, - String authorizationRuleName); + PagedIterable list(Context context); /** - * Primary and secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. * @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 namespace/Relay Connection String along with {@link Response}. + * @return networkRuleSet for a Namespace along with {@link Response}. */ - Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context); + Response getNetworkRuleSetWithResponse(String resourceGroupName, String namespaceName, + Context context); /** - * Primary and secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. * @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 namespace/Relay Connection String. + * @return networkRuleSet for a Namespace. */ - AccessKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); + NetworkRuleSet getNetworkRuleSet(String resourceGroupName, String namespaceName); /** - * Regenerates the primary or secondary connection strings to the namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @param parameters The Namespace IpFilterRule. * @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 namespace/Relay Connection String along with {@link Response}. + * @return description of topic resource along with {@link Response}. */ - Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context); + Response createOrUpdateNetworkRuleSetWithResponse(String resourceGroupName, String namespaceName, + NetworkRuleSetInner parameters, Context context); /** - * Regenerates the primary or secondary connection strings to the namespace. + * Create or update NetworkRuleSet for a Namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @param parameters The Namespace IpFilterRule. * @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 namespace/Relay Connection String. + * @return description of topic resource. */ - AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, - RegenerateAccessKeyParameters parameters); + NetworkRuleSet createOrUpdateNetworkRuleSet(String resourceGroupName, String namespaceName, + NetworkRuleSetInner parameters); /** - * Returns the description for the specified namespace. + * Check the specified namespace name availability. * - * @param id the resource ID. + * @param parameters The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource along with {@link Response}. + * @return description of the check name availability request properties along with {@link Response}. */ - RelayNamespace getById(String id); + Response checkNameAvailabilityWithResponse(CheckNameAvailability parameters, + Context context); /** - * Returns the description for the specified namespace. + * Check the specified namespace name availability. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a namespace resource along with {@link Response}. + * @return description of the check name availability request properties. */ - Response getByIdWithResponse(String id, Context context); + CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters); /** * Authorization rule for a namespace by name. @@ -299,7 +332,7 @@ AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String * @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 description of a namespace authorization rule along with {@link Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ AuthorizationRule getAuthorizationRuleById(String id); @@ -311,30 +344,32 @@ AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String * @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 description of a namespace authorization rule along with {@link Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ Response getAuthorizationRuleByIdWithResponse(String id, Context context); /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Returns the description for the specified namespace. * * @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 description of a namespace resource along with {@link Response}. */ - void deleteById(String id); + RelayNamespace getById(String id); /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Returns the description for the specified namespace. * * @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 description of a namespace resource along with {@link Response}. */ - void deleteByIdWithResponse(String id, Context context); + Response getByIdWithResponse(String id, Context context); /** * Deletes a namespace authorization rule. @@ -359,12 +394,25 @@ AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String Response deleteAuthorizationRuleByIdWithResponse(String id, Context context); /** - * Begins definition for a new RelayNamespace resource. + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. * - * @param name resource name. - * @return the first stage of the new RelayNamespace definition. + * @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. */ - RelayNamespace.DefinitionStages.Blank define(String name); + void deleteById(String id); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @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 AuthorizationRule resource. @@ -373,4 +421,12 @@ AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String * @return the first stage of the new AuthorizationRule definition. */ AuthorizationRule.DefinitionStages.Blank defineAuthorizationRule(String name); + + /** + * Begins definition for a new RelayNamespace resource. + * + * @param name resource name. + * @return the first stage of the new RelayNamespace definition. + */ + RelayNamespace.DefinitionStages.Blank define(String name); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleIPAction.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleIPAction.java new file mode 100644 index 000000000000..212376389048 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleIPAction.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.relay.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The IP Filter Action. + */ +public final class NetworkRuleIPAction extends ExpandableStringEnum { + /** + * Static value Allow for NetworkRuleIPAction. + */ + public static final NetworkRuleIPAction ALLOW = fromString("Allow"); + + /** + * Creates a new instance of NetworkRuleIPAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkRuleIPAction() { + } + + /** + * Creates or finds a NetworkRuleIPAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkRuleIPAction. + */ + public static NetworkRuleIPAction fromString(String name) { + return fromString(name, NetworkRuleIPAction.class); + } + + /** + * Gets known NetworkRuleIPAction values. + * + * @return known NetworkRuleIPAction values. + */ + public static Collection values() { + return values(NetworkRuleIPAction.class); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleSet.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleSet.java new file mode 100644 index 000000000000..d0281456f8ea --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleSet.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.relay.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkRuleSet. + */ +public interface NetworkRuleSet { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the trustedServiceAccessEnabled property: Value that indicates whether Trusted Service Access is Enabled or + * not. + * + * @return the trustedServiceAccessEnabled value. + */ + Boolean trustedServiceAccessEnabled(); + + /** + * Gets the defaultAction property: Default Action for Network Rule Set. + * + * @return the defaultAction value. + */ + DefaultAction defaultAction(); + + /** + * Gets the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it + * is enabled. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the ipRules property: List of IpRules. + * + * @return the ipRules value. + */ + List ipRules(); + + /** + * Gets the inner com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner object. + * + * @return the inner object. + */ + NetworkRuleSetInner innerModel(); +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operation.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operation.java index b4668cfe6676..ef4c4b927686 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operation.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; @@ -11,19 +11,44 @@ */ public interface Operation { /** - * Gets the name property: Operation name: {provider}/{resource}/{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 display property: The object that represents the operation. + * 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.relay.fluent.models.OperationInner object. * diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/OperationDisplay.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/OperationDisplay.java index 4efb770da0fa..0b7753ae28bb 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/OperationDisplay.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/OperationDisplay.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; @@ -12,33 +12,42 @@ import java.io.IOException; /** - * The object that represents the operation. + * Localized display information for an operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { /* - * Service provider: Relay. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ private String provider; /* - * Resource on which the operation is performed: Invoice, etc. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ private String resource; /* - * Operation type: Read, write, delete, etc. + * 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. */ - public OperationDisplay() { + private OperationDisplay() { } /** - * Get the provider property: Service provider: Relay. + * 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. */ @@ -47,7 +56,8 @@ public String provider() { } /** - * Get the resource property: Resource on which the operation is performed: Invoice, etc. + * 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. */ @@ -56,7 +66,8 @@ public String resource() { } /** - * Get the operation property: Operation type: Read, write, delete, etc. + * 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. */ @@ -65,11 +76,13 @@ public String operation() { } /** - * Validates the instance. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the description value. */ - public void validate() { + public String description() { + return this.description; } /** @@ -102,6 +115,8 @@ public static OperationDisplay fromJson(JsonReader jsonReader) throws IOExceptio 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(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operations.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operations.java index 17f4f8fca0df..c3264c9d689c 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operations.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; @@ -12,22 +12,24 @@ */ public interface Operations { /** - * Lists all available Relay REST API 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 result of the request to list Relay operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** - * Lists all available Relay REST API operations. + * 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 result of the request to list Relay operations as paginated response with {@link PagedIterable}. + * @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/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Origin.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Origin.java new file mode 100644 index 000000000000..55bc1d6441ef --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/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.relay.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/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpoint.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpoint.java new file mode 100644 index 000000000000..09dab32d9dc6 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpoint.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.relay.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; + +/** + * PrivateEndpoint information. + */ +@Fluent +public final class PrivateEndpoint implements JsonSerializable { + /* + * The ARM identifier for Private Endpoint. + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM identifier for Private Endpoint. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint 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 PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnection.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..81fadc98d620 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnection.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; + +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the privateEndpoint property: The Private Endpoint resource for this Connection. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: Details about the state of the connection. + * + * @return the privateLinkServiceConnectionState value. + */ + ConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: Provisioning state of the Private Endpoint Connection. + * + * @return the provisioningState value. + */ + EndPointProvisioningState provisioningState(); + + /** + * 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.relay.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the PrivateEndpointConnection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, namespaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @return the next definition stage. + */ + WithCreate withExistingNamespace(String resourceGroupName, String namespaceName); + } + + /** + * The stage of the PrivateEndpointConnection 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.WithPrivateEndpoint, + DefinitionStages.WithPrivateLinkServiceConnectionState, DefinitionStages.WithProvisioningState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The Private Endpoint resource for this Connection.. + * + * @param privateEndpoint The Private Endpoint resource for this Connection. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Details about the state of the connection.. + * + * @param privateLinkServiceConnectionState Details about the state of the connection. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the Private Endpoint Connection.. + * + * @param provisioningState Provisioning state of the Private Endpoint Connection. + * @return the next definition stage. + */ + WithCreate withProvisioningState(EndPointProvisioningState provisioningState); + } + } + + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** + * The template for PrivateEndpointConnection update. + */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState, + UpdateStages.WithProvisioningState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + + /** + * The PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The Private Endpoint resource for this Connection.. + * + * @param privateEndpoint The Private Endpoint resource for this Connection. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Details about the state of the connection.. + * + * @param privateLinkServiceConnectionState Details about the state of the connection. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState(ConnectionState privateLinkServiceConnectionState); + } + + /** + * The stage of the PrivateEndpointConnection update allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the Private Endpoint Connection.. + * + * @param provisioningState Provisioning state of the Private Endpoint Connection. + * @return the next definition stage. + */ + Update withProvisioningState(EndPointProvisioningState provisioningState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnections.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..caad3aa7a2a5 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnections.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.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 PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections { + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 description for the specified Private Endpoint Connection name along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 description for the specified Private Endpoint Connection name. + */ + PrivateEndpointConnection get(String resourceGroupName, String namespaceName, String privateEndpointConnectionName); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 namespaceName, String privateEndpointConnectionName); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateEndpointConnectionName The PrivateEndpointConnection name. + * @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 namespaceName, String privateEndpointConnectionName, Context context); + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 available PrivateEndpointConnections within a namespace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String namespaceName); + + /** + * Gets the available PrivateEndpointConnections within a namespace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 available PrivateEndpointConnections within a namespace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection name along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a description for the specified Private Endpoint Connection name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @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); + + /** + * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * + * @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 PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkConnectionStatus.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkConnectionStatus.java new file mode 100644 index 000000000000..0e2031ef839e --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkConnectionStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the connection. + */ +public final class PrivateLinkConnectionStatus extends ExpandableStringEnum { + /** + * Static value Pending for PrivateLinkConnectionStatus. + */ + public static final PrivateLinkConnectionStatus PENDING = fromString("Pending"); + + /** + * Static value Approved for PrivateLinkConnectionStatus. + */ + public static final PrivateLinkConnectionStatus APPROVED = fromString("Approved"); + + /** + * Static value Rejected for PrivateLinkConnectionStatus. + */ + public static final PrivateLinkConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Static value Disconnected for PrivateLinkConnectionStatus. + */ + public static final PrivateLinkConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates a new instance of PrivateLinkConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateLinkConnectionStatus() { + } + + /** + * Creates or finds a PrivateLinkConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateLinkConnectionStatus. + */ + public static PrivateLinkConnectionStatus fromString(String name) { + return fromString(name, PrivateLinkConnectionStatus.class); + } + + /** + * Gets known PrivateLinkConnectionStatus values. + * + * @return known PrivateLinkConnectionStatus values. + */ + public static Collection values() { + return values(PrivateLinkConnectionStatus.class); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResource.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResource.java new file mode 100644 index 000000000000..d0c80f5bf0d4 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResource.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResource. + */ +public interface PrivateLinkResource { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResources.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResources.java new file mode 100644 index 000000000000..0961d0ef0ab2 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResources.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of PrivateLinkResources. + */ +public interface PrivateLinkResources { + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String namespaceName, + String privateLinkResourceName, Context context); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry. + */ + PrivateLinkResource get(String resourceGroupName, String namespaceName, String privateLinkResourceName); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 result of the List private link resources operation along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String namespaceName, + Context context); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param namespaceName The namespace name. + * @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 result of the List private link resources operation. + */ + PrivateLinkResourcesListResult list(String resourceGroupName, String namespaceName); +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResourcesListResult.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResourcesListResult.java new file mode 100644 index 000000000000..ac2a488ddea7 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResourcesListResult.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.relay.models; + +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourcesListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResourcesListResult. + */ +public interface PrivateLinkResourcesListResult { + /** + * Gets the value property: A collection of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: A link for the next page of private link resources. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourcesListResultInner object. + * + * @return the inner object. + */ + PrivateLinkResourcesListResultInner innerModel(); +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ProvisioningStateEnum.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ProvisioningStateEnum.java deleted file mode 100644 index e2009e83d611..000000000000 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ProvisioningStateEnum.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.relay.models; - -/** - * Defines values for ProvisioningStateEnum. - */ -public enum ProvisioningStateEnum { - /** - * Enum value Created. - */ - CREATED("Created"), - - /** - * Enum value Succeeded. - */ - SUCCEEDED("Succeeded"), - - /** - * Enum value Deleted. - */ - DELETED("Deleted"), - - /** - * Enum value Failed. - */ - FAILED("Failed"), - - /** - * Enum value Updating. - */ - UPDATING("Updating"), - - /** - * Enum value Unknown. - */ - UNKNOWN("Unknown"); - - /** - * The actual serialized value for a ProvisioningStateEnum instance. - */ - private final String value; - - ProvisioningStateEnum(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ProvisioningStateEnum instance. - * - * @param value the serialized value to parse. - * @return the parsed ProvisioningStateEnum object, or null if unable to parse. - */ - public static ProvisioningStateEnum fromString(String value) { - if (value == null) { - return null; - } - ProvisioningStateEnum[] items = ProvisioningStateEnum.values(); - for (ProvisioningStateEnum item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PublicNetworkAccess.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..5068cf5eeaa0 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PublicNetworkAccess.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.relay.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * This determines if traffic is allowed over public network. By default it is enabled. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** + * Static value Enabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Static value SecuredByPerimeter for PublicNetworkAccess. + */ + public static final PublicNetworkAccess SECURED_BY_PERIMETER = fromString("SecuredByPerimeter"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RegenerateAccessKeyParameters.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RegenerateAccessKeyParameters.java index 3bc4e3d13679..6c0ad275efd8 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RegenerateAccessKeyParameters.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RegenerateAccessKeyParameters.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,7 +12,7 @@ import java.io.IOException; /** - * Parameters supplied to the regenerate authorization rule operation, specifies which key neeeds to be reset. + * Parameters supplied to the regenerate authorization rule operation, specifies which key needs to be reset. */ @Fluent public final class RegenerateAccessKeyParameters implements JsonSerializable { @@ -75,21 +74,6 @@ public RegenerateAccessKeyParameters withKey(String key) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property keyType in model RegenerateAccessKeyParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegenerateAccessKeyParameters.class); - /** * {@inheritDoc} */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayNamespace.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayNamespace.java index 38752b121559..2f5511a11145 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayNamespace.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayNamespace.java @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** @@ -57,11 +60,25 @@ public interface RelayNamespace { Sku sku(); /** - * Gets the provisioningState property: The provisioningState property. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Namespace. * * @return the provisioningState value. */ - ProvisioningStateEnum provisioningState(); + String provisioningState(); + + /** + * Gets the status property: Status of the Namespace. + * + * @return the status value. + */ + String status(); /** * Gets the createdAt property: The time the namespace was created. @@ -91,6 +108,31 @@ public interface RelayNamespace { */ String metricId(); + /** + * Gets the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it + * is enabled. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the minimumTlsVersion property: The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. + * + * @return the minimumTlsVersion value. + */ + TlsVersion minimumTlsVersion(); + /** * Gets the region of the resource. * @@ -164,7 +206,7 @@ interface WithResourceGroup { /** * Specifies resourceGroupName. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); @@ -174,7 +216,9 @@ interface WithResourceGroup { * The stage of the RelayNamespace 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.WithSku { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSku, + DefinitionStages.WithPrivateEndpointConnections, DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithMinimumTlsVersion { /** * Executes the create request. * @@ -216,6 +260,53 @@ interface WithSku { */ WithCreate withSku(Sku sku); } + + /** + * The stage of the RelayNamespace definition allowing to specify privateEndpointConnections. + */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections.. + * + * @param privateEndpointConnections List of private endpoint connections. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + + /** + * The stage of the RelayNamespace definition allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: This determines if traffic is allowed over public network. By + * default it is enabled.. + * + * @param publicNetworkAccess This determines if traffic is allowed over public network. By default it is + * enabled. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the RelayNamespace definition allowing to specify minimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies the minimumTlsVersion property: The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2.. + * + * @param minimumTlsVersion The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. + * @return the next definition stage. + */ + WithCreate withMinimumTlsVersion(TlsVersion minimumTlsVersion); + } } /** @@ -228,7 +319,8 @@ interface WithSku { /** * The template for RelayNamespace update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithPrivateEndpointConnections, + UpdateStages.WithPublicNetworkAccess, UpdateStages.WithMinimumTlsVersion { /** * Executes the update request. * @@ -274,6 +366,53 @@ interface WithSku { */ Update withSku(Sku sku); } + + /** + * The stage of the RelayNamespace update allowing to specify privateEndpointConnections. + */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections.. + * + * @param privateEndpointConnections List of private endpoint connections. + * @return the next definition stage. + */ + Update withPrivateEndpointConnections(List privateEndpointConnections); + } + + /** + * The stage of the RelayNamespace update allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: This determines if traffic is allowed over public network. By + * default it is enabled.. + * + * @param publicNetworkAccess This determines if traffic is allowed over public network. By default it is + * enabled. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the RelayNamespace update allowing to specify minimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies the minimumTlsVersion property: The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2.. + * + * @param minimumTlsVersion The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. + * @return the next definition stage. + */ + Update withMinimumTlsVersion(TlsVersion minimumTlsVersion); + } } /** diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayUpdateParameters.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayUpdateParameters.java index 464a7c586406..6bd962755207 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayUpdateParameters.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RelayUpdateParameters.java @@ -1,16 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; +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.relay.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceProperties; import java.io.IOException; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** @@ -28,6 +31,11 @@ public final class RelayUpdateParameters extends ResourceNamespacePatch { */ private RelayNamespaceProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -78,6 +86,16 @@ private RelayNamespaceProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -118,14 +136,23 @@ public RelayUpdateParameters withTags(Map tags) { } /** - * Get the provisioningState property: The provisioningState property. + * Get the provisioningState property: Provisioning state of the Namespace. * * @return the provisioningState value. */ - public ProvisioningStateEnum provisioningState() { + public String provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Get the status property: Status of the Namespace. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + /** * Get the createdAt property: The time the namespace was created. * @@ -163,18 +190,81 @@ public String metricId() { } /** - * Validates the instance. + * Get the privateEndpointConnections property: List of private endpoint connections. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the privateEndpointConnections value. */ - @Override - public void validate() { - if (sku() != null) { - sku().validate(); + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the RelayUpdateParameters object itself. + */ + public RelayUpdateParameters + withPrivateEndpointConnections(List privateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new RelayNamespaceProperties(); } - if (innerProperties() != null) { - innerProperties().validate(); + this.innerProperties().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RelayUpdateParameters object itself. + */ + public RelayUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new RelayNamespaceProperties(); } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the minimumTlsVersion property: The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: The minimum TLS version for the namespace. + * Supported values are 1.2 and 1.3. + * The service defaults to 1.2 when the property is omitted. + * Existing namespaces configured with TLS 1.0 or 1.1 are reported as TLS 1.2. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the RelayUpdateParameters object itself. + */ + public RelayUpdateParameters withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RelayNamespaceProperties(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; } /** @@ -214,6 +304,8 @@ public static RelayUpdateParameters fromJson(JsonReader jsonReader) throws IOExc } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedRelayUpdateParameters.withTags(tags); + } else if ("systemData".equals(fieldName)) { + deserializedRelayUpdateParameters.systemData = SystemData.fromJson(reader); } else if ("sku".equals(fieldName)) { deserializedRelayUpdateParameters.sku = Sku.fromJson(reader); } else if ("properties".equals(fieldName)) { diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Relaytype.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Relaytype.java index 765339d7d3ad..074617db9173 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Relaytype.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Relaytype.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ResourceNamespacePatch.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ResourceNamespacePatch.java index dc808b6bd0fe..c5fd6842d31d 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ResourceNamespacePatch.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ResourceNamespacePatch.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -22,6 +23,11 @@ public class ResourceNamespacePatch extends ProxyResource { */ private Map tags; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -63,6 +69,26 @@ public ResourceNamespacePatch withTags(Map tags) { 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; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the ResourceNamespacePatch object itself. + */ + ResourceNamespacePatch withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -93,14 +119,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -136,6 +154,8 @@ public static ResourceNamespacePatch fromJson(JsonReader jsonReader) throws IOEx } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedResourceNamespacePatch.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedResourceNamespacePatch.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Sku.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Sku.java index 6a202e22de09..28b9c6ef98e1 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Sku.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Sku.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; @@ -19,7 +19,7 @@ public final class Sku implements JsonSerializable { /* * Name of this SKU. */ - private final String name = "Standard"; + private SkuName name; /* * The tier of this SKU. @@ -37,10 +37,21 @@ public Sku() { * * @return the name value. */ - public String name() { + public SkuName name() { return this.name; } + /** + * Set the name property: Name of this SKU. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + /** * Get the tier property: The tier of this SKU. * @@ -61,21 +72,13 @@ public Sku withTier(SkuTier tier) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); return jsonWriter.writeEndObject(); } @@ -96,7 +99,9 @@ public static Sku fromJson(JsonReader jsonReader) throws IOException { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("tier".equals(fieldName)) { + if ("name".equals(fieldName)) { + deserializedSku.name = SkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { deserializedSku.tier = SkuTier.fromString(reader.getString()); } else { reader.skipChildren(); diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/SkuName.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/SkuName.java new file mode 100644 index 000000000000..d3a1977fd244 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/SkuName.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.relay.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Name of this SKU. + */ +public final class SkuName extends ExpandableStringEnum { + /** + * Static value Standard for SkuName. + */ + public static final SkuName STANDARD = fromString("Standard"); + + /** + * Creates a new instance of SkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuName() { + } + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * Gets known SkuName values. + * + * @return known SkuName values. + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/SkuTier.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/SkuTier.java index a746aaa440f0..4ff975f41e40 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/SkuTier.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/SkuTier.java @@ -1,51 +1,46 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** * The tier of this SKU. */ -public enum SkuTier { +public final class SkuTier extends ExpandableStringEnum { /** - * Enum value Standard. + * Static value Standard for SkuTier. */ - STANDARD("Standard"); + public static final SkuTier STANDARD = fromString("Standard"); /** - * The actual serialized value for a SkuTier instance. + * Creates a new instance of SkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - SkuTier(String value) { - this.value = value; + @Deprecated + public SkuTier() { } /** - * Parses a serialized value to a SkuTier instance. + * Creates or finds a SkuTier from its string representation. * - * @param value the serialized value to parse. - * @return the parsed SkuTier object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding SkuTier. */ - public static SkuTier fromString(String value) { - if (value == null) { - return null; - } - SkuTier[] items = SkuTier.values(); - for (SkuTier item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); } /** - * {@inheritDoc} + * Gets known SkuTier values. + * + * @return known SkuTier values. */ - @Override - public String toString() { - return this.value; + public static Collection values() { + return values(SkuTier.class); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/TlsVersion.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/TlsVersion.java new file mode 100644 index 000000000000..426d89306450 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/TlsVersion.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.relay.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TLS versions supported by Relay namespaces. + */ +public final class TlsVersion extends ExpandableStringEnum { + /** + * TLS version 1.2. + */ + public static final TlsVersion ONE_TWO = fromString("1.2"); + + /** + * TLS version 1.3. + */ + public static final TlsVersion ONE_THREE = fromString("1.3"); + + /** + * Creates a new instance of TlsVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TlsVersion() { + } + + /** + * Creates or finds a TlsVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding TlsVersion. + */ + public static TlsVersion fromString(String name) { + return fromString(name, TlsVersion.class); + } + + /** + * Gets known TlsVersion values. + * + * @return known TlsVersion values. + */ + public static Collection values() { + return values(TlsVersion.class); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/UnavailableReason.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/UnavailableReason.java index f6fbe296b100..181c1627e658 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/UnavailableReason.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/UnavailableReason.java @@ -1,76 +1,72 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** * Specifies the reason for the unavailability of the service. */ -public enum UnavailableReason { +public final class UnavailableReason extends ExpandableStringEnum { /** - * Enum value None. + * Static value None for UnavailableReason. */ - NONE("None"), + public static final UnavailableReason NONE = fromString("None"); /** - * Enum value InvalidName. + * Static value InvalidName for UnavailableReason. */ - INVALID_NAME("InvalidName"), + public static final UnavailableReason INVALID_NAME = fromString("InvalidName"); /** - * Enum value SubscriptionIsDisabled. + * Static value SubscriptionIsDisabled for UnavailableReason. */ - SUBSCRIPTION_IS_DISABLED("SubscriptionIsDisabled"), + public static final UnavailableReason SUBSCRIPTION_IS_DISABLED = fromString("SubscriptionIsDisabled"); /** - * Enum value NameInUse. + * Static value NameInUse for UnavailableReason. */ - NAME_IN_USE("NameInUse"), + public static final UnavailableReason NAME_IN_USE = fromString("NameInUse"); /** - * Enum value NameInLockdown. + * Static value NameInLockdown for UnavailableReason. */ - NAME_IN_LOCKDOWN("NameInLockdown"), + public static final UnavailableReason NAME_IN_LOCKDOWN = fromString("NameInLockdown"); /** - * Enum value TooManyNamespaceInCurrentSubscription. + * Static value TooManyNamespaceInCurrentSubscription for UnavailableReason. */ - TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION("TooManyNamespaceInCurrentSubscription"); + public static final UnavailableReason TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION + = fromString("TooManyNamespaceInCurrentSubscription"); /** - * The actual serialized value for a UnavailableReason instance. + * Creates a new instance of UnavailableReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - UnavailableReason(String value) { - this.value = value; + @Deprecated + public UnavailableReason() { } /** - * Parses a serialized value to a UnavailableReason instance. + * Creates or finds a UnavailableReason from its string representation. * - * @param value the serialized value to parse. - * @return the parsed UnavailableReason object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding UnavailableReason. */ - public static UnavailableReason fromString(String value) { - if (value == null) { - return null; - } - UnavailableReason[] items = UnavailableReason.values(); - for (UnavailableReason item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static UnavailableReason fromString(String name) { + return fromString(name, UnavailableReason.class); } /** - * {@inheritDoc} + * Gets known UnavailableReason values. + * + * @return known UnavailableReason values. */ - @Override - public String toString() { - return this.value; + public static Collection values() { + return values(UnavailableReason.class); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelay.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelay.java index 87a79b3aa7ff..9c430a1b9120 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelay.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelay.java @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.relay.fluent.models.WcfRelayInner; import java.time.OffsetDateTime; @@ -33,6 +35,20 @@ public interface WcfRelay { */ String type(); + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the isDynamic property: Returns true if the relay is dynamic; otherwise, false. * @@ -94,6 +110,20 @@ public interface WcfRelay { */ String userMetadata(); + /** + * 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. * @@ -132,7 +162,7 @@ interface WithParentResource { /** * Specifies resourceGroupName, namespaceName. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @return the next definition stage. */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelays.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelays.java index 5aa1ab77a4fc..7956448bc0cd 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelays.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/WcfRelays.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.models; @@ -14,95 +14,110 @@ */ public interface WcfRelays { /** - * Lists the WCF relays within the namespace. + * Get authorizationRule for a WCF relay by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. + * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @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 the list WCF relay operation as paginated response with {@link PagedIterable}. + * @return authorizationRule for a WCF relay by name along with {@link Response}. */ - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String relayName, String authorizationRuleName, Context context); /** - * Lists the WCF relays within the namespace. + * Get authorizationRule for a WCF relay by name. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @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 the list WCF relay operation as paginated response with {@link PagedIterable}. + * @return authorizationRule for a WCF relay by name. */ - PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); + AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName); /** - * Deletes a WCF relay. + * Creates or updates an authorization rule for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 Response}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String namespaceName, String relayName, + Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String relayName, String authorizationRuleName, AuthorizationRuleInner parameters, Context context); /** - * Deletes a WCF relay. + * Creates or updates an authorization rule for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. + * @param parameters The authorization rule 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 single item in a List or Get AuthorizationRule operation. */ - void delete(String resourceGroupName, String namespaceName, String relayName); + AuthorizationRule createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, AuthorizationRuleInner parameters); /** - * Returns the description for the specified WCF relay. + * Deletes a WCF relay authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @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 description of the WCF relay resource along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String namespaceName, String relayName, - Context context); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, Context context); /** - * Returns the description for the specified WCF relay. + * Deletes a WCF relay authorization rule. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. + * @param authorizationRuleName The authorization rule name. * @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 description of the WCF relay resource. */ - WcfRelay get(String resourceGroupName, String namespaceName, String relayName); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName); /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String relayName); @@ -110,175 +125,160 @@ PagedIterable listAuthorizationRules(String resourceGroupName /** * Authorization rules for a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return the response of a AuthorizationRule list operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String relayName, Context context); /** - * Creates or updates an authorization rule for a WCF relay. + * Primary and secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule along with {@link Response}. + * @return namespace/Relay Connection String along with {@link Response}. */ - Response createOrUpdateAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String relayName, String authorizationRuleName, AuthorizationRuleInner parameters, - Context context); + Response listKeysWithResponse(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, Context context); /** - * Creates or updates an authorization rule for a WCF relay. + * Primary and secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. - * @param parameters The authorization rule 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 description of a namespace authorization rule. + * @return namespace/Relay Connection String. */ - AuthorizationRule createOrUpdateAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, AuthorizationRuleInner parameters); + AccessKeys listKeys(String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); /** - * Deletes a WCF relay authorization rule. + * Regenerates the primary or secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 Response}. + * @return namespace/Relay Connection String along with {@link Response}. */ - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context); /** - * Deletes a WCF relay authorization rule. + * Regenerates the primary or secondary connection strings to the WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters supplied to regenerate authorization rule. * @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 namespace/Relay Connection String. */ - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName); + AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String relayName, + String authorizationRuleName, RegenerateAccessKeyParameters parameters); /** - * Get authorizationRule for a WCF relay by name. + * Returns the description for the specified WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @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 authorizationRule for a WCF relay by name along with {@link Response}. + * @return description of the WCF relay resource along with {@link Response}. */ - Response getAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String relayName, String authorizationRuleName, Context context); + Response getWithResponse(String resourceGroupName, String namespaceName, String relayName, + Context context); /** - * Get authorizationRule for a WCF relay by name. + * Returns the description for the specified WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @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 authorizationRule for a WCF relay by name. + * @return description of the WCF relay resource. */ - AuthorizationRule getAuthorizationRule(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName); + WcfRelay get(String resourceGroupName, String namespaceName, String relayName); /** - * Primary and secondary connection strings to the WCF relay. + * Deletes a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @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 namespace/Relay Connection String along with {@link Response}. + * @return the {@link Response}. */ - Response listKeysWithResponse(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, Context context); + Response deleteWithResponse(String resourceGroupName, String namespaceName, String relayName, + Context context); /** - * Primary and secondary connection strings to the WCF relay. + * Deletes a WCF relay. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. * @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 namespace/Relay Connection String. */ - AccessKeys listKeys(String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); + void delete(String resourceGroupName, String namespaceName, String relayName); /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * Lists the WCF relays within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. - * @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 namespace/Relay Connection String along with {@link Response}. + * @return the response of the list WCF relay operation as paginated response with {@link PagedIterable}. */ - Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters, Context context); + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * Lists the WCF relays within the namespace. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The namespace name. - * @param relayName The relay name. - * @param authorizationRuleName The authorization rule name. - * @param parameters Parameters supplied to regenerate authorization rule. + * @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 namespace/Relay Connection String. + * @return the response of the list WCF relay operation as paginated response with {@link PagedIterable}. */ - AccessKeys regenerateKeys(String resourceGroupName, String namespaceName, String relayName, - String authorizationRuleName, RegenerateAccessKeyParameters parameters); + PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); /** * Returns the description for the specified WCF relay. diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/package-info.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/package-info.java index 2f770aaaffaa..3afd9b77d4b5 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/package-info.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for RelayApi. + * Package containing the data models for Relay. * Use these API to manage Azure Relay resources through Azure Resource Manager. */ package com.azure.resourcemanager.relay.models; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/package-info.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/package-info.java index c141262e8360..993a5d5303ea 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/package-info.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for RelayApi. + * Package containing the classes for Relay. * Use these API to manage Azure Relay resources through Azure Resource Manager. */ package com.azure.resourcemanager.relay; diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/module-info.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/module-info.java index f5739a02ad3c..629ef9f7d053 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/module-info.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.relay { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.relay.fluent.models to com.azure.core; opens com.azure.resourcemanager.relay.models to com.azure.core; + opens com.azure.resourcemanager.relay.implementation.models to com.azure.core; } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/resources/META-INF/azure-resourcemanager-relay_metadata.json b/sdk/relay/azure-resourcemanager-relay/src/main/resources/META-INF/azure-resourcemanager-relay_metadata.json new file mode 100644 index 000000000000..648828d3ac69 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/resources/META-INF/azure-resourcemanager-relay_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Relay":"2026-01-01"},"crossLanguagePackageId":"Microsoft.Relay","crossLanguageVersion":"c5b063e0f415","crossLanguageDefinitions":{"com.azure.resourcemanager.relay.fluent.HybridConnectionsClient":"Microsoft.Relay.HybridConnections","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.createOrUpdate":"Microsoft.Relay.HybridConnectionOperationGroup.createOrUpdate","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.createOrUpdateAuthorizationRule":"Microsoft.Relay.HybridConnections.createOrUpdateAuthorizationRule","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.createOrUpdateAuthorizationRuleWithResponse":"Microsoft.Relay.HybridConnections.createOrUpdateAuthorizationRule","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.createOrUpdateWithResponse":"Microsoft.Relay.HybridConnectionOperationGroup.createOrUpdate","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.delete":"Microsoft.Relay.HybridConnectionOperationGroup.delete","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.deleteAuthorizationRule":"Microsoft.Relay.HybridConnections.deleteAuthorizationRule","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.deleteAuthorizationRuleWithResponse":"Microsoft.Relay.HybridConnections.deleteAuthorizationRule","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.deleteWithResponse":"Microsoft.Relay.HybridConnectionOperationGroup.delete","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.get":"Microsoft.Relay.HybridConnectionOperationGroup.get","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.getAuthorizationRule":"Microsoft.Relay.HybridConnections.getAuthorizationRule","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.getAuthorizationRuleWithResponse":"Microsoft.Relay.HybridConnections.getAuthorizationRule","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.getWithResponse":"Microsoft.Relay.HybridConnectionOperationGroup.get","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.listAuthorizationRules":"Microsoft.Relay.HybridConnections.listAuthorizationRules","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.listByNamespace":"Microsoft.Relay.HybridConnectionOperationGroup.listByNamespace","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.listKeys":"Microsoft.Relay.HybridConnections.listKeys","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.listKeysWithResponse":"Microsoft.Relay.HybridConnections.listKeys","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.regenerateKeys":"Microsoft.Relay.HybridConnections.regenerateKeys","com.azure.resourcemanager.relay.fluent.HybridConnectionsClient.regenerateKeysWithResponse":"Microsoft.Relay.HybridConnections.regenerateKeys","com.azure.resourcemanager.relay.fluent.NamespacesClient":"Microsoft.Relay","com.azure.resourcemanager.relay.fluent.NamespacesClient.beginCreateOrUpdate":"Microsoft.Relay.RelayNamespaces.createOrUpdate","com.azure.resourcemanager.relay.fluent.NamespacesClient.beginDelete":"Microsoft.Relay.RelayNamespaces.delete","com.azure.resourcemanager.relay.fluent.NamespacesClient.checkNameAvailability":"Microsoft.Relay.NamespacesOperationGroup.checkNameAvailability","com.azure.resourcemanager.relay.fluent.NamespacesClient.checkNameAvailabilityWithResponse":"Microsoft.Relay.NamespacesOperationGroup.checkNameAvailability","com.azure.resourcemanager.relay.fluent.NamespacesClient.createOrUpdate":"Microsoft.Relay.RelayNamespaces.createOrUpdate","com.azure.resourcemanager.relay.fluent.NamespacesClient.createOrUpdateAuthorizationRule":"Microsoft.Relay.AuthorizationRules.createOrUpdateAuthorizationRule","com.azure.resourcemanager.relay.fluent.NamespacesClient.createOrUpdateAuthorizationRuleWithResponse":"Microsoft.Relay.AuthorizationRules.createOrUpdateAuthorizationRule","com.azure.resourcemanager.relay.fluent.NamespacesClient.createOrUpdateNetworkRuleSet":"Microsoft.Relay.NetworkRuleSets.createOrUpdateNetworkRuleSet","com.azure.resourcemanager.relay.fluent.NamespacesClient.createOrUpdateNetworkRuleSetWithResponse":"Microsoft.Relay.NetworkRuleSets.createOrUpdateNetworkRuleSet","com.azure.resourcemanager.relay.fluent.NamespacesClient.delete":"Microsoft.Relay.RelayNamespaces.delete","com.azure.resourcemanager.relay.fluent.NamespacesClient.deleteAuthorizationRule":"Microsoft.Relay.AuthorizationRules.deleteAuthorizationRule","com.azure.resourcemanager.relay.fluent.NamespacesClient.deleteAuthorizationRuleWithResponse":"Microsoft.Relay.AuthorizationRules.deleteAuthorizationRule","com.azure.resourcemanager.relay.fluent.NamespacesClient.getAuthorizationRule":"Microsoft.Relay.AuthorizationRules.getAuthorizationRule","com.azure.resourcemanager.relay.fluent.NamespacesClient.getAuthorizationRuleWithResponse":"Microsoft.Relay.AuthorizationRules.getAuthorizationRule","com.azure.resourcemanager.relay.fluent.NamespacesClient.getByResourceGroup":"Microsoft.Relay.RelayNamespaces.get","com.azure.resourcemanager.relay.fluent.NamespacesClient.getByResourceGroupWithResponse":"Microsoft.Relay.RelayNamespaces.get","com.azure.resourcemanager.relay.fluent.NamespacesClient.getNetworkRuleSet":"Microsoft.Relay.NetworkRuleSets.getNetworkRuleSet","com.azure.resourcemanager.relay.fluent.NamespacesClient.getNetworkRuleSetWithResponse":"Microsoft.Relay.NetworkRuleSets.getNetworkRuleSet","com.azure.resourcemanager.relay.fluent.NamespacesClient.list":"Microsoft.Relay.RelayNamespaces.list","com.azure.resourcemanager.relay.fluent.NamespacesClient.listAuthorizationRules":"Microsoft.Relay.AuthorizationRules.listAuthorizationRules","com.azure.resourcemanager.relay.fluent.NamespacesClient.listByResourceGroup":"Microsoft.Relay.RelayNamespaces.listByResourceGroup","com.azure.resourcemanager.relay.fluent.NamespacesClient.listKeys":"Microsoft.Relay.AuthorizationRules.listKeys","com.azure.resourcemanager.relay.fluent.NamespacesClient.listKeysWithResponse":"Microsoft.Relay.AuthorizationRules.listKeys","com.azure.resourcemanager.relay.fluent.NamespacesClient.regenerateKeys":"Microsoft.Relay.AuthorizationRules.regenerateKeys","com.azure.resourcemanager.relay.fluent.NamespacesClient.regenerateKeysWithResponse":"Microsoft.Relay.AuthorizationRules.regenerateKeys","com.azure.resourcemanager.relay.fluent.NamespacesClient.update":"Microsoft.Relay.RelayNamespaces.update","com.azure.resourcemanager.relay.fluent.NamespacesClient.updateWithResponse":"Microsoft.Relay.RelayNamespaces.update","com.azure.resourcemanager.relay.fluent.OperationsClient":"Microsoft.Relay.Operations","com.azure.resourcemanager.relay.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.relay.fluent.PrivateEndpointConnectionsClient":"Microsoft.Relay.PrivateEndpointConnections","com.azure.resourcemanager.relay.fluent.PrivateEndpointConnectionsClient.beginDelete":"Microsoft.Relay.PrivateEndpointConnections.delete","com.azure.resourcemanager.relay.fluent.PrivateEndpointConnectionsClient.createOrUpdate":"Microsoft.Relay.PrivateEndpointConnections.createOrUpdate","com.azure.resourcemanager.relay.fluent.PrivateEndpointConnectionsClient.createOrUpdateWithResponse":"Microsoft.Relay.PrivateEndpointConnections.createOrUpdate","com.azure.resourcemanager.relay.fluent.PrivateEndpointConnectionsClient.delete":"Microsoft.Relay.PrivateEndpointConnections.delete","com.azure.resourcemanager.relay.fluent.PrivateEndpointConnectionsClient.get":"Microsoft.Relay.PrivateEndpointConnections.get","com.azure.resourcemanager.relay.fluent.PrivateEndpointConnectionsClient.getWithResponse":"Microsoft.Relay.PrivateEndpointConnections.get","com.azure.resourcemanager.relay.fluent.PrivateEndpointConnectionsClient.list":"Microsoft.Relay.PrivateEndpointConnections.list","com.azure.resourcemanager.relay.fluent.PrivateLinkResourcesClient":"Microsoft.Relay.PrivateLinkResources","com.azure.resourcemanager.relay.fluent.PrivateLinkResourcesClient.get":"Microsoft.Relay.PrivateLinkResources.get","com.azure.resourcemanager.relay.fluent.PrivateLinkResourcesClient.getWithResponse":"Microsoft.Relay.PrivateLinkResources.get","com.azure.resourcemanager.relay.fluent.PrivateLinkResourcesClient.list":"Microsoft.Relay.PrivateLinkResources.list","com.azure.resourcemanager.relay.fluent.PrivateLinkResourcesClient.listWithResponse":"Microsoft.Relay.PrivateLinkResources.list","com.azure.resourcemanager.relay.fluent.RelayManagementClient":"Microsoft.Relay","com.azure.resourcemanager.relay.fluent.WcfRelaysClient":"Microsoft.Relay.WCFRelays","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.createOrUpdate":"Microsoft.Relay.WcfRelaysOps.createOrUpdate","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.createOrUpdateAuthorizationRule":"Microsoft.Relay.WCFRelays.createOrUpdateAuthorizationRule","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.createOrUpdateAuthorizationRuleWithResponse":"Microsoft.Relay.WCFRelays.createOrUpdateAuthorizationRule","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.createOrUpdateWithResponse":"Microsoft.Relay.WcfRelaysOps.createOrUpdate","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.delete":"Microsoft.Relay.WcfRelaysOps.delete","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.deleteAuthorizationRule":"Microsoft.Relay.WCFRelays.deleteAuthorizationRule","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.deleteAuthorizationRuleWithResponse":"Microsoft.Relay.WCFRelays.deleteAuthorizationRule","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.deleteWithResponse":"Microsoft.Relay.WcfRelaysOps.delete","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.get":"Microsoft.Relay.WcfRelaysOps.get","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.getAuthorizationRule":"Microsoft.Relay.WCFRelays.getAuthorizationRule","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.getAuthorizationRuleWithResponse":"Microsoft.Relay.WCFRelays.getAuthorizationRule","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.getWithResponse":"Microsoft.Relay.WcfRelaysOps.get","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.listAuthorizationRules":"Microsoft.Relay.WCFRelays.listAuthorizationRules","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.listByNamespace":"Microsoft.Relay.WcfRelaysOps.listByNamespace","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.listKeys":"Microsoft.Relay.WCFRelays.listKeys","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.listKeysWithResponse":"Microsoft.Relay.WCFRelays.listKeys","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.regenerateKeys":"Microsoft.Relay.WCFRelays.regenerateKeys","com.azure.resourcemanager.relay.fluent.WcfRelaysClient.regenerateKeysWithResponse":"Microsoft.Relay.WCFRelays.regenerateKeys","com.azure.resourcemanager.relay.fluent.models.AccessKeysInner":"Microsoft.Relay.AccessKeys","com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner":"Microsoft.Relay.AuthorizationRule","com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleProperties":"Microsoft.Relay.AuthorizationRuleProperties","com.azure.resourcemanager.relay.fluent.models.CheckNameAvailabilityResultInner":"Microsoft.Relay.CheckNameAvailabilityResult","com.azure.resourcemanager.relay.fluent.models.HybridConnectionInner":"Microsoft.Relay.HybridConnection","com.azure.resourcemanager.relay.fluent.models.HybridConnectionProperties":"Microsoft.Relay.HybridConnectionProperties","com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner":"Microsoft.Relay.NetworkRuleSet","com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetProperties":"Microsoft.Relay.NetworkRuleSetProperties","com.azure.resourcemanager.relay.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner":"Microsoft.Relay.PrivateEndpointConnection","com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionProperties":"Microsoft.Relay.PrivateEndpointConnectionProperties","com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceInner":"Microsoft.Relay.PrivateLinkResource","com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceProperties":"Microsoft.Relay.PrivateLinkResourceProperties","com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourcesListResultInner":"Microsoft.Relay.PrivateLinkResourcesListResult","com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner":"Microsoft.Relay.RelayNamespace","com.azure.resourcemanager.relay.fluent.models.RelayNamespaceProperties":"Microsoft.Relay.RelayNamespaceProperties","com.azure.resourcemanager.relay.fluent.models.WcfRelayInner":"Microsoft.Relay.WcfRelay","com.azure.resourcemanager.relay.fluent.models.WcfRelayProperties":"Microsoft.Relay.WcfRelayProperties","com.azure.resourcemanager.relay.implementation.RelayManagementClientBuilder":"Microsoft.Relay","com.azure.resourcemanager.relay.implementation.models.AuthorizationRuleListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.relay.implementation.models.HybridConnectionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.relay.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.relay.implementation.models.PrivateEndpointConnectionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.relay.implementation.models.RelayNamespaceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.relay.implementation.models.WcfRelaysListResult":"Microsoft.Relay.WcfRelaysListResult","com.azure.resourcemanager.relay.models.AccessRights":"Microsoft.Relay.AccessRights","com.azure.resourcemanager.relay.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.relay.models.CheckNameAvailability":"Microsoft.Relay.CheckNameAvailability","com.azure.resourcemanager.relay.models.ConnectionState":"Microsoft.Relay.ConnectionState","com.azure.resourcemanager.relay.models.DefaultAction":"Microsoft.Relay.DefaultAction","com.azure.resourcemanager.relay.models.EndPointProvisioningState":"Microsoft.Relay.EndPointProvisioningState","com.azure.resourcemanager.relay.models.KeyType":"Microsoft.Relay.KeyType","com.azure.resourcemanager.relay.models.NWRuleSetIpRules":"Microsoft.Relay.NWRuleSetIpRules","com.azure.resourcemanager.relay.models.NetworkRuleIPAction":"Microsoft.Relay.NetworkRuleIPAction","com.azure.resourcemanager.relay.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.relay.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.relay.models.PrivateEndpoint":"Microsoft.Relay.PrivateEndpoint","com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus":"Microsoft.Relay.PrivateLinkConnectionStatus","com.azure.resourcemanager.relay.models.PublicNetworkAccess":"Microsoft.Relay.PublicNetworkAccess","com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters":"Microsoft.Relay.RegenerateAccessKeyParameters","com.azure.resourcemanager.relay.models.RelayUpdateParameters":"Microsoft.Relay.RelayUpdateParameters","com.azure.resourcemanager.relay.models.Relaytype":"Microsoft.Relay.Relaytype","com.azure.resourcemanager.relay.models.ResourceNamespacePatch":"Microsoft.Relay.ResourceNamespacePatch","com.azure.resourcemanager.relay.models.Sku":"Microsoft.Relay.Sku","com.azure.resourcemanager.relay.models.SkuName":"Microsoft.Relay.SkuName","com.azure.resourcemanager.relay.models.SkuTier":"Microsoft.Relay.SkuTier","com.azure.resourcemanager.relay.models.TlsVersion":"Microsoft.Relay.TlsVersion","com.azure.resourcemanager.relay.models.UnavailableReason":"Microsoft.Relay.UnavailableReason"},"generatedFiles":["src/main/java/com/azure/resourcemanager/relay/RelayManager.java","src/main/java/com/azure/resourcemanager/relay/fluent/HybridConnectionsClient.java","src/main/java/com/azure/resourcemanager/relay/fluent/NamespacesClient.java","src/main/java/com/azure/resourcemanager/relay/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/relay/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/relay/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/relay/fluent/RelayManagementClient.java","src/main/java/com/azure/resourcemanager/relay/fluent/WcfRelaysClient.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/AccessKeysInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleProperties.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/CheckNameAvailabilityResultInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionProperties.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetProperties.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourcesListResultInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceProperties.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayInner.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayProperties.java","src/main/java/com/azure/resourcemanager/relay/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/relay/fluent/package-info.java","src/main/java/com/azure/resourcemanager/relay/implementation/AccessKeysImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/AuthorizationRuleImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/CheckNameAvailabilityResultImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionsImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesClientImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/NetworkRuleSetImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesListResultImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/RelayManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/relay/implementation/RelayManagementClientImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/RelayNamespaceImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelayImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysClientImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysImpl.java","src/main/java/com/azure/resourcemanager/relay/implementation/models/AuthorizationRuleListResult.java","src/main/java/com/azure/resourcemanager/relay/implementation/models/HybridConnectionListResult.java","src/main/java/com/azure/resourcemanager/relay/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/relay/implementation/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/relay/implementation/models/RelayNamespaceListResult.java","src/main/java/com/azure/resourcemanager/relay/implementation/models/WcfRelaysListResult.java","src/main/java/com/azure/resourcemanager/relay/implementation/package-info.java","src/main/java/com/azure/resourcemanager/relay/models/AccessKeys.java","src/main/java/com/azure/resourcemanager/relay/models/AccessRights.java","src/main/java/com/azure/resourcemanager/relay/models/ActionType.java","src/main/java/com/azure/resourcemanager/relay/models/AuthorizationRule.java","src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailability.java","src/main/java/com/azure/resourcemanager/relay/models/CheckNameAvailabilityResult.java","src/main/java/com/azure/resourcemanager/relay/models/ConnectionState.java","src/main/java/com/azure/resourcemanager/relay/models/DefaultAction.java","src/main/java/com/azure/resourcemanager/relay/models/EndPointProvisioningState.java","src/main/java/com/azure/resourcemanager/relay/models/HybridConnection.java","src/main/java/com/azure/resourcemanager/relay/models/HybridConnections.java","src/main/java/com/azure/resourcemanager/relay/models/KeyType.java","src/main/java/com/azure/resourcemanager/relay/models/NWRuleSetIpRules.java","src/main/java/com/azure/resourcemanager/relay/models/Namespaces.java","src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleIPAction.java","src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleSet.java","src/main/java/com/azure/resourcemanager/relay/models/Operation.java","src/main/java/com/azure/resourcemanager/relay/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/relay/models/Operations.java","src/main/java/com/azure/resourcemanager/relay/models/Origin.java","src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkConnectionStatus.java","src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResource.java","src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResources.java","src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResourcesListResult.java","src/main/java/com/azure/resourcemanager/relay/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/relay/models/RegenerateAccessKeyParameters.java","src/main/java/com/azure/resourcemanager/relay/models/RelayNamespace.java","src/main/java/com/azure/resourcemanager/relay/models/RelayUpdateParameters.java","src/main/java/com/azure/resourcemanager/relay/models/Relaytype.java","src/main/java/com/azure/resourcemanager/relay/models/ResourceNamespacePatch.java","src/main/java/com/azure/resourcemanager/relay/models/Sku.java","src/main/java/com/azure/resourcemanager/relay/models/SkuName.java","src/main/java/com/azure/resourcemanager/relay/models/SkuTier.java","src/main/java/com/azure/resourcemanager/relay/models/TlsVersion.java","src/main/java/com/azure/resourcemanager/relay/models/UnavailableReason.java","src/main/java/com/azure/resourcemanager/relay/models/WcfRelay.java","src/main/java/com/azure/resourcemanager/relay/models/WcfRelays.java","src/main/java/com/azure/resourcemanager/relay/models/package-info.java","src/main/java/com/azure/resourcemanager/relay/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-relay/proxy-config.json b/sdk/relay/azure-resourcemanager-relay/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-relay/proxy-config.json index fcd67bed22bb..85ec0e0a8a08 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-relay/proxy-config.json +++ b/sdk/relay/azure-resourcemanager-relay/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-relay/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.relay.implementation.HybridConnectionsClientImpl$HybridConnectionsService"],["com.azure.resourcemanager.relay.implementation.NamespacesClientImpl$NamespacesService"],["com.azure.resourcemanager.relay.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.relay.implementation.WcfRelaysClientImpl$WcfRelaysService"]] \ No newline at end of file +[["com.azure.resourcemanager.relay.implementation.HybridConnectionsClientImpl$HybridConnectionsService"],["com.azure.resourcemanager.relay.implementation.NamespacesClientImpl$NamespacesService"],["com.azure.resourcemanager.relay.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.relay.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.relay.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.relay.implementation.WcfRelaysClientImpl$WcfRelaysService"]] \ No newline at end of file diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/resources/azure-resourcemanager-relay.properties b/sdk/relay/azure-resourcemanager-relay/src/main/resources/azure-resourcemanager-relay.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/resources/azure-resourcemanager-relay.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateAuthorizationRuleSamples.java index 12604363db0e..02215938eb11 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateAuthorizationRuleSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateAuthorizationRuleSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -13,9 +13,7 @@ */ public final class HybridConnectionsCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAuthorizationRuleCreate.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleCreate.json */ /** * Sample code: RelayHybridConnectionAuthorizationRuleCreate. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateSamples.java index 3a190454f4bc..b4c725f2a4a3 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,9 +9,7 @@ */ public final class HybridConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionCreate.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionCreate.json */ /** * Sample code: RelayHybridConnectionCreate. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteAuthorizationRuleSamples.java index b45b7a4b92d7..6048bf67644d 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteAuthorizationRuleSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteAuthorizationRuleSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,17 +9,15 @@ */ public final class HybridConnectionsDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAutorizationRuleDelete.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleDelete.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleDelete. + * Sample code: RelayHybridConnectionAuthorizationRuleDelete. * * @param manager Entry point to RelayManager. */ public static void - relayHybridConnectionAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + relayHybridConnectionAuthorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { manager.hybridConnections() .deleteAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteSamples.java index b73a55dd9ec8..adc728c463c9 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,9 +9,7 @@ */ public final class HybridConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridconnectionDelete.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridconnectionDelete.json */ /** * Sample code: RelayHybridconnectionDelete. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetAuthorizationRuleSamples.java index 11325b24ae77..7faebf62c784 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetAuthorizationRuleSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetAuthorizationRuleSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,16 +9,14 @@ */ public final class HybridConnectionsGetAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAutorizationRuleGet.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleGet.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleGet. + * Sample code: RelayHybridConnectionAuthorizationRuleGet. * * @param manager Entry point to RelayManager. */ - public static void relayHybridConnectionAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayHybridConnectionAuthorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { manager.hybridConnections() .getAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetSamples.java index 692c3fed3c2e..82ab73ed055f 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,9 +9,7 @@ */ public final class HybridConnectionsGetSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionGet.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionGet.json */ /** * Sample code: RelayHybridConnectionGet. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListAuthorizationRulesSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListAuthorizationRulesSamples.java index a9ae09528ba4..a5fea65f0a10 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListAuthorizationRulesSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListAuthorizationRulesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,17 +9,15 @@ */ public final class HybridConnectionsListAuthorizationRulesSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAutorizationRuleListAll.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleListAll.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleListAll. + * Sample code: RelayHybridConnectionAuthorizationRuleListAll. * * @param manager Entry point to RelayManager. */ public static void - relayHybridConnectionAutorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { + relayHybridConnectionAuthorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { manager.hybridConnections() .listAuthorizationRules("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListByNamespaceSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListByNamespaceSamples.java index e57081d44d8f..8dd614b9c2d6 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListByNamespaceSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListByNamespaceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,9 +9,7 @@ */ public final class HybridConnectionsListByNamespaceSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionListAll.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionListAll.json */ /** * Sample code: RelayHybridConnectionListAll. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListKeysSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListKeysSamples.java index f4cd622b32fd..7492fe041823 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListKeysSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListKeysSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,9 +9,7 @@ */ public final class HybridConnectionsListKeysSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAuthorizationRuleListKey.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleListKey.json */ /** * Sample code: RelayHybridConnectionAuthorizationRuleListKey. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsRegenerateKeysSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsRegenerateKeysSamples.java index 30a84f7a0541..0d9e54e28915 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsRegenerateKeysSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsRegenerateKeysSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -12,17 +12,15 @@ */ public final class HybridConnectionsRegenerateKeysSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/ - * RelayHybridConnectionAuthorizationRuleRegenrateKey.json + * x-ms-original-file: 2026-01-01/HybridConnection/RelayHybridConnectionAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayHybridConnectionAuthorizationRuleRegenrateKey. + * Sample code: RelayHybridConnectionAuthorizationRuleRegenerateKey. * * @param manager Entry point to RelayManager. */ public static void - relayHybridConnectionAuthorizationRuleRegenrateKey(com.azure.resourcemanager.relay.RelayManager manager) { + relayHybridConnectionAuthorizationRuleRegenerateKey(com.azure.resourcemanager.relay.RelayManager manager) { manager.hybridConnections() .regenerateKeysWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", "example-RelayAuthRules-01", new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCheckNameAvailabilitySamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCheckNameAvailabilitySamples.java index b6a76e56a9c8..76e63e1aa5e0 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCheckNameAvailabilitySamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCheckNameAvailabilitySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -11,8 +11,7 @@ */ public final class NamespacesCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceCheckNameAvailability.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceCheckNameAvailability.json */ /** * Sample code: RelayCheckNameAvailability. @@ -21,7 +20,7 @@ public final class NamespacesCheckNameAvailabilitySamples { */ public static void relayCheckNameAvailability(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() - .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("sdk-Namespace1321"), + .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("example-RelayNamespace1321"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java index 4b618db0d9d6..8905b96fd0d3 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -12,8 +12,7 @@ */ public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAuthorizationRuleCreate.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleCreate.json */ /** * Sample code: RelayNameSpaceAuthorizationRuleCreate. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java new file mode 100644 index 000000000000..032d157685b6 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.generated; + +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.NetworkRuleIPAction; +import java.util.Arrays; + +/** + * Samples for Namespaces CreateOrUpdateNetworkRuleSet. + */ +public final class NamespacesCreateOrUpdateNetworkRuleSetSamples { + /* + * x-ms-original-file: 2026-01-01/VirtualNetworkRules/RelayNetworkRuleSetCreate.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpaceNetworkRuleSetCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager.namespaces() + .createOrUpdateNetworkRuleSetWithResponse("ResourceGroup", "example-RelayNamespace-6019", + new NetworkRuleSetInner().withTrustedServiceAccessEnabled(false) + .withDefaultAction(DefaultAction.DENY) + .withIpRules(Arrays.asList( + new NWRuleSetIpRules().withIpMask("1.1.1.1").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.2").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.3").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.4").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("1.1.1.5").withAction(NetworkRuleIPAction.ALLOW))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateSamples.java index b94a9cddeb51..f0315a6c75a6 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateSamples.java @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.util.HashMap; import java.util.Map; @@ -14,9 +16,7 @@ */ public final class NamespacesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceCreate. - * json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceCreate.json */ /** * Sample code: RelayNamespaceCreate. @@ -25,11 +25,12 @@ public final class NamespacesCreateOrUpdateSamples { */ public static void relayNamespaceCreate(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() - .define("example-RelayNamespace-01") - .withRegion("West US") + .define("example-RelayNamespace-5849") + .withRegion("South Central US") .withExistingResourceGroup("resourcegroup") .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withSku(new Sku().withTier(SkuTier.STANDARD)) + .withSku(new Sku().withName(SkuName.STANDARD).withTier(SkuTier.STANDARD)) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) .create(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteAuthorizationRuleSamples.java index d68e757450a9..0bb872038943 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteAuthorizationRuleSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteAuthorizationRuleSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,15 +9,14 @@ */ public final class NamespacesDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAutorizationRuleDelete.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleDelete.json */ /** - * Sample code: RelayNameSpaceAutorizationRuleDelete. + * Sample code: RelayNameSpaceAuthorizationRuleDelete. * * @param manager Entry point to RelayManager. */ - public static void relayNameSpaceAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayNameSpaceAuthorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() .deleteAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteSamples.java index 40a00f1445e6..aaed260b49d4 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,9 +9,7 @@ */ public final class NamespacesDeleteSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceDelete. - * json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceDelete.json */ /** * Sample code: RelayNameSpaceDelete. @@ -19,6 +17,6 @@ public final class NamespacesDeleteSamples { * @param manager Entry point to RelayManager. */ public static void relayNameSpaceDelete(com.azure.resourcemanager.relay.RelayManager manager) { - manager.namespaces().delete("resourcegroup", "example-RelayNamespace-01", com.azure.core.util.Context.NONE); + manager.namespaces().delete("SouthCentralUS", "example-RelayNamespace-5849", com.azure.core.util.Context.NONE); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetAuthorizationRuleSamples.java index 2742f54494e4..7566de297f12 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetAuthorizationRuleSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetAuthorizationRuleSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,15 +9,14 @@ */ public final class NamespacesGetAuthorizationRuleSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAutorizationRuleGet.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleGet.json */ /** - * Sample code: RelayNameSpaceAutorizationRuleGet. + * Sample code: RelayNameSpaceAuthorizationRuleGet. * * @param manager Entry point to RelayManager. */ - public static void relayNameSpaceAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayNameSpaceAuthorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() .getAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupSamples.java index 0528f7ca8dca..eda379e7ab01 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,8 +9,7 @@ */ public final class NamespacesGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceGet.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceGet.json */ /** * Sample code: RelayNameSpaceGet. @@ -19,7 +18,7 @@ public final class NamespacesGetByResourceGroupSamples { */ public static void relayNameSpaceGet(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() - .getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", + .getByResourceGroupWithResponse("RG-eg", "example-RelayRelayNamespace-01", com.azure.core.util.Context.NONE); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetNetworkRuleSetSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetNetworkRuleSetSamples.java new file mode 100644 index 000000000000..bf7df9c63c0f --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetNetworkRuleSetSamples.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.relay.generated; + +/** + * Samples for Namespaces GetNetworkRuleSet. + */ +public final class NamespacesGetNetworkRuleSetSamples { + /* + * x-ms-original-file: 2026-01-01/VirtualNetworkRules/RelayNetworkRuleSetGet.json + */ + /** + * Sample code: NameSpaceNetworkRuleSetGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpaceNetworkRuleSetGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager.namespaces() + .getNetworkRuleSetWithResponse("ResourceGroup", "example-RelayNamespace-6019", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListAuthorizationRulesSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListAuthorizationRulesSamples.java index 57e20c59f6ba..ef76886f8ca4 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListAuthorizationRulesSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListAuthorizationRulesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,15 +9,14 @@ */ public final class NamespacesListAuthorizationRulesSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAutorizationRuleListAll.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleListAll.json */ /** - * Sample code: RelayNameSpaceAutorizationRuleListAll. + * Sample code: RelayNameSpaceAuthorizationRuleListAll. * * @param manager Entry point to RelayManager. */ - public static void relayNameSpaceAutorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayNameSpaceAuthorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() .listAuthorizationRules("resourcegroup", "example-RelayNamespace-01", com.azure.core.util.Context.NONE); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListByResourceGroupSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListByResourceGroupSamples.java index 119be39dc183..90a0f7e0d8a6 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListByResourceGroupSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,8 +9,7 @@ */ public final class NamespacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceListByResourceGroup.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceListByResourceGroup.json */ /** * Sample code: RelayNameSpaceListByResourceGroup. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListKeysSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListKeysSamples.java index 5a645f1a1d0e..85376b2ba7c9 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListKeysSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListKeysSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,8 +9,7 @@ */ public final class NamespacesListKeysSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAuthorizationRuleListKey.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleListKey.json */ /** * Sample code: RelayNameSpaceAuthorizationRuleListKey. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListSamples.java index 4e38baaff3a6..69635a0699a7 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,8 +9,7 @@ */ public final class NamespacesListSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceListBySubscription.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceListBySubscription.json */ /** * Sample code: RelayNameSpaceListBySubscription. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesRegenerateKeysSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesRegenerateKeysSamples.java index 470d4eee6de4..9a94dd5af2c3 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesRegenerateKeysSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesRegenerateKeysSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -12,16 +12,15 @@ */ public final class NamespacesRegenerateKeysSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/ - * RelayNameSpaceAuthorizationRuleRegenrateKey.json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayNameSpaceAuthorizationRuleRegenrateKey. + * Sample code: RelayNameSpaceAuthorizationRuleRegenerateKey. * * @param manager Entry point to RelayManager. */ public static void - relayNameSpaceAuthorizationRuleRegenrateKey(com.azure.resourcemanager.relay.RelayManager manager) { + relayNameSpaceAuthorizationRuleRegenerateKey(com.azure.resourcemanager.relay.RelayManager manager) { manager.namespaces() .regenerateKeysWithResponse("resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesUpdateSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesUpdateSamples.java index c07f66e27a4b..f69886362936 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesUpdateSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesUpdateSamples.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.resourcemanager.relay.models.RelayNamespace; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.util.HashMap; import java.util.Map; @@ -13,9 +14,7 @@ */ public final class NamespacesUpdateSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceUpdate. - * json + * x-ms-original-file: 2026-01-01/NameSpaces/RelayNameSpaceUpdate.json */ /** * Sample code: RelayNameSpaceUpdate. @@ -24,11 +23,11 @@ public final class NamespacesUpdateSamples { */ public static void relayNameSpaceUpdate(com.azure.resourcemanager.relay.RelayManager manager) { RelayNamespace resource = manager.namespaces() - .getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", - com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("RG-eg", "example-RelayRelayNamespace-01", com.azure.core.util.Context.NONE) .getValue(); resource.update() .withTags(mapOf("tag3", "value3", "tag4", "value4", "tag5", "value5", "tag6", "value6")) + .withMinimumTlsVersion(TlsVersion.ONE_THREE) .apply(); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/OperationsListSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/OperationsListSamples.java index 823de745ae79..516655caff9d 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/OperationsListSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,8 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/RelayOperations_List.json + * x-ms-original-file: 2026-01-01/RelayOperations_List.json */ /** * Sample code: RelayOperationsList. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8e3744832a86 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.generated; + +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnectionsCreate.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateEndPointConnectionCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateEndpointConnections() + .define("{privateEndpointConnection name}") + .withExistingNamespace("resourcegroup", "example-RelayNamespace-5849") + .withPrivateEndpoint(new PrivateEndpoint().withId( + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourcegroup/providers/Microsoft.Network/privateEndpoints/ali-relay-pve-1")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.APPROVED).withDescription("You may pass")) + .create(); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..d6b8080c4a37 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsDeleteSamples.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.relay.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnectionsDelete.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateEndPointConnectionDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateEndpointConnections() + .delete("myResourceGroup", "example-RelayNamespace-5849", "{privateEndpointConnection name}", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..c82b04496e69 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsGetSamples.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.relay.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnectionsGet.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateEndPointConnectionGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateEndpointConnections() + .getWithResponse("myResourceGroup", "example-RelayNamespace-5849", "{privateEndpointConnection name}", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsListSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..4d1ced80f6ec --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsListSamples.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.relay.generated; + +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnectionsList.json + */ + /** + * Sample code: PrivateEndpointConnectionsList. + * + * @param manager Entry point to RelayManager. + */ + public static void privateEndpointConnectionsList(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateEndpointConnections() + .list("myResourceGroup", "example-RelayNamespace-5849", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesGetSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..f288e3d5bdb5 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesGetSamples.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.relay.generated; + +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateLinkResourcesGet.json + */ + /** + * Sample code: NameSpacePrivateLinkResourceGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateLinkResourceGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateLinkResources() + .getWithResponse("resourcegroup", "example-RelayNamespace-5849", "{PrivateLinkResource name}", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListSamples.java new file mode 100644 index 000000000000..99915d0a3879 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListSamples.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.relay.generated; + +/** + * Samples for PrivateLinkResources List. + */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateLinkResourcesList.json + */ + /** + * Sample code: NameSpacePrivateLinkResourcesGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateLinkResourcesGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager.privateLinkResources() + .listWithResponse("resourcegroup", "example-RelayNamespace-5849", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateAuthorizationRuleSamples.java index a7c7fd56aa6f..5a7e9efec87a 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateAuthorizationRuleSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateAuthorizationRuleSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -13,8 +13,7 @@ */ public final class WcfRelaysCreateOrUpdateAuthorizationRuleSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/ - * RelayAuthorizationRuleCreate.json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleCreate.json */ /** * Sample code: RelayAuthorizationRuleCreate. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateSamples.java index 2fb0bad9303a..8a81c4fa92fe 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -11,8 +11,7 @@ */ public final class WcfRelaysCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayCreate.json + * x-ms-original-file: 2026-01-01/Relay/RelayCreate.json */ /** * Sample code: RelayCreate. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteAuthorizationRuleSamples.java index 10da91e2ae62..5dc547a55ca2 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteAuthorizationRuleSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteAuthorizationRuleSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,16 +9,14 @@ */ public final class WcfRelaysDeleteAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayAutorizationRuleDelete - * .json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleDelete.json */ /** - * Sample code: RelayAutorizationRuleDelete. + * Sample code: RelayAuthorizationRuleDelete. * * @param manager Entry point to RelayManager. */ - public static void relayAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayAuthorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { manager.wcfRelays() .deleteAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-wcf-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteSamples.java index a2e428d38a93..16213c28d9c3 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,8 +9,7 @@ */ public final class WcfRelaysDeleteSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayDelete.json + * x-ms-original-file: 2026-01-01/Relay/RelayDelete.json */ /** * Sample code: RelayDelete. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleSamples.java index 41d9c7dd5ca0..2cc3cb0a927d 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,16 +9,14 @@ */ public final class WcfRelaysGetAuthorizationRuleSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayAutorizationRuleGet. - * json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleGet.json */ /** - * Sample code: RelayAutorizationRuleGet. + * Sample code: RelayAuthorizationRuleGet. * * @param manager Entry point to RelayManager. */ - public static void relayAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayAuthorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { manager.wcfRelays() .getAuthorizationRuleWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-wcf-01", "example-RelayAuthRules-01", com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetSamples.java index 55f47546d4bb..7a7ba7148e7d 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,8 +9,7 @@ */ public final class WcfRelaysGetSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayGet.json + * x-ms-original-file: 2026-01-01/Relay/RelayGet.json */ /** * Sample code: RelayGet. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListAuthorizationRulesSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListAuthorizationRulesSamples.java index d64fb5fe52e0..f88499676aab 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListAuthorizationRulesSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListAuthorizationRulesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,15 +9,14 @@ */ public final class WcfRelaysListAuthorizationRulesSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/ - * RelayAutorizationRuleListAll.json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleListAll.json */ /** - * Sample code: RelayAutorizationRuleListAll. + * Sample code: RelayAuthorizationRuleListAll. * * @param manager Entry point to RelayManager. */ - public static void relayAutorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayAuthorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { manager.wcfRelays() .listAuthorizationRules("resourcegroup", "example-RelayNamespace-01", "example-Relay-Wcf-01", com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListByNamespaceSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListByNamespaceSamples.java index b2340c838db4..f32543a39f85 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListByNamespaceSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListByNamespaceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,8 +9,7 @@ */ public final class WcfRelaysListByNamespaceSamples { /* - * x-ms-original-file: - * specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayListAll.json + * x-ms-original-file: 2026-01-01/Relay/RelayListAll.json */ /** * Sample code: RelayListAll. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListKeysSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListKeysSamples.java index 78f7a4cc1c2d..9de39bb8138c 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListKeysSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListKeysSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -9,8 +9,7 @@ */ public final class WcfRelaysListKeysSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/ - * RelayAuthorizationRuleListKey.json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleListKey.json */ /** * Sample code: RelayAuthorizationRuleListKey.json. diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysRegenerateKeysSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysRegenerateKeysSamples.java index 407e727997b5..be86214b40e2 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysRegenerateKeysSamples.java +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysRegenerateKeysSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -12,15 +12,14 @@ */ public final class WcfRelaysRegenerateKeysSamples { /* - * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/ - * RelayAuthorizationRuleRegenrateKey.json + * x-ms-original-file: 2026-01-01/Relay/RelayAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayAuthorizationRuleRegenrateKey.json. + * Sample code: RelayAuthorizationRuleRegenerateKey.json. * * @param manager Entry point to RelayManager. */ - public static void relayAuthorizationRuleRegenrateKeyJson(com.azure.resourcemanager.relay.RelayManager manager) { + public static void relayAuthorizationRuleRegenerateKeyJson(com.azure.resourcemanager.relay.RelayManager manager) { manager.wcfRelays() .regenerateKeysWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-wcf-01", "example-RelayAuthRules-01", new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRuleInnerTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRuleInnerTests.java index 45f86b12d7fa..01dfe6e87b2f 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRuleInnerTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRuleInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -13,16 +13,16 @@ public final class AuthorizationRuleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AuthorizationRuleInner model = BinaryData - .fromString( - "{\"properties\":{\"rights\":[\"Listen\"]},\"id\":\"tynqgoul\",\"name\":\"ndlik\",\"type\":\"yqkgfg\"}") + AuthorizationRuleInner model = BinaryData.fromString( + "{\"properties\":{\"rights\":[\"Listen\",\"Send\",\"Listen\",\"Listen\"]},\"location\":\"gnwzsymglzufc\",\"id\":\"kohdbiha\",\"name\":\"ufhfcbjysa\",\"type\":\"ithxqhabifpi\"}") .toObject(AuthorizationRuleInner.class); Assertions.assertEquals(AccessRights.LISTEN, model.rights().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AuthorizationRuleInner model = new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN)); + AuthorizationRuleInner model = new AuthorizationRuleInner().withRights( + Arrays.asList(AccessRights.LISTEN, AccessRights.SEND, AccessRights.LISTEN, AccessRights.LISTEN)); model = BinaryData.fromObject(model).toObject(AuthorizationRuleInner.class); Assertions.assertEquals(AccessRights.LISTEN, model.rights().get(0)); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRuleListResultTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRuleListResultTests.java index 43eba6d1f75b..b37d3758f54b 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRuleListResultTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRuleListResultTests.java @@ -1,40 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.relay.implementation.models.AuthorizationRuleListResult; import com.azure.resourcemanager.relay.models.AccessRights; -import com.azure.resourcemanager.relay.models.AuthorizationRuleListResult; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class AuthorizationRuleListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AuthorizationRuleListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"rights\":[\"Listen\",\"Manage\"]},\"id\":\"jitcjczdzevn\",\"name\":\"hkr\",\"type\":\"pdappds\"},{\"properties\":{\"rights\":[\"Manage\",\"Manage\",\"Manage\"]},\"id\":\"rwjfe\",\"name\":\"snhu\",\"type\":\"je\"},{\"properties\":{\"rights\":[\"Send\",\"Send\",\"Listen\",\"Send\"]},\"id\":\"hugjzzdatqxhoc\",\"name\":\"geablgphuticndvk\",\"type\":\"ozwyiftyhxhuro\"},{\"properties\":{\"rights\":[\"Manage\",\"Send\",\"Listen\"]},\"id\":\"olniwpwcukjf\",\"name\":\"giawx\",\"type\":\"lryplwckbasyy\"}],\"nextLink\":\"ddhsgcbacphe\"}") + "{\"value\":[{\"properties\":{\"rights\":[\"Listen\",\"Send\",\"Listen\"]},\"location\":\"x\",\"id\":\"ivyqniwbybrkxvd\",\"name\":\"mjgr\",\"type\":\"fwvuk\"},{\"properties\":{\"rights\":[\"Listen\",\"Send\",\"Send\"]},\"location\":\"snhsjcnyejhkryh\",\"id\":\"apcz\",\"name\":\"lokjyemkk\",\"type\":\"ni\"}],\"nextLink\":\"oxzjnchgejspod\"}") .toObject(AuthorizationRuleListResult.class); Assertions.assertEquals(AccessRights.LISTEN, model.value().get(0).rights().get(0)); - Assertions.assertEquals("ddhsgcbacphe", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AuthorizationRuleListResult model = new AuthorizationRuleListResult() - .withValue(Arrays.asList( - new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.MANAGE)), - new AuthorizationRuleInner() - .withRights(Arrays.asList(AccessRights.MANAGE, AccessRights.MANAGE, AccessRights.MANAGE)), - new AuthorizationRuleInner().withRights( - Arrays.asList(AccessRights.SEND, AccessRights.SEND, AccessRights.LISTEN, AccessRights.SEND)), - new AuthorizationRuleInner() - .withRights(Arrays.asList(AccessRights.MANAGE, AccessRights.SEND, AccessRights.LISTEN)))) - .withNextLink("ddhsgcbacphe"); - model = BinaryData.fromObject(model).toObject(AuthorizationRuleListResult.class); - Assertions.assertEquals(AccessRights.LISTEN, model.value().get(0).rights().get(0)); - Assertions.assertEquals("ddhsgcbacphe", model.nextLink()); + Assertions.assertEquals("oxzjnchgejspod", model.nextLink()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRulePropertiesTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRulePropertiesTests.java index f54e19eefb8f..cfa39c84d663 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRulePropertiesTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/AuthorizationRulePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -13,15 +13,15 @@ public final class AuthorizationRulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AuthorizationRuleProperties model - = BinaryData.fromString("{\"rights\":[\"Manage\",\"Send\"]}").toObject(AuthorizationRuleProperties.class); + AuthorizationRuleProperties model = BinaryData.fromString("{\"rights\":[\"Manage\",\"Manage\",\"Send\"]}") + .toObject(AuthorizationRuleProperties.class); Assertions.assertEquals(AccessRights.MANAGE, model.rights().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AuthorizationRuleProperties model - = new AuthorizationRuleProperties().withRights(Arrays.asList(AccessRights.MANAGE, AccessRights.SEND)); + AuthorizationRuleProperties model = new AuthorizationRuleProperties() + .withRights(Arrays.asList(AccessRights.MANAGE, AccessRights.MANAGE, AccessRights.SEND)); model = BinaryData.fromObject(model).toObject(AuthorizationRuleProperties.class); Assertions.assertEquals(AccessRights.MANAGE, model.rights().get(0)); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/CheckNameAvailabilityResultInnerTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/CheckNameAvailabilityResultInnerTests.java index cefd647d42ae..bce57dd99828 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/CheckNameAvailabilityResultInnerTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/CheckNameAvailabilityResultInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -12,19 +12,10 @@ public final class CheckNameAvailabilityResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CheckNameAvailabilityResultInner model - = BinaryData.fromString("{\"message\":\"usarhmofc\",\"nameAvailable\":false,\"reason\":\"NameInLockdown\"}") - .toObject(CheckNameAvailabilityResultInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(UnavailableReason.NAME_IN_LOCKDOWN, model.reason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResultInner model = new CheckNameAvailabilityResultInner().withNameAvailable(false) - .withReason(UnavailableReason.NAME_IN_LOCKDOWN); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResultInner.class); - Assertions.assertEquals(false, model.nameAvailable()); - Assertions.assertEquals(UnavailableReason.NAME_IN_LOCKDOWN, model.reason()); + CheckNameAvailabilityResultInner model = BinaryData + .fromString("{\"message\":\"qhgyxzkonocukok\",\"nameAvailable\":false,\"reason\":\"NameInUse\"}") + .toObject(CheckNameAvailabilityResultInner.class); + Assertions.assertFalse(model.nameAvailable()); + Assertions.assertEquals(UnavailableReason.NAME_IN_USE, model.reason()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/CheckNameAvailabilityTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/CheckNameAvailabilityTests.java index 870aadd80dbc..dd8a75c99829 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/CheckNameAvailabilityTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/CheckNameAvailabilityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -11,15 +11,14 @@ public final class CheckNameAvailabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CheckNameAvailability model - = BinaryData.fromString("{\"name\":\"upewnwreitjzy\"}").toObject(CheckNameAvailability.class); - Assertions.assertEquals("upewnwreitjzy", model.name()); + CheckNameAvailability model = BinaryData.fromString("{\"name\":\"eun\"}").toObject(CheckNameAvailability.class); + Assertions.assertEquals("eun", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CheckNameAvailability model = new CheckNameAvailability().withName("upewnwreitjzy"); + CheckNameAvailability model = new CheckNameAvailability().withName("eun"); model = BinaryData.fromObject(model).toObject(CheckNameAvailability.class); - Assertions.assertEquals("upewnwreitjzy", model.name()); + Assertions.assertEquals("eun", model.name()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/ConnectionStateTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/ConnectionStateTests.java new file mode 100644 index 000000000000..a1f591682f4f --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/ConnectionStateTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class ConnectionStateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectionState model = BinaryData.fromString("{\"status\":\"Pending\",\"description\":\"mayhuybbkpodepoo\"}") + .toObject(ConnectionState.class); + Assertions.assertEquals(PrivateLinkConnectionStatus.PENDING, model.status()); + Assertions.assertEquals("mayhuybbkpodepoo", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectionState model + = new ConnectionState().withStatus(PrivateLinkConnectionStatus.PENDING).withDescription("mayhuybbkpodepoo"); + model = BinaryData.fromObject(model).toObject(ConnectionState.class); + Assertions.assertEquals(PrivateLinkConnectionStatus.PENDING, model.status()); + Assertions.assertEquals("mayhuybbkpodepoo", model.description()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateAuthorizationRuleWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateAuthorizationRuleWithResponseMockTests.java index 1ee643255cff..b6d4ae76a908 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateAuthorizationRuleWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; @@ -24,21 +24,22 @@ public final class HybridConnectionsCreateOrUpdateAuthorizationRuleWithResponseM @Test public void testCreateOrUpdateAuthorizationRuleWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"rights\":[\"Send\",\"Manage\"]},\"id\":\"yifqrvkdvjsllrmv\",\"name\":\"d\",\"type\":\"watkpnpulexxb\"}"; + = "{\"properties\":{\"rights\":[\"Listen\",\"Listen\"]},\"location\":\"ijggmebfsiar\",\"id\":\"trcvpnazzmh\",\"name\":\"runmp\",\"type\":\"ttdbhrbnl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AuthorizationRule response = manager.hybridConnections() - .createOrUpdateAuthorizationRuleWithResponse("uaxbezyiuokkt", "hrdxwzywqsmbs", "reximoryocfs", "ksymd", - new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN)), + .createOrUpdateAuthorizationRuleWithResponse("bijhtxfvgxbf", "mxnehmp", "ec", "godebfqkkrbmpu", + new AuthorizationRuleInner() + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND, AccessRights.LISTEN)), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(AccessRights.SEND, response.rights().get(0)); + Assertions.assertEquals(AccessRights.LISTEN, response.rights().get(0)); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteAuthorizationRuleWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteAuthorizationRuleWithResponseMockTests.java index 198eb820b620..f718b7abce42 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteAuthorizationRuleWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteAuthorizationRuleWithResponse() throws Exception { RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.hybridConnections() - .deleteAuthorizationRuleWithResponse("zwtruwiqzbqjvsov", "yokacspkw", "hzdobpxjmflbvvnc", "rkcciwwzjuqk", + .deleteAuthorizationRuleWithResponse("nkxmyskpbhenbtk", "xywnytnrsynlqidy", "yxczfclh", "axdbabph", com.azure.core.util.Context.NONE); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteWithResponseMockTests.java index d330392596d3..5f5a188fef65 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteWithResponse() throws Exception { RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.hybridConnections().deleteWithResponse("ezrkgqhcjrefo", "gm", "qsl", com.azure.core.util.Context.NONE); + manager.hybridConnections() + .deleteWithResponse("yighxpk", "wzbaiue", "baumnyqupedeoj", com.azure.core.util.Context.NONE); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetAuthorizationRuleWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetAuthorizationRuleWithResponseMockTests.java index 7d7a612a57d2..c4f8802c93fa 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetAuthorizationRuleWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.models.AccessRights; @@ -22,17 +22,17 @@ public final class HybridConnectionsGetAuthorizationRuleWithResponseMockTests { @Test public void testGetAuthorizationRuleWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"rights\":[\"Manage\"]},\"id\":\"aos\",\"name\":\"e\",\"type\":\"csonpclhoco\"}"; + = "{\"properties\":{\"rights\":[\"Manage\",\"Manage\",\"Send\",\"Send\"]},\"location\":\"vahfn\",\"id\":\"kyqxjvuujqgidokg\",\"name\":\"ljyoxgvcltb\",\"type\":\"sncghkjeszz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AuthorizationRule response = manager.hybridConnections() - .getAuthorizationRuleWithResponse("rsa", "iwkuofos", "ghsauuimjmvxied", "ugidyjrr", + .getAuthorizationRuleWithResponse("aetcktvfcivfs", "kymuctqhjfbebr", "cxerf", "wutttxfvjrbi", com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListAuthorizationRulesMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListAuthorizationRulesMockTests.java index 213ac9e90356..df502fafae30 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListAuthorizationRulesMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListAuthorizationRulesMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.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.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.models.AccessRights; @@ -23,18 +23,18 @@ public final class HybridConnectionsListAuthorizationRulesMockTests { @Test public void testListAuthorizationRules() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"rights\":[\"Send\",\"Send\",\"Send\"]},\"id\":\"kthfui\",\"name\":\"aodsfcpkv\",\"type\":\"odpuozmyzydag\"}]}"; + = "{\"value\":[{\"properties\":{\"rights\":[\"Listen\"]},\"location\":\"uedck\",\"id\":\"wbiexzfey\",\"name\":\"eaxib\",\"type\":\"ujwb\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.hybridConnections() - .listAuthorizationRules("noae", "pfhyhl", "rpmopjmc", com.azure.core.util.Context.NONE); + .listAuthorizationRules("wrqlfktsthsuco", "mnyyazt", "bt", com.azure.core.util.Context.NONE); - Assertions.assertEquals(AccessRights.SEND, response.iterator().next().rights().get(0)); + Assertions.assertEquals(AccessRights.LISTEN, response.iterator().next().rights().get(0)); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NWRuleSetIpRulesTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NWRuleSetIpRulesTests.java new file mode 100644 index 000000000000..62e10d323924 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NWRuleSetIpRulesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.NetworkRuleIPAction; +import org.junit.jupiter.api.Assertions; + +public final class NWRuleSetIpRulesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NWRuleSetIpRules model = BinaryData.fromString("{\"ipMask\":\"ohoqqnwvlryav\",\"action\":\"Allow\"}") + .toObject(NWRuleSetIpRules.class); + Assertions.assertEquals("ohoqqnwvlryav", model.ipMask()); + Assertions.assertEquals(NetworkRuleIPAction.ALLOW, model.action()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NWRuleSetIpRules model + = new NWRuleSetIpRules().withIpMask("ohoqqnwvlryav").withAction(NetworkRuleIPAction.ALLOW); + model = BinaryData.fromObject(model).toObject(NWRuleSetIpRules.class); + Assertions.assertEquals("ohoqqnwvlryav", model.ipMask()); + Assertions.assertEquals(NetworkRuleIPAction.ALLOW, model.action()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCheckNameAvailabilityWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCheckNameAvailabilityWithResponseMockTests.java index cee65283537b..bd7eae2c162e 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCheckNameAvailabilityWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.models.CheckNameAvailability; @@ -22,22 +22,21 @@ public final class NamespacesCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr - = "{\"message\":\"qawrlyxwj\",\"nameAvailable\":true,\"reason\":\"TooManyNamespaceInCurrentSubscription\"}"; + String responseStr = "{\"message\":\"fjhdg\",\"nameAvailable\":true,\"reason\":\"NameInLockdown\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckNameAvailabilityResult response = manager.namespaces() - .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("lnerkujysvleju"), + .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("ikh"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals(UnavailableReason.TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION, response.reason()); + Assertions.assertTrue(response.nameAvailable()); + Assertions.assertEquals(UnavailableReason.NAME_IN_LOCKDOWN, response.reason()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateAuthorizationRuleWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateAuthorizationRuleWithResponseMockTests.java index 3ece3f411419..7a410ec4983c 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateAuthorizationRuleWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.models.AccessRights; @@ -23,19 +23,19 @@ public final class NamespacesCreateOrUpdateAuthorizationRuleWithResponseMockTest @Test public void testCreateOrUpdateAuthorizationRuleWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"rights\":[\"Manage\",\"Listen\",\"Send\",\"Send\"]},\"id\":\"yk\",\"name\":\"menevfyexfwh\",\"type\":\"bcibvyvdcsitynn\"}"; + = "{\"properties\":{\"rights\":[\"Manage\"]},\"location\":\"cubeddgssofw\",\"id\":\"zqalkrmnjijpx\",\"name\":\"cqqudf\",\"type\":\"byxbaaabjy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AuthorizationRule response = manager.namespaces() - .defineAuthorizationRule("orxzdmohctbqvud") - .withExistingNamespace("usue", "nzwdejba") - .withRights(Arrays.asList(AccessRights.MANAGE)) + .defineAuthorizationRule("lr") + .withExistingNamespace("dunyg", "eqidbqfatpx") + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.MANAGE)) .create(); Assertions.assertEquals(AccessRights.MANAGE, response.rights().get(0)); diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateMockTests.java index 79915021f3d4..412e7a892358 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateMockTests.java @@ -1,20 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.azure.resourcemanager.relay.models.RelayNamespace; import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -25,26 +33,46 @@ public final class NamespacesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"sku\":{\"tier\":\"Standard\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"createdAt\":\"2021-03-05T06:09:09Z\",\"updatedAt\":\"2021-07-11T00:23:53Z\",\"serviceBusEndpoint\":\"zscxaqwo\",\"metricId\":\"hcbonqvpkvlr\"},\"location\":\"njeaseipheofloke\",\"tags\":{\"jp\":\"enjbdlwtgrhp\",\"e\":\"umasxazjpq\",\"zvdudgwdslfhotwm\":\"ualhbxxhejj\"},\"id\":\"ynpwlbj\",\"name\":\"pgacftadehxnlty\",\"type\":\"sop\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"status\":\"ormrlxqtvcofudfl\",\"createdAt\":\"2021-10-24T03:31:48Z\",\"updatedAt\":\"2021-04-04T17:02:59Z\",\"serviceBusEndpoint\":\"gdknnqv\",\"metricId\":\"znqntoru\",\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"location\":\"c\",\"id\":\"auwjuetaebu\",\"name\":\"u\",\"type\":\"dmovsm\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"location\":\"q\",\"id\":\"fkifr\",\"name\":\"tpuqujmq\",\"type\":\"gkfbtndoaong\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\"},\"location\":\"i\",\"id\":\"jed\",\"name\":\"twwaezkojvdcpzf\",\"type\":\"qouicybxarzgsz\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"location\":\"opidoamciodh\",\"id\":\"azxkhnzbonlwnto\",\"name\":\"gokdwbwhks\",\"type\":\"zcmrvexztvb\"}],\"publicNetworkAccess\":\"Enabled\",\"minimumTlsVersion\":\"1.2\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Standard\"},\"location\":\"koowtl\",\"tags\":{\"wqaldsyu\":\"ux\",\"ykutwpf\":\"ximerqfobwyznk\",\"sd\":\"pagmhrskdsnf\",\"wpusdsttwvogv\":\"akgtdlmkkzevdlh\"},\"id\":\"bejdcn\",\"name\":\"qqmoaku\",\"type\":\"gm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RelayNamespace response = manager.namespaces() - .define("ywgndrv") - .withRegion("vmmcoofs") - .withExistingResourceGroup("kanyktzlcuiywg") - .withTags(mapOf("bcypmi", "evgbmqjq", "acfi", "kwlzuvccfwnfn")) - .withSku(new Sku().withTier(SkuTier.STANDARD)) + .define("zrtuzq") + .withRegion("lewyhmlwpaz") + .withExistingResourceGroup("ayffim") + .withTags(mapOf("yq", "ofncckwyfzqwhxxb", "ztppriolxorjalto", "xzfe")) + .withSku(new Sku().withName(SkuName.STANDARD).withTier(SkuTier.STANDARD)) + .withPrivateEndpointConnections(Arrays.asList( + new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new ConnectionState()) + .withProvisioningState(EndPointProvisioningState.DELETING), + new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new ConnectionState()) + .withProvisioningState(EndPointProvisioningState.SUCCEEDED), + new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new ConnectionState()) + .withProvisioningState(EndPointProvisioningState.FAILED), + new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new ConnectionState()) + .withProvisioningState(EndPointProvisioningState.UPDATING))) + .withPublicNetworkAccess(PublicNetworkAccess.SECURED_BY_PERIMETER) + .withMinimumTlsVersion(TlsVersion.ONE_THREE) .create(); - Assertions.assertEquals("njeaseipheofloke", response.location()); - Assertions.assertEquals("enjbdlwtgrhp", response.tags().get("jp")); + Assertions.assertEquals("koowtl", response.location()); + Assertions.assertEquals("ux", response.tags().get("wqaldsyu")); + Assertions.assertEquals(SkuName.STANDARD, response.sku().name()); Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); + Assertions.assertEquals(EndPointProvisioningState.DELETING, + response.privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_TWO, response.minimumTlsVersion()); } // Use "Map.of" if available diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateNetworkRuleSetWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateNetworkRuleSetWithResponseMockTests.java new file mode 100644 index 000000000000..6599a9875e55 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateNetworkRuleSetWithResponseMockTests.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.relay.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.relay.RelayManager; +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.NetworkRuleIPAction; +import com.azure.resourcemanager.relay.models.NetworkRuleSet; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class NamespacesCreateOrUpdateNetworkRuleSetWithResponseMockTests { + @Test + public void testCreateOrUpdateNetworkRuleSetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"trustedServiceAccessEnabled\":false,\"defaultAction\":\"Deny\",\"publicNetworkAccess\":\"SecuredByPerimeter\",\"ipRules\":[{\"ipMask\":\"l\",\"action\":\"Allow\"},{\"ipMask\":\"xagl\",\"action\":\"Allow\"}]},\"id\":\"jwosytxitcskfck\",\"name\":\"qumiek\",\"type\":\"ez\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RelayManager manager = RelayManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + NetworkRuleSet response + = manager.namespaces() + .createOrUpdateNetworkRuleSetWithResponse("fnjhfjxwmszkkfo", "rey", + new NetworkRuleSetInner().withTrustedServiceAccessEnabled(false) + .withDefaultAction(DefaultAction.DENY) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withIpRules(Arrays + .asList(new NWRuleSetIpRules().withIpMask("a").withAction(NetworkRuleIPAction.ALLOW))), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertFalse(response.trustedServiceAccessEnabled()); + Assertions.assertEquals(DefaultAction.DENY, response.defaultAction()); + Assertions.assertEquals(PublicNetworkAccess.SECURED_BY_PERIMETER, response.publicNetworkAccess()); + Assertions.assertEquals("l", response.ipRules().get(0).ipMask()); + Assertions.assertEquals(NetworkRuleIPAction.ALLOW, response.ipRules().get(0).action()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteAuthorizationRuleWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteAuthorizationRuleWithResponseMockTests.java index e11d00cf452d..3b60d0e94f24 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteAuthorizationRuleWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import java.nio.charset.StandardCharsets; @@ -25,11 +25,10 @@ public void testDeleteAuthorizationRuleWithResponse() throws Exception { RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.namespaces() - .deleteAuthorizationRuleWithResponse("ppofmxaxcfjpgdd", "ocjjxhvpmouexh", "zxibqeoj", - com.azure.core.util.Context.NONE); + .deleteAuthorizationRuleWithResponse("dzu", "erscdntne", "fiwjmygtdssls", com.azure.core.util.Context.NONE); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteMockTests.java index 8b5d31963781..8944747e4c47 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.namespaces().delete("swjdkirso", "dqxhcrmnohjtckwh", com.azure.core.util.Context.NONE); + manager.namespaces().delete("rfouyftaakcpw", "yzvqt", com.azure.core.util.Context.NONE); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetAuthorizationRuleWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetAuthorizationRuleWithResponseMockTests.java index 184206b98cc5..ee11555f58a3 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetAuthorizationRuleWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.models.AccessRights; @@ -22,17 +22,17 @@ public final class NamespacesGetAuthorizationRuleWithResponseMockTests { @Test public void testGetAuthorizationRuleWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"rights\":[\"Send\",\"Send\",\"Manage\"]},\"id\":\"qkwpyeicxmqc\",\"name\":\"wqvhkhixuigdt\",\"type\":\"pbobjo\"}"; + = "{\"properties\":{\"rights\":[\"Send\",\"Send\",\"Send\"]},\"location\":\"ydmcwyhzdxssa\",\"id\":\"zmnvdfznudaod\",\"name\":\"xzb\",\"type\":\"cblylpstdbhhxsr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AuthorizationRule response = manager.namespaces() - .getAuthorizationRuleWithResponse("xqbzvddntwnd", "icbtwnpzao", "vuhrhcffcyddgl", + .getAuthorizationRuleWithResponse("maqolbgycduie", "tgccymvaolpss", "qlfmmdnbb", com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupWithResponseMockTests.java index 8fc840241c01..b3dc3e5f5f6f 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupWithResponseMockTests.java @@ -1,17 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.azure.resourcemanager.relay.models.RelayNamespace; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -22,21 +26,26 @@ public final class NamespacesGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"sku\":{\"tier\":\"Standard\"},\"properties\":{\"provisioningState\":\"Unknown\",\"createdAt\":\"2021-03-02T17:04:43Z\",\"updatedAt\":\"2021-01-31T18:34:57Z\",\"serviceBusEndpoint\":\"byxqabn\",\"metricId\":\"cpc\"},\"location\":\"shurzafbljjgpbto\",\"tags\":{\"idtqajzyu\":\"mkljavb\",\"jkrlkhbzhfepg\":\"pku\",\"paierh\":\"gqexzlocxs\",\"tjaodxobnb\":\"bcsglumma\"},\"id\":\"xkqpxo\",\"name\":\"ajionpimexgstxg\",\"type\":\"po\"}"; + = "{\"properties\":{\"provisioningState\":\"rlltmuwlauwzizx\",\"status\":\"pgcjefuzmuvp\",\"createdAt\":\"2021-05-23T17:52:43Z\",\"updatedAt\":\"2021-04-26T02:21:23Z\",\"serviceBusEndpoint\":\"orppxebmnzbtb\",\"metricId\":\"pglkf\",\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"location\":\"fphsdyhtozfikdow\",\"id\":\"uuvxz\",\"name\":\"clvit\",\"type\":\"hqzonosggbhcoh\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Updating\"},\"location\":\"aljutiiswac\",\"id\":\"gdkz\",\"name\":\"ewkfvhqcrai\",\"type\":\"vpnpp\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Updating\"},\"location\":\"mh\",\"id\":\"xyjrxsagafcnih\",\"name\":\"wqapnedgfbcvk\",\"type\":\"vq\"}],\"publicNetworkAccess\":\"SecuredByPerimeter\",\"minimumTlsVersion\":\"1.3\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Standard\"},\"location\":\"hvoodsotbobzd\",\"tags\":{\"vnhdldwmgxcxr\":\"j\",\"niyqslui\":\"lpmutwuoegrpkhj\"},\"id\":\"pdggkzzlvm\",\"name\":\"mpaxmodfvuefywsb\",\"type\":\"fvmwy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RelayNamespace response = manager.namespaces() - .getByResourceGroupWithResponse("soifiyipjxsqw", "gr", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("xmubyyntwlrbq", "koievseo", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("shurzafbljjgpbto", response.location()); - Assertions.assertEquals("mkljavb", response.tags().get("idtqajzyu")); + Assertions.assertEquals("hvoodsotbobzd", response.location()); + Assertions.assertEquals("j", response.tags().get("vnhdldwmgxcxr")); + Assertions.assertEquals(SkuName.STANDARD, response.sku().name()); Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); + Assertions.assertEquals(EndPointProvisioningState.CANCELED, + response.privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.SECURED_BY_PERIMETER, response.publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_THREE, response.minimumTlsVersion()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetNetworkRuleSetWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetNetworkRuleSetWithResponseMockTests.java new file mode 100644 index 000000000000..fa3acacc99a2 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesGetNetworkRuleSetWithResponseMockTests.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.relay.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.relay.RelayManager; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NetworkRuleIPAction; +import com.azure.resourcemanager.relay.models.NetworkRuleSet; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +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 NamespacesGetNetworkRuleSetWithResponseMockTests { + @Test + public void testGetNetworkRuleSetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"trustedServiceAccessEnabled\":true,\"defaultAction\":\"Deny\",\"publicNetworkAccess\":\"SecuredByPerimeter\",\"ipRules\":[{\"ipMask\":\"tfudxepx\",\"action\":\"Allow\"},{\"ipMask\":\"gvr\",\"action\":\"Allow\"},{\"ipMask\":\"k\",\"action\":\"Allow\"}]},\"id\":\"i\",\"name\":\"dblx\",\"type\":\"wi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RelayManager manager = RelayManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + NetworkRuleSet response = manager.namespaces() + .getNetworkRuleSetWithResponse("mtdaa", "gdv", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertTrue(response.trustedServiceAccessEnabled()); + Assertions.assertEquals(DefaultAction.DENY, response.defaultAction()); + Assertions.assertEquals(PublicNetworkAccess.SECURED_BY_PERIMETER, response.publicNetworkAccess()); + Assertions.assertEquals("tfudxepx", response.ipRules().get(0).ipMask()); + Assertions.assertEquals(NetworkRuleIPAction.ALLOW, response.ipRules().get(0).action()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListAuthorizationRulesMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListAuthorizationRulesMockTests.java index d8fa5e6784c1..a80b3997df55 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListAuthorizationRulesMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListAuthorizationRulesMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.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.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.models.AccessRights; @@ -23,18 +23,18 @@ public final class NamespacesListAuthorizationRulesMockTests { @Test public void testListAuthorizationRules() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"rights\":[\"Listen\",\"Send\",\"Send\",\"Manage\"]},\"id\":\"j\",\"name\":\"oejctbzaqsqsy\",\"type\":\"bkbfkgukdkex\"}]}"; + = "{\"value\":[{\"properties\":{\"rights\":[\"Send\",\"Manage\",\"Send\",\"Listen\"]},\"location\":\"plvwiwubmwmbes\",\"id\":\"nkww\",\"name\":\"pp\",\"type\":\"flcxoga\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.namespaces().listAuthorizationRules("gmaajrm", "djwzrlov", com.azure.core.util.Context.NONE); + = manager.namespaces().listAuthorizationRules("tmweriofzpyq", "emwabnet", com.azure.core.util.Context.NONE); - Assertions.assertEquals(AccessRights.LISTEN, response.iterator().next().rights().get(0)); + Assertions.assertEquals(AccessRights.SEND, response.iterator().next().rights().get(0)); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListByResourceGroupMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListByResourceGroupMockTests.java index 133c8fb50484..5cb0744344dc 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListByResourceGroupMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListByResourceGroupMockTests.java @@ -1,18 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.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.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.azure.resourcemanager.relay.models.RelayNamespace; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -23,20 +27,25 @@ public final class NamespacesListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"sku\":{\"tier\":\"Standard\"},\"properties\":{\"provisioningState\":\"Updating\",\"createdAt\":\"2021-04-19T05:30:16Z\",\"updatedAt\":\"2021-10-29T21:44:59Z\",\"serviceBusEndpoint\":\"xmnteiwaop\",\"metricId\":\"mijcmmxdcufufs\"},\"location\":\"pymzidnsezcxtbzs\",\"tags\":{\"sne\":\"c\"},\"id\":\"mdwzjeiachboo\",\"name\":\"flnrosfqpteehzz\",\"type\":\"ypyqrimzinp\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"smond\",\"status\":\"quxvypomgkop\",\"createdAt\":\"2021-06-11T03:04:33Z\",\"updatedAt\":\"2021-02-21T13:48:45Z\",\"serviceBusEndpoint\":\"ajqgxy\",\"metricId\":\"ocmbqfqvmkcxoza\",\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Updating\"},\"location\":\"lya\",\"id\":\"dckcbc\",\"name\":\"ejrjxgciqibrho\",\"type\":\"xsdqrhzoymibmrqy\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"location\":\"uszdtmhrkwof\",\"id\":\"voqacpiexpbt\",\"name\":\"iwbwoenwashrtdtk\",\"type\":\"nqxwbp\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Updating\"},\"location\":\"jwaa\",\"id\":\"pqiiobyuqe\",\"name\":\"pqlpq\",\"type\":\"cciuqgbdbutau\"}],\"publicNetworkAccess\":\"Disabled\",\"minimumTlsVersion\":\"1.2\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Standard\"},\"location\":\"hykojoxafnndlpic\",\"tags\":{\"kkpwdreqnovvq\":\"ymkcdyhb\"},\"id\":\"ovljxywsu\",\"name\":\"syrsndsytgadgvra\",\"type\":\"aeneqnzarrwl\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.namespaces().listByResourceGroup("zwdzuh", com.azure.core.util.Context.NONE); + = manager.namespaces().listByResourceGroup("nubexk", com.azure.core.util.Context.NONE); - Assertions.assertEquals("pymzidnsezcxtbzs", response.iterator().next().location()); - Assertions.assertEquals("c", response.iterator().next().tags().get("sne")); + Assertions.assertEquals("hykojoxafnndlpic", response.iterator().next().location()); + Assertions.assertEquals("ymkcdyhb", response.iterator().next().tags().get("kkpwdreqnovvq")); + Assertions.assertEquals(SkuName.STANDARD, response.iterator().next().sku().name()); Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().sku().tier()); + Assertions.assertEquals(EndPointProvisioningState.UPDATING, + response.iterator().next().privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.iterator().next().publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_TWO, response.iterator().next().minimumTlsVersion()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListMockTests.java index d9837d119ce8..711e056769f7 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NamespacesListMockTests.java @@ -1,18 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.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.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.azure.resourcemanager.relay.models.RelayNamespace; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; +import com.azure.resourcemanager.relay.models.TlsVersion; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -23,19 +27,25 @@ public final class NamespacesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"sku\":{\"tier\":\"Standard\"},\"properties\":{\"provisioningState\":\"Deleted\",\"createdAt\":\"2021-05-28T17:15:13Z\",\"updatedAt\":\"2021-01-24T18:28:17Z\",\"serviceBusEndpoint\":\"ysszdnrujqguh\",\"metricId\":\"ouqfprwz\"},\"location\":\"bngui\",\"tags\":{\"x\":\"uizga\"},\"id\":\"fizuckyf\",\"name\":\"hr\",\"type\":\"idf\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"ijfqkacewiipfp\",\"status\":\"ji\",\"createdAt\":\"2021-01-24T11:42:32Z\",\"updatedAt\":\"2021-02-08T13:33:20Z\",\"serviceBusEndpoint\":\"ohqkvpuvksgpls\",\"metricId\":\"nynfsynljphuo\",\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"location\":\"torzih\",\"id\":\"osjswsr\",\"name\":\"slyzrpzbchckqq\",\"type\":\"qioxi\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"location\":\"nkedyatrwyhqmib\",\"id\":\"hwit\",\"name\":\"mypyynpcdpu\",\"type\":\"nzgmwznmabik\"},{\"properties\":{\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"location\":\"xbldtlwwrlkdmtn\",\"id\":\"ok\",\"name\":\"tllxdyhgsyocogj\",\"type\":\"tdtbnnhadooc\"}],\"publicNetworkAccess\":\"SecuredByPerimeter\",\"minimumTlsVersion\":\"1.3\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Standard\"},\"location\":\"amqgxqquezikyw\",\"tags\":{\"uipiccjzk\":\"kallatmel\",\"rhyrnxxmueed\":\"ivgvvcna\"},\"id\":\"drd\",\"name\":\"stkwqqtch\",\"type\":\"alm\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.namespaces().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("bngui", response.iterator().next().location()); - Assertions.assertEquals("uizga", response.iterator().next().tags().get("x")); + Assertions.assertEquals("amqgxqquezikyw", response.iterator().next().location()); + Assertions.assertEquals("kallatmel", response.iterator().next().tags().get("uipiccjzk")); + Assertions.assertEquals(SkuName.STANDARD, response.iterator().next().sku().name()); Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().sku().tier()); + Assertions.assertEquals(EndPointProvisioningState.CANCELED, + response.iterator().next().privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.SECURED_BY_PERIMETER, + response.iterator().next().publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_THREE, response.iterator().next().minimumTlsVersion()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NetworkRuleSetInnerTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NetworkRuleSetInnerTests.java new file mode 100644 index 000000000000..ef266b6374c5 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NetworkRuleSetInnerTests.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.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetInner; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.NetworkRuleIPAction; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class NetworkRuleSetInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkRuleSetInner model = BinaryData.fromString( + "{\"properties\":{\"trustedServiceAccessEnabled\":false,\"defaultAction\":\"Deny\",\"publicNetworkAccess\":\"Disabled\",\"ipRules\":[{\"ipMask\":\"ejzicwifsjtt\",\"action\":\"Allow\"},{\"ipMask\":\"ishc\",\"action\":\"Allow\"}]},\"id\":\"jdeyeamdpha\",\"name\":\"alpbuxwgipwhon\",\"type\":\"wkgshwa\"}") + .toObject(NetworkRuleSetInner.class); + Assertions.assertFalse(model.trustedServiceAccessEnabled()); + Assertions.assertEquals(DefaultAction.DENY, model.defaultAction()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); + Assertions.assertEquals("ejzicwifsjtt", model.ipRules().get(0).ipMask()); + Assertions.assertEquals(NetworkRuleIPAction.ALLOW, model.ipRules().get(0).action()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkRuleSetInner model + = new NetworkRuleSetInner().withTrustedServiceAccessEnabled(false) + .withDefaultAction(DefaultAction.DENY) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withIpRules(Arrays.asList( + new NWRuleSetIpRules().withIpMask("ejzicwifsjtt").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("ishc").withAction(NetworkRuleIPAction.ALLOW))); + model = BinaryData.fromObject(model).toObject(NetworkRuleSetInner.class); + Assertions.assertFalse(model.trustedServiceAccessEnabled()); + Assertions.assertEquals(DefaultAction.DENY, model.defaultAction()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); + Assertions.assertEquals("ejzicwifsjtt", model.ipRules().get(0).ipMask()); + Assertions.assertEquals(NetworkRuleIPAction.ALLOW, model.ipRules().get(0).action()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NetworkRuleSetPropertiesTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NetworkRuleSetPropertiesTests.java new file mode 100644 index 000000000000..5e7f6ab1ab40 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/NetworkRuleSetPropertiesTests.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.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.NetworkRuleSetProperties; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.NetworkRuleIPAction; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class NetworkRuleSetPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkRuleSetProperties model = BinaryData.fromString( + "{\"trustedServiceAccessEnabled\":true,\"defaultAction\":\"Deny\",\"publicNetworkAccess\":\"SecuredByPerimeter\",\"ipRules\":[{\"ipMask\":\"pu\",\"action\":\"Allow\"},{\"ipMask\":\"ywnuzoq\",\"action\":\"Allow\"},{\"ipMask\":\"qzrnkcqvyxlwhz\",\"action\":\"Allow\"}]}") + .toObject(NetworkRuleSetProperties.class); + Assertions.assertTrue(model.trustedServiceAccessEnabled()); + Assertions.assertEquals(DefaultAction.DENY, model.defaultAction()); + Assertions.assertEquals(PublicNetworkAccess.SECURED_BY_PERIMETER, model.publicNetworkAccess()); + Assertions.assertEquals("pu", model.ipRules().get(0).ipMask()); + Assertions.assertEquals(NetworkRuleIPAction.ALLOW, model.ipRules().get(0).action()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkRuleSetProperties model = new NetworkRuleSetProperties().withTrustedServiceAccessEnabled(true) + .withDefaultAction(DefaultAction.DENY) + .withPublicNetworkAccess(PublicNetworkAccess.SECURED_BY_PERIMETER) + .withIpRules(Arrays.asList(new NWRuleSetIpRules().withIpMask("pu").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("ywnuzoq").withAction(NetworkRuleIPAction.ALLOW), + new NWRuleSetIpRules().withIpMask("qzrnkcqvyxlwhz").withAction(NetworkRuleIPAction.ALLOW))); + model = BinaryData.fromObject(model).toObject(NetworkRuleSetProperties.class); + Assertions.assertTrue(model.trustedServiceAccessEnabled()); + Assertions.assertEquals(DefaultAction.DENY, model.defaultAction()); + Assertions.assertEquals(PublicNetworkAccess.SECURED_BY_PERIMETER, model.publicNetworkAccess()); + Assertions.assertEquals("pu", model.ipRules().get(0).ipMask()); + Assertions.assertEquals(NetworkRuleIPAction.ALLOW, model.ipRules().get(0).action()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationDisplayTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationDisplayTests.java index 97a19a84c3a0..80b1a74cf66b 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationDisplayTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -10,14 +10,8 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData - .fromString("{\"provider\":\"psqucmpoyf\",\"resource\":\"fogknygjofjdde\",\"operation\":\"rd\"}") + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") .toObject(OperationDisplay.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationInnerTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationInnerTests.java index f6124f50c51e..1526d5a4ca2d 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationInnerTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.relay.fluent.models.OperationInner; -import com.azure.resourcemanager.relay.models.OperationDisplay; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"esaagdfm\",\"display\":{\"provider\":\"lhjxr\",\"resource\":\"kwm\",\"operation\":\"ktsizntocipaou\"}}") + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationListResultTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationListResultTests.java index 659c74ff4e28..6254b6631aff 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationListResultTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.relay.models.OperationListResult; +import com.azure.resourcemanager.relay.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\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\"}},{\"name\":\"zehtbmu\",\"display\":{\"provider\":\"wnoi\",\"resource\":\"wlrxyb\",\"operation\":\"oqijgkdmbpaz\"}},{\"name\":\"bc\",\"display\":{\"provider\":\"dznrbtcqq\",\"resource\":\"qglhq\",\"operation\":\"ufo\"}}],\"nextLink\":\"jywif\"}") + "{\"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); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationsListMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationsListMockTests.java index 324278a6944d..43c4ffe3f0ee 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationsListMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.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.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.models.Operation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"ol\",\"display\":{\"provider\":\"psalgbqux\",\"resource\":\"jyj\",\"operation\":\"jaoyfhrtx\"}}]}"; + = "{\"value\":[{\"name\":\"onuq\",\"isDataAction\":false,\"display\":{\"provider\":\"eyp\",\"resource\":\"rmjmwvvjektc\",\"operation\":\"enhwlrs\",\"description\":\"rzpwvlqdqgbiq\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionInnerTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionInnerTests.java new file mode 100644 index 000000000000..c6b0d703a455 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionInnerTests.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.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionInner model = BinaryData.fromString( + "{\"properties\":{\"privateEndpoint\":{\"id\":\"wryoqpsoacc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ljlahbcryf\"},\"provisioningState\":\"Updating\"},\"location\":\"osygex\",\"id\":\"ojakhmsbzjhcrze\",\"name\":\"dphlxaolt\",\"type\":\"qtrgqjbpfzfsinzg\"}") + .toObject(PrivateEndpointConnectionInner.class); + Assertions.assertEquals("wryoqpsoacc", model.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.PENDING, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ljlahbcryf", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.UPDATING, model.provisioningState()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionInner model + = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("wryoqpsoacc")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.PENDING).withDescription("ljlahbcryf")) + .withProvisioningState(EndPointProvisioningState.UPDATING); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); + Assertions.assertEquals("wryoqpsoacc", model.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.PENDING, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ljlahbcryf", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.UPDATING, model.provisioningState()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionListResultTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionListResultTests.java new file mode 100644 index 000000000000..c0a9e5ef30c5 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionListResultTests.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.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.implementation.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"amiheognarxz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"tusivyevcciqihn\"},\"provisioningState\":\"Deleting\"},\"location\":\"bwjzr\",\"id\":\"ygxgispemvtz\",\"name\":\"kufubljo\",\"type\":\"xqeofjaeqjhqjba\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"mjqulngsn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"kzgcwrwcl\"},\"provisioningState\":\"Failed\"},\"location\":\"ljdousk\",\"id\":\"vkocrcjdkwtn\",\"name\":\"xbnjbiksq\",\"type\":\"gls\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"qpjwnzlljfm\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"vmgxsab\"},\"provisioningState\":\"Deleting\"},\"location\":\"uujitcjc\",\"id\":\"zevndhkrwpdappds\",\"name\":\"dkvwrwjfe\",\"type\":\"snhu\"}],\"nextLink\":\"eltmrldhugjzzdat\"}") + .toObject(PrivateEndpointConnectionListResult.class); + Assertions.assertEquals("amiheognarxz", model.value().get(0).privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.REJECTED, + model.value().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("tusivyevcciqihn", + model.value().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.DELETING, model.value().get(0).provisioningState()); + Assertions.assertEquals("eltmrldhugjzzdat", model.nextLink()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionPropertiesTests.java new file mode 100644 index 000000000000..2489338bc937 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionPropertiesTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionProperties model = BinaryData.fromString( + "{\"privateEndpoint\":{\"id\":\"jrwzox\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"lluwfzitonpeq\"},\"provisioningState\":\"Updating\"}") + .toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals("jrwzox", model.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.DISCONNECTED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("lluwfzitonpeq", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.UPDATING, model.provisioningState()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionProperties model + = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint().withId("jrwzox")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.DISCONNECTED) + .withDescription("lluwfzitonpeq")) + .withProvisioningState(EndPointProvisioningState.UPDATING); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals("jrwzox", model.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.DISCONNECTED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("lluwfzitonpeq", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.UPDATING, model.provisioningState()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..d40163d7f3bf --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests.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.relay.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.relay.RelayManager; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PrivateEndpointConnection; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +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 PrivateEndpointConnectionsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"privateEndpoint\":{\"id\":\"ahzxctobgbk\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"postmgrcfbunrm\"},\"provisioningState\":\"Canceled\"},\"location\":\"hkxbpv\",\"id\":\"mjh\",\"name\":\"xjyngudivk\",\"type\":\"tswb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RelayManager manager = RelayManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.privateEndpointConnections() + .define("gvpgy") + .withExistingNamespace("bnxknalaulppg", "dtpnapnyiropuhp") + .withPrivateEndpoint(new PrivateEndpoint().withId("itxmedjvcslynqww")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.REJECTED).withDescription("hxg")) + .withProvisioningState(EndPointProvisioningState.UPDATING) + .create(); + + Assertions.assertEquals("ahzxctobgbk", response.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.APPROVED, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("postmgrcfbunrm", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.CANCELED, response.provisioningState()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsDeleteMockTests.java new file mode 100644 index 000000000000..683a7543e908 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsDeleteMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.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.relay.RelayManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsDeleteMockTests { + @Test + public void testDelete() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RelayManager manager = RelayManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.privateEndpointConnections().delete("tskzbbtdzumveek", "pwo", "uh", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..1b7d5ceb8a82 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsGetWithResponseMockTests.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.relay.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.relay.RelayManager; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpointConnection; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +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 PrivateEndpointConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"privateEndpoint\":{\"id\":\"vgqzcjrvxd\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"lxkvu\"},\"provisioningState\":\"Failed\"},\"location\":\"ovawjvzunlu\",\"id\":\"nnprn\",\"name\":\"i\",\"type\":\"eilpjzuaejxdu\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RelayManager manager = RelayManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.privateEndpointConnections() + .getWithResponse("jvkn", "e", "qsgzvahapj", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("vgqzcjrvxd", response.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.APPROVED, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("lxkvu", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.FAILED, response.provisioningState()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsListMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsListMockTests.java new file mode 100644 index 000000000000..b949fc7f8a36 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsListMockTests.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.relay.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.relay.RelayManager; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpointConnection; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +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 PrivateEndpointConnectionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"uwaboekqvke\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"bxwyjsflhhcaa\"},\"provisioningState\":\"Succeeded\"},\"location\":\"xisxyawjoyaqcsl\",\"id\":\"pkii\",\"name\":\"zyexzn\",\"type\":\"lixhnrztfol\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RelayManager manager = RelayManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.privateEndpointConnections().list("fpbsjyofdxl", "us", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("uwaboekqvke", response.iterator().next().privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.PENDING, + response.iterator().next().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("bxwyjsflhhcaa", + response.iterator().next().privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.SUCCEEDED, response.iterator().next().provisioningState()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointTests.java new file mode 100644 index 000000000000..30cb77123531 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateEndpointTests.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.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"jlxofpdvhpfxxyp\"}").toObject(PrivateEndpoint.class); + Assertions.assertEquals("jlxofpdvhpfxxyp", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpoint model = new PrivateEndpoint().withId("jlxofpdvhpfxxyp"); + model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); + Assertions.assertEquals("jlxofpdvhpfxxyp", model.id()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourceInnerTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourceInnerTests.java new file mode 100644 index 000000000000..e408dfaab5d3 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourceInnerTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceInner; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceInner model = BinaryData.fromString( + "{\"properties\":{\"groupId\":\"oc\",\"requiredMembers\":[\"ablgphuticndvk\",\"ozwyiftyhxhuro\"],\"requiredZoneNames\":[\"yxolniwp\",\"cukjf\",\"giawx\"]},\"id\":\"ryplwckbasyypn\",\"name\":\"dhsgcba\",\"type\":\"phejkotynqgoulz\"}") + .toObject(PrivateLinkResourceInner.class); + Assertions.assertEquals("oc", model.groupId()); + Assertions.assertEquals("ablgphuticndvk", model.requiredMembers().get(0)); + Assertions.assertEquals("yxolniwp", model.requiredZoneNames().get(0)); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcePropertiesTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcePropertiesTests.java new file mode 100644 index 000000000000..adbcb55a2654 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcePropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourceProperties; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourcePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceProperties model = BinaryData.fromString( + "{\"groupId\":\"likwyqkgfgib\",\"requiredMembers\":[\"gakeqsr\"],\"requiredZoneNames\":[\"zqqedq\",\"tbciqfouflmm\",\"kzsmodm\",\"lougpbkw\"]}") + .toObject(PrivateLinkResourceProperties.class); + Assertions.assertEquals("likwyqkgfgib", model.groupId()); + Assertions.assertEquals("gakeqsr", model.requiredMembers().get(0)); + Assertions.assertEquals("zqqedq", model.requiredZoneNames().get(0)); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesGetWithResponseMockTests.java new file mode 100644 index 000000000000..bf6257c70eb4 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesGetWithResponseMockTests.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.relay.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.relay.RelayManager; +import com.azure.resourcemanager.relay.models.PrivateLinkResource; +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 PrivateLinkResourcesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupId\":\"bxvwv\",\"requiredMembers\":[\"lqbhsf\"],\"requiredZoneNames\":[\"lyt\",\"blmpewww\"]},\"id\":\"krvrns\",\"name\":\"shqjohxcrsbf\",\"type\":\"vasrruvwb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RelayManager manager = RelayManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateLinkResource response = manager.privateLinkResources() + .getWithResponse("qzvszjf", "uvjfdxxive", "vtcqaqtdo", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("bxvwv", response.groupId()); + Assertions.assertEquals("lqbhsf", response.requiredMembers().get(0)); + Assertions.assertEquals("lyt", response.requiredZoneNames().get(0)); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListResultInnerTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListResultInnerTests.java new file mode 100644 index 000000000000..63f53bbe08c5 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListResultInnerTests.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.relay.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.PrivateLinkResourcesListResultInner; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourcesListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourcesListResultInner model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupId\":\"duqkt\",\"requiredMembers\":[\"pwgcuertu\",\"kdosvqw\",\"bmdg\",\"bjf\"],\"requiredZoneNames\":[\"mbmbexppbh\",\"q\",\"rolfpfp\"]},\"id\":\"lgbquxig\",\"name\":\"yjgzjaoyfhrtxiln\",\"type\":\"rkujy\"},{\"properties\":{\"groupId\":\"eju\",\"requiredMembers\":[\"awrlyx\",\"jkcpr\",\"nwbxgjvtbvpyssz\"],\"requiredZoneNames\":[\"uj\",\"guhmuouqfpr\"]},\"id\":\"wbnguitnwui\",\"name\":\"gazxuf\",\"type\":\"zuckyfi\"},{\"properties\":{\"groupId\":\"idf\",\"requiredMembers\":[\"dzuhtymwi\",\"dkfthwxmnt\",\"i\"],\"requiredZoneNames\":[\"pvkmijcmmxdcuf\",\"fsrpymzidnse\",\"cxtbzsg\"]},\"id\":\"c\",\"name\":\"sne\",\"type\":\"mdwzjeiachboo\"}],\"nextLink\":\"lnrosfqp\"}") + .toObject(PrivateLinkResourcesListResultInner.class); + Assertions.assertEquals("duqkt", model.value().get(0).groupId()); + Assertions.assertEquals("pwgcuertu", model.value().get(0).requiredMembers().get(0)); + Assertions.assertEquals("mbmbexppbh", model.value().get(0).requiredZoneNames().get(0)); + Assertions.assertEquals("lnrosfqp", model.nextLink()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListWithResponseMockTests.java new file mode 100644 index 000000000000..39000bbab6c1 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListWithResponseMockTests.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.relay.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.relay.RelayManager; +import com.azure.resourcemanager.relay.models.PrivateLinkResourcesListResult; +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 PrivateLinkResourcesListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupId\":\"pvjzbe\",\"requiredMembers\":[\"zznfqqnvwpmqta\"],\"requiredZoneNames\":[\"ujmkcjhwqy\",\"jrybnwjewgdrjer\",\"naenqpehindo\",\"gmifthnzd\"]},\"id\":\"sl\",\"name\":\"nayqi\",\"type\":\"ynduha\"}],\"nextLink\":\"qlkth\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RelayManager manager = RelayManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateLinkResourcesListResult response = manager.privateLinkResources() + .listWithResponse("sqfsubcgjbirxb", "ybsrfbjfdtwss", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("pvjzbe", response.value().get(0).groupId()); + Assertions.assertEquals("zznfqqnvwpmqta", response.value().get(0).requiredMembers().get(0)); + Assertions.assertEquals("ujmkcjhwqy", response.value().get(0).requiredZoneNames().get(0)); + Assertions.assertEquals("qlkth", response.nextLink()); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespaceInnerTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespaceInnerTests.java index 499d754cde24..2dc4027763af 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespaceInnerTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespaceInnerTests.java @@ -1,13 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; +import com.azure.resourcemanager.relay.models.TlsVersion; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -16,22 +25,50 @@ public final class RelayNamespaceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RelayNamespaceInner model = BinaryData.fromString( - "{\"sku\":{\"tier\":\"Standard\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"createdAt\":\"2021-11-13T01:40:46Z\",\"updatedAt\":\"2021-05-15T23:35:32Z\",\"serviceBusEndpoint\":\"jsprozvcpute\",\"metricId\":\"vwmf\"},\"location\":\"atscmd\",\"tags\":{\"dio\":\"hulsuuvmkjozkrwf\",\"vwryoqpso\":\"jpslwejd\",\"yffdfdos\":\"cctazakljlahbc\"},\"id\":\"gexpaojakhmsbz\",\"name\":\"hcrzevd\",\"type\":\"hlxaolthqtr\"}") + "{\"properties\":{\"provisioningState\":\"hzzvypyq\",\"status\":\"mzinpvswjdk\",\"createdAt\":\"2021-11-08T02:13:55Z\",\"updatedAt\":\"2021-06-03T00:49:48Z\",\"serviceBusEndpoint\":\"qxhcrmn\",\"metricId\":\"jtckwhdso\",\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"jxsqwpgrjbz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"xv\"},\"provisioningState\":\"Failed\"},\"location\":\"xqabnmocpcysh\",\"id\":\"zafb\",\"name\":\"jjgpb\",\"type\":\"oq\"}],\"publicNetworkAccess\":\"Disabled\",\"minimumTlsVersion\":\"1.2\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Standard\"},\"location\":\"idtqajzyu\",\"tags\":{\"jkrlkhbzhfepg\":\"u\",\"paierh\":\"gqexzlocxs\",\"tjaodxobnb\":\"bcsglumma\"},\"id\":\"xkqpxo\",\"name\":\"ajionpimexgstxg\",\"type\":\"po\"}") .toObject(RelayNamespaceInner.class); - Assertions.assertEquals("atscmd", model.location()); - Assertions.assertEquals("hulsuuvmkjozkrwf", model.tags().get("dio")); + Assertions.assertEquals("idtqajzyu", model.location()); + Assertions.assertEquals("u", model.tags().get("jkrlkhbzhfepg")); + Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); + Assertions.assertEquals("jxsqwpgrjbz", model.privateEndpointConnections().get(0).privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.REJECTED, + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xv", + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.FAILED, + model.privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RelayNamespaceInner model = new RelayNamespaceInner().withLocation("atscmd") - .withTags(mapOf("dio", "hulsuuvmkjozkrwf", "vwryoqpso", "jpslwejd", "yffdfdos", "cctazakljlahbc")) - .withSku(new Sku().withTier(SkuTier.STANDARD)); + RelayNamespaceInner model + = new RelayNamespaceInner().withLocation("idtqajzyu") + .withTags(mapOf("jkrlkhbzhfepg", "u", "paierh", "gqexzlocxs", "tjaodxobnb", "bcsglumma")) + .withSku(new Sku().withName(SkuName.STANDARD).withTier(SkuTier.STANDARD)) + .withPrivateEndpointConnections(Arrays.asList(new PrivateEndpointConnectionInner() + .withPrivateEndpoint(new PrivateEndpoint().withId("jxsqwpgrjbz")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.REJECTED).withDescription("xv")) + .withProvisioningState(EndPointProvisioningState.FAILED))) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withMinimumTlsVersion(TlsVersion.ONE_TWO); model = BinaryData.fromObject(model).toObject(RelayNamespaceInner.class); - Assertions.assertEquals("atscmd", model.location()); - Assertions.assertEquals("hulsuuvmkjozkrwf", model.tags().get("dio")); + Assertions.assertEquals("idtqajzyu", model.location()); + Assertions.assertEquals("u", model.tags().get("jkrlkhbzhfepg")); + Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); + Assertions.assertEquals("jxsqwpgrjbz", model.privateEndpointConnections().get(0).privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.REJECTED, + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xv", + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.FAILED, + model.privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersion()); } // Use "Map.of" if available diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespaceListResultTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespaceListResultTests.java index 2dd27b668508..bb15fbc72cdf 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespaceListResultTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespaceListResultTests.java @@ -1,58 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner; -import com.azure.resourcemanager.relay.models.RelayNamespaceListResult; -import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.implementation.models.RelayNamespaceListResult; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.relay.models.TlsVersion; import org.junit.jupiter.api.Assertions; public final class RelayNamespaceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RelayNamespaceListResult model = BinaryData.fromString( - "{\"value\":[{\"sku\":{\"tier\":\"Standard\"},\"properties\":{\"provisioningState\":\"Unknown\",\"createdAt\":\"2021-07-31T11:58:13Z\",\"updatedAt\":\"2021-09-14T21:41:32Z\",\"serviceBusEndpoint\":\"sjtxukcdmp\",\"metricId\":\"cryuan\"},\"location\":\"w\",\"tags\":{\"hfpmrqobmtukknr\":\"dxtayrlhm\",\"gnwzsymglzufc\":\"rtihfxtijbpz\",\"hdbihan\":\"zk\",\"y\":\"fhfcb\"},\"id\":\"a\",\"name\":\"ithxqhabifpi\",\"type\":\"xwczbyscnp\"},{\"sku\":{\"tier\":\"Standard\"},\"properties\":{\"provisioningState\":\"Failed\",\"createdAt\":\"2020-12-30T16:23:36Z\",\"updatedAt\":\"2021-07-08T16:34:06Z\",\"serviceBusEndpoint\":\"ybrk\",\"metricId\":\"dumjgrtfwvuk\"},\"location\":\"gaudcc\",\"tags\":{\"cnyejhkryhtnapcz\":\"s\"},\"id\":\"lokjyemkk\",\"name\":\"ni\",\"type\":\"joxzjnchgejspodm\"}],\"nextLink\":\"lzydehojwyahux\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"lfh\",\"status\":\"wmc\",\"createdAt\":\"2021-01-27T06:45:01Z\",\"updatedAt\":\"2021-01-18T03:01:18Z\",\"serviceBusEndpoint\":\"jnpg\",\"metricId\":\"ftadehxnltyfs\",\"privateEndpointConnections\":[{\"properties\":{},\"location\":\"uesnzwdejbavo\",\"id\":\"zdmohctbqvu\",\"name\":\"wxdndnvowgujjug\",\"type\":\"dkcglhsl\"},{\"properties\":{},\"location\":\"dyggdtjixhbku\",\"id\":\"qweykhmenev\",\"name\":\"yexfwh\",\"type\":\"bcibvyvdcsitynn\"}],\"publicNetworkAccess\":\"Enabled\",\"minimumTlsVersion\":\"1.2\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Standard\"},\"location\":\"iqscjeypv\",\"tags\":{\"gm\":\"rkgqhcjrefo\",\"yyvxyqjpkcattpn\":\"qsl\",\"v\":\"jcrcczsqpjhvmda\",\"q\":\"ysou\"},\"id\":\"canoaeupf\",\"name\":\"yhltrpmopjmcm\",\"type\":\"tuo\"},{\"properties\":{\"provisioningState\":\"fu\",\"status\":\"aodsfcpkv\",\"createdAt\":\"2021-10-28T19:56:48Z\",\"updatedAt\":\"2021-08-14T03:06:25Z\",\"serviceBusEndpoint\":\"zmyzydagf\",\"metricId\":\"xbezyiuokktwh\",\"privateEndpointConnections\":[{\"properties\":{},\"location\":\"ywqsmbsurexim\",\"id\":\"yocf\",\"name\":\"fksymddystki\",\"type\":\"uxh\"}],\"publicNetworkAccess\":\"Disabled\",\"minimumTlsVersion\":\"1.2\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Standard\"},\"location\":\"b\",\"tags\":{\"llr\":\"zvyifqrvkdvj\",\"xxbczwtr\":\"vvdfwatkpnpul\"},\"id\":\"wiqzbqjvsovmyo\",\"name\":\"acspkwl\",\"type\":\"zdobpxjmflbvvnch\"},{\"properties\":{\"provisioningState\":\"ciwwzjuqkhr\",\"status\":\"jiwkuofoskghsau\",\"createdAt\":\"2021-09-27T06:41:32Z\",\"updatedAt\":\"2021-10-21T01:55:36Z\",\"serviceBusEndpoint\":\"ied\",\"metricId\":\"gidyjrrf\",\"privateEndpointConnections\":[{\"properties\":{},\"location\":\"v\",\"id\":\"csonpclhoco\",\"name\":\"slkevle\",\"type\":\"gz\"}],\"publicNetworkAccess\":\"Enabled\",\"minimumTlsVersion\":\"1.3\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"Standard\"},\"location\":\"k\",\"tags\":{\"vmezy\":\"iith\",\"burvjxxjnspy\":\"shxmzsbbzoggigrx\",\"udwtiukbl\":\"ptkoenkoukn\"},\"id\":\"ngkpocipazy\",\"name\":\"o\",\"type\":\"gukgjnpiucgygevq\"}],\"nextLink\":\"typmrbpizcdrqjsd\"}") .toObject(RelayNamespaceListResult.class); - Assertions.assertEquals("w", model.value().get(0).location()); - Assertions.assertEquals("dxtayrlhm", model.value().get(0).tags().get("hfpmrqobmtukknr")); + Assertions.assertEquals("iqscjeypv", model.value().get(0).location()); + Assertions.assertEquals("rkgqhcjrefo", model.value().get(0).tags().get("gm")); + Assertions.assertEquals(SkuName.STANDARD, model.value().get(0).sku().name()); Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("lzydehojwyahux", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RelayNamespaceListResult model = new RelayNamespaceListResult().withValue(Arrays.asList( - new RelayNamespaceInner().withLocation("w") - .withTags(mapOf("hfpmrqobmtukknr", "dxtayrlhm", "gnwzsymglzufc", "rtihfxtijbpz", "hdbihan", "zk", "y", - "fhfcb")) - .withSku(new Sku().withTier(SkuTier.STANDARD)), - new RelayNamespaceInner().withLocation("gaudcc") - .withTags(mapOf("cnyejhkryhtnapcz", "s")) - .withSku(new Sku().withTier(SkuTier.STANDARD)))) - .withNextLink("lzydehojwyahux"); - model = BinaryData.fromObject(model).toObject(RelayNamespaceListResult.class); - Assertions.assertEquals("w", model.value().get(0).location()); - Assertions.assertEquals("dxtayrlhm", model.value().get(0).tags().get("hfpmrqobmtukknr")); - Assertions.assertEquals(SkuTier.STANDARD, model.value().get(0).sku().tier()); - Assertions.assertEquals("lzydehojwyahux", model.nextLink()); - } - - // 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; + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_TWO, model.value().get(0).minimumTlsVersion()); + Assertions.assertEquals("typmrbpizcdrqjsd", model.nextLink()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespacePropertiesTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespacePropertiesTests.java index 652b5e1498d3..e8f68a53af17 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespacePropertiesTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayNamespacePropertiesTests.java @@ -1,23 +1,58 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceProperties; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import com.azure.resourcemanager.relay.models.TlsVersion; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; public final class RelayNamespacePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RelayNamespaceProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Succeeded\",\"createdAt\":\"2021-06-10T06:37:05Z\",\"updatedAt\":\"2021-02-22T07:39:39Z\",\"serviceBusEndpoint\":\"n\",\"metricId\":\"v\"}") + "{\"provisioningState\":\"maajrmvdjwzrlo\",\"status\":\"clwhijcoejctbz\",\"createdAt\":\"2021-04-25T10:37:50Z\",\"updatedAt\":\"2021-02-04T17:33:10Z\",\"serviceBusEndpoint\":\"cbkbfkg\",\"metricId\":\"dkexxppofm\",\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"pg\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"jjxhvpmo\"},\"provisioningState\":\"Deleting\"},\"location\":\"dzxibqeojnxqbzvd\",\"id\":\"t\",\"name\":\"ndei\",\"type\":\"btwnpzaoqvuhrhcf\"}],\"publicNetworkAccess\":\"Disabled\",\"minimumTlsVersion\":\"1.3\"}") .toObject(RelayNamespaceProperties.class); + Assertions.assertEquals("pg", model.privateEndpointConnections().get(0).privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.DISCONNECTED, + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("jjxhvpmo", + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.DELETING, + model.privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_THREE, model.minimumTlsVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RelayNamespaceProperties model = new RelayNamespaceProperties(); + RelayNamespaceProperties model = new RelayNamespaceProperties() + .withPrivateEndpointConnections(Arrays + .asList(new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("pg")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.DISCONNECTED) + .withDescription("jjxhvpmo")) + .withProvisioningState(EndPointProvisioningState.DELETING))) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withMinimumTlsVersion(TlsVersion.ONE_THREE); model = BinaryData.fromObject(model).toObject(RelayNamespaceProperties.class); + Assertions.assertEquals("pg", model.privateEndpointConnections().get(0).privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.DISCONNECTED, + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("jjxhvpmo", + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.DELETING, + model.privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_THREE, model.minimumTlsVersion()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayUpdateParametersTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayUpdateParametersTests.java index 987512099510..0d26e418c1ba 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayUpdateParametersTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/RelayUpdateParametersTests.java @@ -1,13 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.azure.resourcemanager.relay.models.PrivateLinkConnectionStatus; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.azure.resourcemanager.relay.models.RelayUpdateParameters; import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; +import com.azure.resourcemanager.relay.models.TlsVersion; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -16,21 +25,52 @@ public final class RelayUpdateParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RelayUpdateParameters model = BinaryData.fromString( - "{\"sku\":{\"tier\":\"Standard\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"createdAt\":\"2021-08-01T19:04:33Z\",\"updatedAt\":\"2021-04-21T06:51:05Z\",\"serviceBusEndpoint\":\"elluwfziton\",\"metricId\":\"qfpjk\"},\"tags\":{\"fxxypininmayhuy\":\"ofpdvh\",\"mihe\":\"bkpodepooginuv\",\"usivye\":\"gnarxzxtheo\",\"nfygxgispemvtz\":\"cciqihnhungbwjz\"},\"id\":\"kufubljo\",\"name\":\"xqeofjaeqjhqjba\",\"type\":\"v\"}") + "{\"sku\":{\"name\":\"Standard\",\"tier\":\"Standard\"},\"properties\":{\"provisioningState\":\"wpyeicxmqciwqvh\",\"status\":\"ixuigdtopbobj\",\"createdAt\":\"2020-12-30T18:35:34Z\",\"updatedAt\":\"2021-03-07T19:37:36Z\",\"serviceBusEndpoint\":\"u\",\"metricId\":\"a\",\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"vvtpgvdfgio\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"tqxln\"},\"provisioningState\":\"Failed\"},\"location\":\"fgugnxkrxdqmid\",\"id\":\"hzrvqd\",\"name\":\"abhjybi\",\"type\":\"ehoqfbowskan\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"lcuiywgqywgndr\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"gpphrcgyn\"},\"provisioningState\":\"Canceled\"},\"location\":\"ecfvmm\",\"id\":\"ofsx\",\"name\":\"zevgb\",\"type\":\"qjqabcypmivkwl\"}],\"publicNetworkAccess\":\"SecuredByPerimeter\",\"minimumTlsVersion\":\"1.2\"},\"tags\":{\"qgtz\":\"nfnbacfionlebxe\",\"wxrjfeallnwsub\":\"dpnqbq\"},\"id\":\"njampm\",\"name\":\"gnzscxaqwo\",\"type\":\"chcbonqvpkvlrxnj\"}") .toObject(RelayUpdateParameters.class); - Assertions.assertEquals("ofpdvh", model.tags().get("fxxypininmayhuy")); + Assertions.assertEquals("nfnbacfionlebxe", model.tags().get("qgtz")); + Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); + Assertions.assertEquals("vvtpgvdfgio", model.privateEndpointConnections().get(0).privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.DISCONNECTED, + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("tqxln", + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.FAILED, + model.privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.SECURED_BY_PERIMETER, model.publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { RelayUpdateParameters model = new RelayUpdateParameters() - .withTags(mapOf("fxxypininmayhuy", "ofpdvh", "mihe", "bkpodepooginuv", "usivye", "gnarxzxtheo", - "nfygxgispemvtz", "cciqihnhungbwjz")) - .withSku(new Sku().withTier(SkuTier.STANDARD)); + .withTags(mapOf("qgtz", "nfnbacfionlebxe", "wxrjfeallnwsub", "dpnqbq")) + .withSku(new Sku().withName(SkuName.STANDARD).withTier(SkuTier.STANDARD)) + .withPrivateEndpointConnections(Arrays.asList(new PrivateEndpointConnectionInner() + .withPrivateEndpoint(new PrivateEndpoint().withId("vvtpgvdfgio")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.DISCONNECTED).withDescription("tqxln")) + .withProvisioningState(EndPointProvisioningState.FAILED), + new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("lcuiywgqywgndr")) + .withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PrivateLinkConnectionStatus.DISCONNECTED) + .withDescription("gpphrcgyn")) + .withProvisioningState(EndPointProvisioningState.CANCELED))) + .withPublicNetworkAccess(PublicNetworkAccess.SECURED_BY_PERIMETER) + .withMinimumTlsVersion(TlsVersion.ONE_TWO); model = BinaryData.fromObject(model).toObject(RelayUpdateParameters.class); - Assertions.assertEquals("ofpdvh", model.tags().get("fxxypininmayhuy")); + Assertions.assertEquals("nfnbacfionlebxe", model.tags().get("qgtz")); + Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); Assertions.assertEquals(SkuTier.STANDARD, model.sku().tier()); + Assertions.assertEquals("vvtpgvdfgio", model.privateEndpointConnections().get(0).privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkConnectionStatus.DISCONNECTED, + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("tqxln", + model.privateEndpointConnections().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals(EndPointProvisioningState.FAILED, + model.privateEndpointConnections().get(0).provisioningState()); + Assertions.assertEquals(PublicNetworkAccess.SECURED_BY_PERIMETER, model.publicNetworkAccess()); + Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersion()); } // Use "Map.of" if available diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/ResourceNamespacePatchTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/ResourceNamespacePatchTests.java index 7f99b153854b..aa4e7a040e69 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/ResourceNamespacePatchTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/ResourceNamespacePatchTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; @@ -14,17 +14,17 @@ public final class ResourceNamespacePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResourceNamespacePatch model = BinaryData.fromString( - "{\"tags\":{\"gsntnbybkzgcwr\":\"jqul\",\"skcqvkocrcjd\":\"clxxwrljdo\",\"lssai\":\"wtnhxbnjbiksqr\"},\"id\":\"qpjwnzlljfm\",\"name\":\"pee\",\"type\":\"vmgxsab\"}") + "{\"tags\":{\"enjbdlwtgrhp\":\"eipheoflokeyy\",\"umasxazjpq\":\"jp\"},\"id\":\"gual\",\"name\":\"b\",\"type\":\"xhejjzzvdud\"}") .toObject(ResourceNamespacePatch.class); - Assertions.assertEquals("jqul", model.tags().get("gsntnbybkzgcwr")); + Assertions.assertEquals("eipheoflokeyy", model.tags().get("enjbdlwtgrhp")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceNamespacePatch model = new ResourceNamespacePatch() - .withTags(mapOf("gsntnbybkzgcwr", "jqul", "skcqvkocrcjd", "clxxwrljdo", "lssai", "wtnhxbnjbiksqr")); + ResourceNamespacePatch model + = new ResourceNamespacePatch().withTags(mapOf("enjbdlwtgrhp", "eipheoflokeyy", "umasxazjpq", "jp")); model = BinaryData.fromObject(model).toObject(ResourceNamespacePatch.class); - Assertions.assertEquals("jqul", model.tags().get("gsntnbybkzgcwr")); + Assertions.assertEquals("eipheoflokeyy", model.tags().get("enjbdlwtgrhp")); } // Use "Map.of" if available diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/SkuTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/SkuTests.java index 0e1de5e3ad9a..72ac4c4a8d09 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/SkuTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/SkuTests.java @@ -1,25 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.models.SkuName; import com.azure.resourcemanager.relay.models.SkuTier; import org.junit.jupiter.api.Assertions; public final class SkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString("{\"tier\":\"Standard\"}").toObject(Sku.class); + Sku model = BinaryData.fromString("{\"name\":\"Standard\",\"tier\":\"Standard\"}").toObject(Sku.class); + Assertions.assertEquals(SkuName.STANDARD, model.name()); Assertions.assertEquals(SkuTier.STANDARD, model.tier()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Sku model = new Sku().withTier(SkuTier.STANDARD); + Sku model = new Sku().withName(SkuName.STANDARD).withTier(SkuTier.STANDARD); model = BinaryData.fromObject(model).toObject(Sku.class); + Assertions.assertEquals(SkuName.STANDARD, model.name()); Assertions.assertEquals(SkuTier.STANDARD, model.tier()); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateAuthorizationRuleWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateAuthorizationRuleWithResponseMockTests.java index daae5e5a8b01..843b557825c7 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateAuthorizationRuleWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; @@ -24,21 +24,21 @@ public final class WcfRelaysCreateOrUpdateAuthorizationRuleWithResponseMockTests @Test public void testCreateOrUpdateAuthorizationRuleWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"rights\":[\"Listen\",\"Manage\",\"Manage\"]},\"id\":\"pcyvahfnljkyqx\",\"name\":\"vuujq\",\"type\":\"idokgjlj\"}"; + = "{\"properties\":{\"rights\":[\"Send\",\"Send\",\"Listen\"]},\"location\":\"vpycanuzbp\",\"id\":\"afkuwb\",\"name\":\"rnwb\",\"type\":\"ehhseyvjusrts\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AuthorizationRule response = manager.wcfRelays() - .createOrUpdateAuthorizationRuleWithResponse("senhwlrs", "frzpwvlqdqgb", "qylihkaetckt", "fcivfsnkym", + .createOrUpdateAuthorizationRuleWithResponse("rpabg", "epsbjtazqu", "xywpmueefjzwfqkq", "jidsuyonobglaoc", new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.SEND)), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(AccessRights.LISTEN, response.rights().get(0)); + Assertions.assertEquals(AccessRights.SEND, response.rights().get(0)); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteAuthorizationRuleWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteAuthorizationRuleWithResponseMockTests.java index 3ed031a878b5..cc83c8e23956 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteAuthorizationRuleWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteAuthorizationRuleWithResponse() throws Exception { RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.wcfRelays() - .deleteAuthorizationRuleWithResponse("oxgvclt", "gsncghkjeszz", "bijhtxfvgxbf", "mxnehmp", + .deleteAuthorizationRuleWithResponse("hspkdeemao", "mx", "gkvtmelmqkrhah", "ljuahaquhcdh", com.azure.core.util.Context.NONE); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteWithResponseMockTests.java index abc394eec705..3a0f0cbc8dc0 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.wcfRelays() - .deleteWithResponse("buxwgip", "honowkgshwank", "xzbinjeputt", com.azure.core.util.Context.NONE); + .deleteWithResponse("lrbpbewtghfgbl", "gw", "zvlvqhjkbegib", com.azure.core.util.Context.NONE); } } diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleWithResponseMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleWithResponseMockTests.java index 6a172644f563..c59b49dad8ad 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleWithResponseMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.models.AccessRights; @@ -22,17 +22,17 @@ public final class WcfRelaysGetAuthorizationRuleWithResponseMockTests { @Test public void testGetAuthorizationRuleWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"rights\":[\"Manage\",\"Listen\",\"Listen\",\"Listen\"]},\"id\":\"zahmgkbrpyydhibn\",\"name\":\"qqkpikadrg\",\"type\":\"tqagnbuynh\"}"; + = "{\"properties\":{\"rights\":[\"Manage\"]},\"location\":\"dhbt\",\"id\":\"phywpnvj\",\"name\":\"oqnermclfpl\",\"type\":\"hoxus\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AuthorizationRule response = manager.wcfRelays() - .getAuthorizationRuleWithResponse("ec", "godebfqkkrbmpu", "gr", "wflzlfbxzpuzy", + .getAuthorizationRuleWithResponse("wrupqsxvnmicykvc", "o", "eil", "vnotyfjfcnj", com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysListAuthorizationRulesMockTests.java b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysListAuthorizationRulesMockTests.java index a8b20ba4c017..4d51c1a4ada4 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysListAuthorizationRulesMockTests.java +++ b/sdk/relay/azure-resourcemanager-relay/src/test/java/com/azure/resourcemanager/relay/generated/WcfRelaysListAuthorizationRulesMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.relay.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.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.models.AccessRights; @@ -23,18 +23,18 @@ public final class WcfRelaysListAuthorizationRulesMockTests { @Test public void testListAuthorizationRules() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"rights\":[\"Listen\",\"Listen\"]},\"id\":\"lyaxuc\",\"name\":\"nuqszfkbey\",\"type\":\"ewrmjmwvvjektc\"}]}"; + = "{\"value\":[{\"properties\":{\"rights\":[\"Send\"]},\"location\":\"zlfmisgwbnbbeld\",\"id\":\"k\",\"name\":\"baliourqhakauha\",\"type\":\"hsfwxosowzxcug\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); RelayManager manager = RelayManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.wcfRelays() - .listAuthorizationRules("ryavwhheunmmqh", "yxzk", "noc", com.azure.core.util.Context.NONE); + .listAuthorizationRules("duala", "xqpvfadmw", "rcrgvx", com.azure.core.util.Context.NONE); - Assertions.assertEquals(AccessRights.LISTEN, response.iterator().next().rights().get(0)); + Assertions.assertEquals(AccessRights.SEND, response.iterator().next().rights().get(0)); } } diff --git a/sdk/relay/azure-resourcemanager-relay/tsp-location.yaml b/sdk/relay/azure-resourcemanager-relay/tsp-location.yaml new file mode 100644 index 000000000000..332ba6640a81 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/relay/resource-manager/Microsoft.Relay/Relay +commit: e03e8c1a6ebebcd8e8c303ce938b810546bd8a06 +repo: Azure/azure-rest-api-specs +additionalDirectories: From 796265a5b3f9b3be859e8ade1a0b2bc8e7eca62e Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 27 Jul 2026 09:51:43 +0800 Subject: [PATCH 2/2] relay: set revapi.skip=true for expected TypeSpec-migration breaks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 432a85d2-5d70-420b-8729-e72cbcc44eeb --- sdk/relay/azure-resourcemanager-relay/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/relay/azure-resourcemanager-relay/pom.xml b/sdk/relay/azure-resourcemanager-relay/pom.xml index 389b0db0c797..a1dcdd7ba1b2 100644 --- a/sdk/relay/azure-resourcemanager-relay/pom.xml +++ b/sdk/relay/azure-resourcemanager-relay/pom.xml @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true