From 0c59ef0cd4eaeeebfc28f3ace138abc2010a8f5f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 2 Nov 2022 02:20:46 +0000 Subject: [PATCH] CodeGen from PR 20745 in Azure/azure-rest-api-specs Merge 07058facc3cb00a4216ee72e7fd6b45146bf5e59 into 60be34ab72f1483aef8feede852bc9f2f1921897 --- .../azure-resourcemanager-relay/CHANGELOG.md | 4 +- .../azure-resourcemanager-relay/README.md | 4 +- .../azure-resourcemanager-relay/SAMPLE.md | 356 ++- sdk/relay/azure-resourcemanager-relay/pom.xml | 2 +- .../resourcemanager/relay/RelayManager.java | 63 +- .../relay/fluent/HybridConnectionsClient.java | 252 +- .../relay/fluent/NamespacesClient.java | 384 +-- .../PrivateEndpointConnectionsClient.java | 175 ++ .../fluent/PrivateLinkResourcesClient.java | 73 + .../relay/fluent/RelayApi.java | 28 +- .../relay/fluent/WcfRelaysClient.java | 248 +- .../relay/fluent/models/AccessKeysInner.java | 10 +- .../fluent/models/AuthorizationRuleInner.java | 55 +- .../models/AuthorizationRuleProperties.java | 6 +- .../CheckNameAvailabilityResultInner.java | 7 +- .../fluent/models/HybridConnectionInner.java | 35 + .../models/HybridConnectionProperties.java | 17 +- .../fluent/models/NetworkRuleSetInner.java | 134 + .../models/NetworkRuleSetProperties.java | 111 + .../relay/fluent/models/OperationInner.java | 63 +- .../PrivateEndpointConnectionInner.java | 147 + .../PrivateEndpointConnectionProperties.java | 112 + .../models/PrivateLinkResourceInner.java | 190 ++ .../models/PrivateLinkResourceProperties.java | 103 + .../PrivateLinkResourcesListResultInner.java | 80 + .../fluent/models/RelayNamespaceInner.java | 85 +- .../models/RelayNamespaceProperties.java | 92 +- .../relay/fluent/models/WcfRelayInner.java | 35 + .../fluent/models/WcfRelayProperties.java | 20 +- .../implementation/AuthorizationRuleImpl.java | 34 +- .../implementation/HybridConnectionImpl.java | 18 + .../HybridConnectionsClientImpl.java | 1111 ++++---- .../implementation/HybridConnectionsImpl.java | 174 +- .../implementation/NamespacesClientImpl.java | 2377 ++++++++++------- .../relay/implementation/NamespacesImpl.java | 222 +- .../implementation/NetworkRuleSetImpl.java | 66 + .../relay/implementation/OperationImpl.java | 12 + .../implementation/OperationsClientImpl.java | 6 +- .../PrivateEndpointConnectionImpl.java | 184 ++ .../PrivateEndpointConnectionsClientImpl.java | 1035 +++++++ .../PrivateEndpointConnectionsImpl.java | 209 ++ .../PrivateLinkResourceImpl.java | 64 + .../PrivateLinkResourcesClientImpl.java | 394 +++ .../PrivateLinkResourcesImpl.java | 87 + .../PrivateLinkResourcesListResultImpl.java | 51 + .../relay/implementation/RelayApiBuilder.java | 40 +- .../relay/implementation/RelayApiImpl.java | 56 +- .../implementation/RelayNamespaceImpl.java | 56 +- .../relay/implementation/WcfRelayImpl.java | 18 + .../implementation/WcfRelaysClientImpl.java | 1092 ++++---- .../relay/implementation/WcfRelaysImpl.java | 168 +- .../relay/models/AccessRights.java | 51 +- .../relay/models/AuthorizationRule.java | 81 +- .../models/AuthorizationRuleListResult.java | 7 +- .../relay/models/CheckNameAvailability.java | 9 +- .../relay/models/ConnectionState.java | 76 + .../relay/models/DefaultAction.java | 38 + .../models/EndPointProvisioningState.java | 50 + .../relay/models/HybridConnection.java | 30 + .../models/HybridConnectionListResult.java | 7 +- .../relay/models/HybridConnections.java | 202 +- .../resourcemanager/relay/models/KeyType.java | 49 +- .../relay/models/NWRuleSetIpRules.java | 76 + .../relay/models/Namespaces.java | 240 +- .../relay/models/NetworkRuleIpAction.java | 35 + .../relay/models/NetworkRuleSet.java | 69 + .../relay/models/Operation.java | 23 +- .../relay/models/OperationDisplay.java | 33 +- .../relay/models/OperationListResult.java | 8 +- .../relay/models/PrivateEndpoint.java | 50 + .../models/PrivateEndpointConnection.java | 248 ++ .../PrivateEndpointConnectionListResult.java | 81 + .../models/PrivateEndpointConnections.java | 144 + .../models/PrivateLinkConnectionStatus.java | 44 + .../relay/models/PrivateLinkResource.java | 60 + .../relay/models/PrivateLinkResources.java | 65 + .../PrivateLinkResourcesListResult.java | 32 + .../relay/models/ProvisioningStateEnum.java | 59 - .../relay/models/PublicNetworkAccess.java | 41 + .../models/RegenerateAccessKeyParameters.java | 9 +- .../relay/models/RelayNamespace.java | 92 +- .../models/RelayNamespaceListResult.java | 7 +- .../relay/models/RelayUpdateParameters.java | 68 +- .../relay/models/Relaytype.java | 6 +- .../relay/models/ResourceNamespacePatch.java | 4 + .../resourcemanager/relay/models/Sku.java | 14 +- .../resourcemanager/relay/models/SkuName.java | 35 + .../resourcemanager/relay/models/SkuTier.java | 45 +- .../relay/models/UnavailableReason.java | 66 +- .../relay/models/WcfRelay.java | 30 + .../relay/models/WcfRelays.java | 200 +- .../relay/models/WcfRelaysListResult.java | 7 +- ...reateOrUpdateAuthorizationRuleSamples.java | 2 +- ...ybridConnectionsCreateOrUpdateSamples.java | 2 +- ...ectionsDeleteAuthorizationRuleSamples.java | 6 +- .../HybridConnectionsDeleteSamples.java | 2 +- ...onnectionsGetAuthorizationRuleSamples.java | 6 +- .../HybridConnectionsGetSamples.java | 2 +- ...nectionsListAuthorizationRulesSamples.java | 6 +- ...bridConnectionsListByNamespaceSamples.java | 2 +- .../HybridConnectionsListKeysSamples.java | 2 +- ...ybridConnectionsRegenerateKeysSamples.java | 6 +- ...amespacesCheckNameAvailabilitySamples.java | 5 +- ...reateOrUpdateAuthorizationRuleSamples.java | 2 +- ...esCreateOrUpdateNetworkRuleSetSamples.java | 42 + .../NamespacesCreateOrUpdateSamples.java | 9 +- ...espacesDeleteAuthorizationRuleSamples.java | 6 +- .../generated/NamespacesDeleteSamples.java | 4 +- ...NamespacesGetAuthorizationRuleSamples.java | 6 +- .../NamespacesGetByResourceGroupSamples.java | 4 +- .../NamespacesGetNetworkRuleSetSamples.java | 24 + ...mespacesListAuthorizationRulesSamples.java | 6 +- .../NamespacesListByResourceGroupSamples.java | 2 +- .../generated/NamespacesListKeysSamples.java | 2 +- .../generated/NamespacesListSamples.java | 2 +- .../NamespacesRegenerateKeysSamples.java | 6 +- .../generated/NamespacesUpdateSamples.java | 4 +- .../generated/OperationsListSamples.java | 2 +- ...pointConnectionsCreateOrUpdateSamples.java | 34 + ...ivateEndpointConnectionsDeleteSamples.java | 24 + .../PrivateEndpointConnectionsGetSamples.java | 25 + ...PrivateEndpointConnectionsListSamples.java | 22 + .../PrivateLinkResourcesGetSamples.java | 25 + .../PrivateLinkResourcesListSamples.java | 22 + ...reateOrUpdateAuthorizationRuleSamples.java | 2 +- .../WcfRelaysCreateOrUpdateSamples.java | 2 +- ...fRelaysDeleteAuthorizationRuleSamples.java | 6 +- .../generated/WcfRelaysDeleteSamples.java | 2 +- .../WcfRelaysGetAuthorizationRuleSamples.java | 6 +- .../relay/generated/WcfRelaysGetSamples.java | 2 +- ...cfRelaysListAuthorizationRulesSamples.java | 6 +- .../WcfRelaysListByNamespaceSamples.java | 2 +- .../generated/WcfRelaysListKeysSamples.java | 2 +- .../WcfRelaysRegenerateKeysSamples.java | 6 +- 134 files changed, 9638 insertions(+), 3568 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 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 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/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/PrivateEndpointConnectionListResult.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/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 diff --git a/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md b/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md index 30d1da547bd28..8c0fb092e9c0d 100644 --- a/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md +++ b/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2022-11-02) + +- 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-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/relay/azure-resourcemanager-relay/README.md b/sdk/relay/azure-resourcemanager-relay/README.md index 68e57750f9317..2058d481f7084 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 tag package-2021-11. 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.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/relay/azure-resourcemanager-relay/SAMPLE.md b/sdk/relay/azure-resourcemanager-relay/SAMPLE.md index e466aa6107acb..b1008cfb19543 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) @@ -52,7 +66,7 @@ /** Samples for HybridConnections CreateOrUpdate. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionCreate.json */ /** * Sample code: RelayHybridConnectionCreate. @@ -81,7 +95,7 @@ import java.util.Arrays; /** Samples for HybridConnections CreateOrUpdateAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionAuthorizationRuleCreate.json */ /** * Sample code: RelayHybridConnectionAuthorizationRuleCreate. @@ -111,7 +125,7 @@ import com.azure.core.util.Context; /** Samples for HybridConnections Delete. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridconnectionDelete.json */ /** * Sample code: RelayHybridconnectionDelete. @@ -134,14 +148,14 @@ import com.azure.core.util.Context; /** Samples for HybridConnections DeleteAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionAuthorizationRuleDelete.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleDelete. + * Sample code: RelayHybridConnectionAuthorizationRuleDelete. * * @param manager Entry point to RelayManager. */ - public static void relayHybridConnectionAutorizationRuleDelete( + public static void relayHybridConnectionAuthorizationRuleDelete( com.azure.resourcemanager.relay.RelayManager manager) { manager .hybridConnections() @@ -163,7 +177,7 @@ import com.azure.core.util.Context; /** Samples for HybridConnections Get. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionGet.json */ /** * Sample code: RelayHybridConnectionGet. @@ -186,14 +200,14 @@ import com.azure.core.util.Context; /** Samples for HybridConnections GetAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( @@ -214,14 +228,14 @@ import com.azure.core.util.Context; /** Samples for HybridConnections ListAuthorizationRules. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionAuthorizationRuleListAll.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleListAll. + * Sample code: RelayHybridConnectionAuthorizationRuleListAll. * * @param manager Entry point to RelayManager. */ - public static void relayHybridConnectionAutorizationRuleListAll( + public static void relayHybridConnectionAuthorizationRuleListAll( com.azure.resourcemanager.relay.RelayManager manager) { manager .hybridConnections() @@ -239,7 +253,7 @@ import com.azure.core.util.Context; /** Samples for HybridConnections ListByNamespace. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionListAll.json */ /** * Sample code: RelayHybridConnectionListAll. @@ -260,7 +274,7 @@ import com.azure.core.util.Context; /** Samples for HybridConnections ListKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionAuthorizationRuleListKey.json */ /** * Sample code: RelayHybridConnectionAuthorizationRuleListKey. @@ -291,14 +305,14 @@ import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; /** Samples for HybridConnections RegenerateKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayHybridConnectionAuthorizationRuleRegenrateKey. + * Sample code: RelayHybridConnectionAuthorizationRuleRegenerateKey. * * @param manager Entry point to RelayManager. */ - public static void relayHybridConnectionAuthorizationRuleRegenrateKey( + public static void relayHybridConnectionAuthorizationRuleRegenerateKey( com.azure.resourcemanager.relay.RelayManager manager) { manager .hybridConnections() @@ -322,7 +336,7 @@ import com.azure.resourcemanager.relay.models.CheckNameAvailability; /** Samples for Namespaces 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceCheckNameAvailability.json */ /** * Sample code: RelayCheckNameAvailability. @@ -332,7 +346,8 @@ public final class NamespacesCheckNameAvailabilitySamples { public static void relayCheckNameAvailability(com.azure.resourcemanager.relay.RelayManager manager) { manager .namespaces() - .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("sdk-Namespace1321"), Context.NONE); + .checkNameAvailabilityWithResponse( + new CheckNameAvailability().withName("example-RelayNamespace1321"), Context.NONE); } } ``` @@ -341,6 +356,7 @@ 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 java.util.HashMap; import java.util.Map; @@ -348,7 +364,7 @@ import java.util.Map; /** Samples for Namespaces CreateOrUpdate. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceCreate.json */ /** * Sample code: RelayNamespaceCreate. @@ -358,11 +374,11 @@ 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)) .create(); } @@ -388,7 +404,7 @@ import java.util.Arrays; /** Samples for Namespaces CreateOrUpdateAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceAuthorizationRuleCreate.json */ /** * Sample code: RelayNameSpaceAuthorizationRuleCreate. @@ -406,6 +422,47 @@ public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { } ``` +### Namespaces_CreateOrUpdateNetworkRuleSet + +```java +import com.azure.core.util.Context; +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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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() + .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))), + Context.NONE); + } +} +``` + ### Namespaces_Delete ```java @@ -414,7 +471,7 @@ import com.azure.core.util.Context; /** Samples for Namespaces Delete. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceDelete.json */ /** * Sample code: RelayNameSpaceDelete. @@ -422,7 +479,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", Context.NONE); + manager.namespaces().delete("SouthCentralUS", "example-RelayNamespace-5849", Context.NONE); } } ``` @@ -435,14 +492,14 @@ import com.azure.core.util.Context; /** Samples for Namespaces DeleteAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( @@ -459,14 +516,14 @@ import com.azure.core.util.Context; /** Samples for Namespaces GetAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( @@ -483,7 +540,7 @@ import com.azure.core.util.Context; /** Samples for Namespaces GetByResourceGroup. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceGet.json */ /** * Sample code: RelayNameSpaceGet. @@ -491,7 +548,30 @@ public final class NamespacesGetByResourceGroupSamples { * @param manager Entry point to RelayManager. */ public static void relayNameSpaceGet(com.azure.resourcemanager.relay.RelayManager manager) { - manager.namespaces().getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", Context.NONE); + manager.namespaces().getByResourceGroupWithResponse("RG-eg", "example-RelayRelayNamespace-01", Context.NONE); + } +} +``` + +### Namespaces_GetNetworkRuleSet + +```java +import com.azure.core.util.Context; + +/** Samples for Namespaces GetNetworkRuleSet. */ +public final class NamespacesGetNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", Context.NONE); } } ``` @@ -504,7 +584,7 @@ import com.azure.core.util.Context; /** Samples for Namespaces List. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceListBySubscription.json */ /** * Sample code: RelayNameSpaceListBySubscription. @@ -525,14 +605,14 @@ import com.azure.core.util.Context; /** Samples for Namespaces ListAuthorizationRules. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", Context.NONE); } } @@ -546,7 +626,7 @@ import com.azure.core.util.Context; /** Samples for Namespaces ListByResourceGroup. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceListByResourceGroup.json */ /** * Sample code: RelayNameSpaceListByResourceGroup. @@ -567,7 +647,7 @@ import com.azure.core.util.Context; /** Samples for Namespaces ListKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceAuthorizationRuleListKey.json */ /** * Sample code: RelayNameSpaceAuthorizationRuleListKey. @@ -593,14 +673,14 @@ import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; /** Samples for Namespaces RegenerateKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayNameSpaceAuthorizationRuleRegenrateKey. + * Sample code: RelayNameSpaceAuthorizationRuleRegenerateKey. * * @param manager Entry point to RelayManager. */ - public static void relayNameSpaceAuthorizationRuleRegenrateKey( + public static void relayNameSpaceAuthorizationRuleRegenerateKey( com.azure.resourcemanager.relay.RelayManager manager) { manager .namespaces() @@ -625,7 +705,7 @@ import java.util.Map; /** Samples for Namespaces Update. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceUpdate.json */ /** * Sample code: RelayNameSpaceUpdate. @@ -636,7 +716,7 @@ public final class NamespacesUpdateSamples { RelayNamespace resource = manager .namespaces() - .getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", Context.NONE) + .getByResourceGroupWithResponse("RG-eg", "example-RelayRelayNamespace-01", Context.NONE) .getValue(); resource .update() @@ -665,7 +745,7 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/RelayOperations_List.json */ /** * Sample code: RelayOperationsList. @@ -678,6 +758,152 @@ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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}", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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}", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/PrivateEndpointConnections/PrivateLinkResourcesGet.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateEndPointConnectionGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .privateLinkResources() + .getWithResponse( + "resourcegroup", "example-RelayNamespace-5849", "{PrivateLinkResource name}", Context.NONE); + } +} +``` + +### PrivateLinkResources_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources List. */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", Context.NONE); + } +} +``` + ### WcfRelays_CreateOrUpdate ```java @@ -686,7 +912,7 @@ import com.azure.resourcemanager.relay.models.Relaytype; /** Samples for WcfRelays CreateOrUpdate. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/Relay/RelayCreate.json */ /** * Sample code: RelayCreate. @@ -717,7 +943,7 @@ import java.util.Arrays; /** Samples for WcfRelays CreateOrUpdateAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/Relay/RelayAuthorizationRuleCreate.json */ /** * Sample code: RelayAuthorizationRuleCreate. @@ -746,7 +972,7 @@ import com.azure.core.util.Context; /** Samples for WcfRelays Delete. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/Relay/RelayDelete.json */ /** * Sample code: RelayDelete. @@ -769,14 +995,14 @@ import com.azure.core.util.Context; /** Samples for WcfRelays DeleteAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( @@ -797,7 +1023,7 @@ import com.azure.core.util.Context; /** Samples for WcfRelays Get. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/Relay/RelayGet.json */ /** * Sample code: RelayGet. @@ -820,14 +1046,14 @@ import com.azure.core.util.Context; /** Samples for WcfRelays GetAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( @@ -848,14 +1074,14 @@ import com.azure.core.util.Context; /** Samples for WcfRelays ListAuthorizationRules. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", Context.NONE); @@ -871,7 +1097,7 @@ import com.azure.core.util.Context; /** Samples for WcfRelays ListByNamespace. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/Relay/RelayListAll.json */ /** * Sample code: RelayListAll. @@ -892,7 +1118,7 @@ import com.azure.core.util.Context; /** Samples for WcfRelays ListKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/Relay/RelayAuthorizationRuleListKey.json */ /** * Sample code: RelayAuthorizationRuleListKey.json. @@ -922,14 +1148,14 @@ import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; /** Samples for WcfRelays RegenerateKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( diff --git a/sdk/relay/azure-resourcemanager-relay/pom.xml b/sdk/relay/azure-resourcemanager-relay/pom.xml index ca5597b34fa02..d52bd083e58a6 100644 --- a/sdk/relay/azure-resourcemanager-relay/pom.xml +++ b/sdk/relay/azure-resourcemanager-relay/pom.xml @@ -13,7 +13,7 @@ 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 tag package-2021-11. https://github.com/Azure/azure-sdk-for-java 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 f23b315b072f5..d3677b4caea7c 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 @@ -27,11 +27,15 @@ 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.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.relay.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.relay.implementation.RelayApiBuilder; 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; @@ -42,14 +46,18 @@ /** Entry point to RelayManager. Use these API to manage Azure Relay resources through Azure Resource Manager. */ public final class RelayManager { - private Operations operations; - private Namespaces namespaces; private HybridConnections hybridConnections; private WcfRelays wcfRelays; + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private Operations operations; + private final RelayApi clientObject; private RelayManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -215,7 +223,7 @@ public RelayManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.relay") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -272,18 +280,6 @@ public RelayManager authenticate(TokenCredential credential, AzureProfile profil } } - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - /** * Gets the resource collection API of Namespaces. It manages RelayNamespace, AuthorizationRule. * @@ -320,6 +316,43 @@ public WcfRelays wcfRelays() { return wcfRelays; } + /** + * 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 Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + /** * @return Wrapped service client RelayApi providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. 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 df616e9f65c1b..8c9e146f81892 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 @@ -17,89 +17,87 @@ /** An instance of this class provides access to all the operations defined in HybridConnectionsClient. */ public interface HybridConnectionsClient { /** - * Lists the hybrid connection within the namespace. + * Authorization rules for 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 com.azure.core.management.exception.ManagementException thrown 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 the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String hybridConnectionName); /** - * Lists the hybrid connection within the namespace. + * Authorization rules for 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. * @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 the response from the list namespace 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. - * - * @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 com.azure.core.management.exception.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 createOrUpdate( - String resourceGroupName, String namespaceName, String hybridConnectionName, HybridConnectionInner parameters); + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Creates or updates an authorization rule for 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. - * @param parameters Parameters supplied to create a hybrid connection. + * @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 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( + Response createOrUpdateAuthorizationRuleWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, - HybridConnectionInner parameters, + 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 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); /** - * Deletes a hybrid connection. + * Deletes a hybrid connection authorization rule. * * @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 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. @@ -107,265 +105,267 @@ Response createOrUpdateWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - 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 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); /** - * Returns the description for the specified hybrid connection. + * Hybrid connection authorization rule for a hybrid connection by name. * * @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 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 getWithResponse( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + String authorizationRuleName, + Context context); /** - * Authorization rules for 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 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 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) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String hybridConnectionName); + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName); /** - * Authorization rules 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 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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return namespace/Relay Connection String along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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); /** - * 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 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. * @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( + Response regenerateKeysWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters, + 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 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); /** - * Deletes a hybrid connection authorization rule. + * Lists the hybrid connection within the namespace. * * @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 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 the list hybrid connection operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Lists the hybrid connection within the namespace. * * @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 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 the list hybrid connection operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Context 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 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 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( + Response createOrUpdateWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName, + 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 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); /** - * 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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - Context context); + 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 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); /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Returns the description for the specified hybrid connection. * * @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 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 regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context); + Response getWithResponse( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); + + /** + * Returns the description for the specified 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 com.azure.core.management.exception.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); } 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 b44498cc37207..64560323af33c 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 @@ -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; @@ -22,266 +23,352 @@ /** An instance of this class provides access to all the operations defined in NamespacesClient. */ public interface NamespacesClient { /** - * Check the specified namespace name availability. + * Authorization rules for a namespace. * - * @param parameters Parameters to check availability of the specified namespace name. + * @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 description of the check name availability request properties. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); /** - * Check the specified namespace name availability. + * Authorization rules for a namespace. * - * @param parameters Parameters to check availability of the specified namespace name. + * @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 description of the check name availability request properties along with {@link Response}. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context); + + /** + * Creates or updates an authorization rule for a namespace. + * + * @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 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 single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - CheckNameAvailability parameters, Context context); + 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + AuthorizationRuleInner parameters); /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Deletes a namespace authorization rule. * + * @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 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 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 rule for a namespace by name. * * @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 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 listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); /** - * Create Azure Relay namespace. + * Authorization rule for a namespace by name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 the {@link SyncPoller} for polling of description of a namespace resource. + * @return single item in a List or Get AuthorizationRule operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( - String resourceGroupName, String namespaceName, RelayNamespaceInner parameters); + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Create Azure Relay namespace. + * 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 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 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 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 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. + * Check the specified namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. + * @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 com.azure.core.management.exception.ManagementException 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 the check name availability request properties along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context); /** - * Deletes an existing namespace. This operation also removes all associated resources under 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 parameters Parameters to check availability of the specified 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 the check name availability request properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName); + CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters); /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * + * @throws com.azure.core.management.exception.ManagementException thrown 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 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 from the list namespace operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown 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); + + /** + * 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 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}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Returns the description for the specified namespace. + * Create Azure Relay namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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. + * @return the {@link SyncPoller} for polling of description of a namespace resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - RelayNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName); + @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 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.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( + 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. + * Create Azure Relay namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name. - * @param parameters Parameters for updating a namespace resource. + * @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) - RelayNamespaceInner update(String resourceGroupName, String namespaceName, RelayUpdateParameters parameters); + RelayNamespaceInner createOrUpdate(String resourceGroupName, String namespaceName, RelayNamespaceInner parameters); /** - * 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 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 com.azure.core.management.exception.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. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String namespaceName, RelayUpdateParameters parameters, Context context); + RelayNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context 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 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 namespaceName The namespace name. @@ -289,179 +376,152 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 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 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); /** - * 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 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, Context context); /** - * Deletes a namespace authorization rule. + * Returns the description for the specified 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 com.azure.core.management.exception.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) - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context); /** - * Deletes a namespace authorization rule. + * Returns the description for the specified 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 com.azure.core.management.exception.ManagementException 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 a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + RelayNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName); /** - * Authorization rule for a namespace by name. + * 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule 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 com.azure.core.management.exception.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 a namespace resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName); + Response updateWithResponse( + String resourceGroupName, String namespaceName, RelayUpdateParameters parameters, Context context); /** - * Authorization rule for a namespace by name. + * 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @param parameters Parameters for updating 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 authorization rule along with {@link Response}. + * @return description of a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + RelayNamespaceInner update(String resourceGroupName, String namespaceName, RelayUpdateParameters parameters); /** - * 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 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. + * @return description of topic resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); + 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @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 along with {@link Response}. + * @return description of topic resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + NetworkRuleSetInner createOrUpdateNetworkRuleSet( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); /** - * Regenerates the primary or secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters); + Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context); /** - * Regenerates the primary or secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context); + NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName); } 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 0000000000000..550962517bb9b --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,175 @@ +// 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.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 the available PrivateEndpointConnections within a 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 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 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 available PrivateEndpointConnections within a namespace as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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 a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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); +} 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 0000000000000..5d667c7c9eee8 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,73 @@ +// 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.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 description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The PrivateLinkResource 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 privateLinkResourceName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The PrivateLinkResource 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) + PrivateLinkResourceInner get(String resourceGroupName, String namespaceName, String privateLinkResourceName); + + /** + * Gets lists of resources that supports Privatelinks. + * + * @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 lists of resources that supports Privatelinks along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Gets lists of resources that supports Privatelinks. + * + * @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 lists of resources that supports Privatelinks. + */ + @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/RelayApi.java index 841eec0752dc0..9fe8f532ec3d8 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/RelayApi.java @@ -45,13 +45,6 @@ public interface RelayApi { */ Duration getDefaultPollInterval(); - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - /** * Gets the NamespacesClient object to access its operations. * @@ -72,4 +65,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 OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); } 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 bd3bbf3e97f81..ac227a7a50a04 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 @@ -17,350 +17,350 @@ /** An instance of this class provides access to all the operations defined in WcfRelaysClient. */ public interface WcfRelaysClient { /** - * Lists the WCF relays within the namespace. + * Authorization rules for a WCF relay. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 of the list WCF relay operation as paginated response with {@link PagedIterable}. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNamespace(String resourceGroupName, String namespaceName); + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String relayName); /** - * Lists the WCF relays within the namespace. + * Authorization rules for a 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 com.azure.core.management.exception.ManagementException thrown 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 the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String relayName, Context context); /** - * Creates or updates a WCF relay. This operation is idempotent. + * Creates or updates an authorization rule for a WCF relay. * * @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 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 the WCF relay resource. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - WcfRelayInner createOrUpdate( - String resourceGroupName, String namespaceName, String relayName, WcfRelayInner parameters); + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context); /** - * Creates or updates a WCF relay. This operation is idempotent. + * Creates or updates an authorization rule for a WCF relay. * * @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. + * @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 the WCF relay resource along with {@link Response}. + * @return single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String namespaceName, String relayName, WcfRelayInner parameters, Context context); + AuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + AuthorizationRuleInner parameters); /** - * Deletes a WCF relay. + * Deletes a WCF relay authorization rule. * * @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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, String relayName); + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + Context context); /** - * Deletes a WCF relay. + * Deletes a WCF relay authorization rule. * * @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. + * @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 {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String namespaceName, String relayName, Context context); + void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); /** - * Returns the description for the specified WCF relay. + * Get authorizationRule for a WCF relay by name. * * @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 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. + * @return authorizationRule for a WCF relay by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - WcfRelayInner get(String resourceGroupName, String namespaceName, String relayName); + Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + Context context); /** - * Returns the description for the specified WCF relay. + * Get authorizationRule for a WCF relay by name. * * @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. + * @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 along with {@link Response}. + * @return authorizationRule for a WCF relay by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String namespaceName, String relayName, Context context); + AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); /** - * Authorization rules 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 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 from the list namespace operation as paginated response with {@link PagedIterable}. + * @return namespace/Relay Connection String along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String relayName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + Context context); /** - * Authorization rules 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 namespaceName The namespace name. * @param relayName The relay 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 com.azure.core.management.exception.ManagementException thrown 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 namespace/Relay Connection String. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String relayName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); /** - * 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 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. + * @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 namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner createOrUpdateAuthorizationRule( + Response regenerateKeysWithResponse( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters); + RegenerateAccessKeyParameters parameters, + Context context); /** - * 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 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. + * @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 description of a namespace authorization rule along with {@link Response}. + * @return namespace/Relay Connection String. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAuthorizationRuleWithResponse( + AccessKeysInner regenerateKeys( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters, - Context context); + RegenerateAccessKeyParameters parameters); /** - * Deletes a WCF relay authorization rule. + * Lists the WCF relays within the namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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.SINGLE) - void deleteAuthorizationRule( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName); /** - * Deletes a WCF relay authorization rule. + * Lists the WCF relays within the namespace. * * @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 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 the list WCF relay operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context 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 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 authorizationRule for a WCF relay by name. + * @return description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); + Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String relayName, WcfRelayInner parameters, Context 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 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 com.azure.core.management.exception.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) - Response getAuthorizationRuleWithResponse( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - Context context); + WcfRelayInner createOrUpdate( + String resourceGroupName, String namespaceName, String relayName, WcfRelayInner parameters); /** - * 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 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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner listKeys( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); + 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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - Context context); + void delete(String resourceGroupName, String namespaceName, String relayName); /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * 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 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 description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccessKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters); + Response getWithResponse( + String resourceGroupName, String namespaceName, String relayName, Context context); /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * 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 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 description of the WCF relay resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context); + WcfRelayInner get(String resourceGroupName, String namespaceName, String relayName); } 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 354546e2c6897..83a8a804a8c4c 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 @@ -23,15 +23,13 @@ public final class AccessKeysInner { private String secondaryConnectionString; /* - * A base64-encoded 256-bit primary key for signing and validating the SAS - * token. + * A base64-encoded 256-bit primary key for signing and validating the SAS token. */ @JsonProperty(value = "primaryKey") private String primaryKey; /* - * A base64-encoded 256-bit secondary key for signing and validating the - * SAS token. + * A base64-encoded 256-bit secondary key for signing and validating the SAS token. */ @JsonProperty(value = "secondaryKey") private String secondaryKey; @@ -42,6 +40,10 @@ public final class AccessKeysInner { @JsonProperty(value = "keyName") private String keyName; + /** Creates an instance of AccessKeysInner class. */ + public AccessKeysInner() { + } + /** * Get the primaryConnectionString property: Primary connection string of the created namespace authorization rule. * 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 efdf3c39ac052..9afdd3b872461 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 @@ -6,22 +6,38 @@ 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.resourcemanager.relay.models.AccessRights; import com.fasterxml.jackson.annotation.JsonProperty; 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 */ - @JsonProperty(value = "properties", required = true) - private AuthorizationRuleProperties innerProperties = new AuthorizationRuleProperties(); + @JsonProperty(value = "properties") + private AuthorizationRuleProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** Creates an instance of AuthorizationRuleInner class. */ + public AuthorizationRuleInner() { + } /** - * Get the innerProperties property: Authorization rule properties. + * Get the innerProperties property: Properties supplied to create or update AuthorizationRule. * * @return the innerProperties value. */ @@ -29,6 +45,24 @@ private AuthorizationRuleProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + /** * Get the rights property: The rights associated with the rule. * @@ -58,15 +92,8 @@ public AuthorizationRuleInner withRights(List rights) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model AuthorizationRuleInner")); - } else { + if (innerProperties() != null) { innerProperties().validate(); } } - - private static final ClientLogger LOGGER = new ClientLogger(AuthorizationRuleInner.class); } 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 5c412461d85cb..48b47df1d5534 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 @@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Authorization rule properties. */ +/** Properties supplied to create or update AuthorizationRule. */ @Fluent public final class AuthorizationRuleProperties { /* @@ -19,6 +19,10 @@ public final class AuthorizationRuleProperties { @JsonProperty(value = "rights", required = true) private List rights; + /** Creates an instance of AuthorizationRuleProperties class. */ + public AuthorizationRuleProperties() { + } + /** * Get the rights property: The rights associated with the rule. * 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 312d10400b3d1..5e5df7e811ede 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 @@ -18,8 +18,7 @@ public final class CheckNameAvailabilityResultInner { private String message; /* - * Value indicating namespace is available. Returns true if the namespace - * is available; otherwise, false. + * Value indicating namespace is available. Returns true if the namespace is available; otherwise, false. */ @JsonProperty(value = "nameAvailable") private Boolean nameAvailable; @@ -30,6 +29,10 @@ public final class CheckNameAvailabilityResultInner { @JsonProperty(value = "reason") private UnavailableReason reason; + /** Creates an instance of CheckNameAvailabilityResultInner class. */ + public CheckNameAvailabilityResultInner() { + } + /** * Get the message property: The detailed info regarding the reason associated with the namespace. * 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 5040b3c9fa062..5eb37b978d39e 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -18,6 +19,22 @@ public final class HybridConnectionInner extends ProxyResource { @JsonProperty(value = "properties") private HybridConnectionProperties innerProperties; + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** Creates an instance of HybridConnectionInner class. */ + public HybridConnectionInner() { + } + /** * Get the innerProperties property: Properties of the HybridConnection. * @@ -27,6 +44,24 @@ private HybridConnectionProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + /** * Get the createdAt property: The time the hybrid connection was created. * 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 cb5361f3763b4..f65e9607b9a7a 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 @@ -24,28 +24,29 @@ public final class HybridConnectionProperties { private OffsetDateTime updatedAt; /* - * The number of listeners for this hybrid connection. Note that min : 1 - * and max:25 are supported. + * The number of listeners for this hybrid connection. Note that min : 1 and max:25 are supported. */ @JsonProperty(value = "listenerCount", access = JsonProperty.Access.WRITE_ONLY) private Integer listenerCount; /* - * Returns true if client authorization is needed for this hybrid - * connection; otherwise, false. + * Returns true if client authorization is needed for this hybrid connection; otherwise, false. */ @JsonProperty(value = "requiresClientAuthorization") private Boolean requiresClientAuthorization; /* - * The usermetadata is a placeholder to store user-defined string data for - * the hybrid connection endpoint. For example, it can be used to store - * descriptive data, such as a list of teams and their contact information. - * Also, user-defined configuration settings can be stored. + * The usermetadata is a placeholder to store user-defined string data for the hybrid connection endpoint. For + * example, it can be used to store descriptive data, such as a list of teams and their contact information. Also, + * user-defined configuration settings can be stored. */ @JsonProperty(value = "userMetadata") private String userMetadata; + /** Creates an instance of HybridConnectionProperties class. */ + public HybridConnectionProperties() { + } + /** * Get the createdAt property: The time the hybrid connection was created. * 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 0000000000000..d5a2eb7b2c032 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetInner.java @@ -0,0 +1,134 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Description of topic resource. */ +@Fluent +public final class NetworkRuleSetInner extends ProxyResource { + /* + * NetworkRuleSet properties + */ + @JsonProperty(value = "properties") + private NetworkRuleSetProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** 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: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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 0000000000000..a3b1889447c46 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/NetworkRuleSetProperties.java @@ -0,0 +1,111 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.relay.models.DefaultAction; +import com.azure.resourcemanager.relay.models.NWRuleSetIpRules; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NetworkRuleSet properties. */ +@Fluent +public final class NetworkRuleSetProperties { + /* + * Default Action for Network Rule Set + */ + @JsonProperty(value = "defaultAction") + private DefaultAction defaultAction; + + /* + * This determines if traffic is allowed over public network. By default it is enabled + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * List of IpRules + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** Creates an instance of NetworkRuleSetProperties class. */ + public NetworkRuleSetProperties() { + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + } +} 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 500eef1a0f43b..87f6119ad7e30 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 @@ -18,11 +18,33 @@ public final class OperationInner { private String name; /* - * The object that represents the operation. + * Indicates whether the operation is a data action */ - @JsonProperty(value = "display") + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Display of the operation + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) private OperationDisplay display; + /* + * Origin of the operation + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * Properties of the operation + */ + @JsonProperty(value = "properties") + private Object properties; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: Operation name: {provider}/{resource}/{operation}. * @@ -33,7 +55,16 @@ public String name() { } /** - * Get the display property: The object that represents the operation. + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Display of the operation. * * @return the display value. */ @@ -42,13 +73,31 @@ public OperationDisplay display() { } /** - * Set the display property: The object that represents the operation. + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the properties property: Properties of the operation. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operation. * - * @param display the display value to set. + * @param properties the properties value to set. * @return the OperationInner object itself. */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; + public OperationInner withProperties(Object properties) { + this.properties = properties; return this; } 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 0000000000000..07af7db880d8c --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,147 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnection. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Properties of the PrivateEndpointConnection. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** 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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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 0000000000000..32ff0a73b30df --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,112 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.relay.models.ConnectionState; +import com.azure.resourcemanager.relay.models.EndPointProvisioningState; +import com.azure.resourcemanager.relay.models.PrivateEndpoint; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The Private Endpoint resource for this Connection. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * Details about the state of the connection. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private ConnectionState privateLinkServiceConnectionState; + + /* + * Provisioning state of the Private Endpoint Connection. + */ + @JsonProperty(value = "provisioningState") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} 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 0000000000000..8f4705cb36750 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,190 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information of the private link resource. */ +@Fluent +public final class PrivateLinkResourceInner { + /* + * Properties of the private link resource. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /* + * Fully qualified identifier of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of the resource + */ + @JsonProperty(value = "name") + private String name; + + /* + * Type of the resource + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of PrivateLinkResourceInner class. */ + public PrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: Properties of the private link resource. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the id property: Fully qualified identifier of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified identifier of the resource. + * + * @param id the id value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource. + * + * @param name the name value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the resource. + * + * @param type the type value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * 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(); + } + + /** + * Set the groupId property: The private link resource group id. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withGroupId(groupId); + return this; + } + + /** + * 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(); + } + + /** + * Set the requiredMembers property: The private link resource required member names. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredMembers(requiredMembers); + return this; + } + + /** + * 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(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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 0000000000000..f3c7749c05f25 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,103 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of PrivateLinkResource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers") + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The private link resource group id. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: The private link resource required member names. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 0000000000000..066e56bb6f69d --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/PrivateLinkResourcesListResultInner.java @@ -0,0 +1,80 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the List private link resources operation. */ +@Fluent +public final class PrivateLinkResourcesListResultInner { + /* + * A collection of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link for the next page of private link resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of PrivateLinkResourcesListResultInner class. */ + public PrivateLinkResourcesListResultInner() { + } + + /** + * Get the value property: A collection of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourcesListResultInner object itself. + */ + public PrivateLinkResourcesListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of private link resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of private link resources. + * + * @param nextLink the nextLink value to set. + * @return the PrivateLinkResourcesListResultInner object itself. + */ + public PrivateLinkResourcesListResultInner 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()); + } + } +} 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 b8994d70ec69e..6e2e138b01517 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 @@ -6,10 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.resourcemanager.relay.models.ProvisioningStateEnum; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.azure.resourcemanager.relay.models.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Description of a namespace resource. */ @@ -21,12 +23,22 @@ public final class RelayNamespaceInner extends Resource { @JsonProperty(value = "sku") private Sku sku; + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /* * Description of Relay namespace */ @JsonProperty(value = "properties") private RelayNamespaceProperties innerProperties; + /** Creates an instance of RelayNamespaceInner class. */ + public RelayNamespaceInner() { + } + /** * Get the sku property: SKU of the namespace. * @@ -47,6 +59,15 @@ public RelayNamespaceInner withSku(Sku sku) { return this; } + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the innerProperties property: Description of Relay namespace. * @@ -71,14 +92,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. * @@ -115,6 +145,55 @@ public String metricId() { return this.innerProperties() == null ? null : this.innerProperties().metricId(); } + /** + * 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. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the RelayNamespaceInner object itself. + */ + public RelayNamespaceInner withPrivateEndpointConnections( + List privateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new RelayNamespaceProperties(); + } + 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; + } + /** * Validates the instance. * 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 fe0d6148361dd..7eaf1b155cf87 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 @@ -4,19 +4,26 @@ package com.azure.resourcemanager.relay.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.relay.models.ProvisioningStateEnum; +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.relay.models.PublicNetworkAccess; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.List; /** Properties of the namespace. */ -@Immutable +@Fluent public final class RelayNamespaceProperties { /* - * The provisioningState property. + * Provisioning state of the Namespace. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningStateEnum provisioningState; + private String provisioningState; + + /* + * Status of the Namespace. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; /* * The time the namespace was created. @@ -42,15 +49,40 @@ public final class RelayNamespaceProperties { @JsonProperty(value = "metricId", access = JsonProperty.Access.WRITE_ONLY) private String metricId; + /* + * List of private endpoint connections. + */ + @JsonProperty(value = "privateEndpointConnections") + private List privateEndpointConnections; + + /* + * This determines if traffic is allowed over public network. By default it is enabled. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** Creates an instance of RelayNamespaceProperties class. */ + 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. * @@ -87,11 +119,57 @@ public String metricId() { return this.metricId; } + /** + * 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; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } } } 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 5d528a9786d53..a8ada752422bb 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.relay.models.Relaytype; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -19,6 +20,22 @@ public final class WcfRelayInner extends ProxyResource { @JsonProperty(value = "properties") private WcfRelayProperties innerProperties; + /* + * The system meta data relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** Creates an instance of WcfRelayInner class. */ + public WcfRelayInner() { + } + /** * Get the innerProperties property: Properties of the WCF relay. * @@ -28,6 +45,24 @@ private WcfRelayProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + /** * Get the isDynamic property: Returns true if the relay is dynamic; otherwise, false. * 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 6d130c8a0dc04..f03a9d0c68ecc 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 @@ -31,8 +31,7 @@ public final class WcfRelayProperties { private OffsetDateTime updatedAt; /* - * The number of listeners for this relay. Note that min :1 and max:25 are - * supported. + * The number of listeners for this relay. Note that min :1 and max:25 are supported. */ @JsonProperty(value = "listenerCount", access = JsonProperty.Access.WRITE_ONLY) private Integer listenerCount; @@ -44,28 +43,29 @@ public final class WcfRelayProperties { private Relaytype relayType; /* - * Returns true if client authorization is needed for this relay; - * otherwise, false. + * Returns true if client authorization is needed for this relay; otherwise, false. */ @JsonProperty(value = "requiresClientAuthorization") private Boolean requiresClientAuthorization; /* - * Returns true if transport security is needed for this relay; otherwise, - * false. + * Returns true if transport security is needed for this relay; otherwise, false. */ @JsonProperty(value = "requiresTransportSecurity") private Boolean requiresTransportSecurity; /* - * The usermetadata is a placeholder to store user-defined string data for - * the WCF Relay endpoint. For example, it can be used to store descriptive - * data, such as list of teams and their contact information. Also, - * user-defined configuration settings can be stored. + * The usermetadata is a placeholder to store user-defined string data for the WCF Relay endpoint. For example, it + * can be used to store descriptive data, such as list of teams and their contact information. Also, user-defined + * configuration settings can be stored. */ @JsonProperty(value = "userMetadata") private String userMetadata; + /** Creates an instance of WcfRelayProperties class. */ + public WcfRelayProperties() { + } + /** * Get the isDynamic property: Returns true if the relay is dynamic; otherwise, false. * 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 fdf4f2d2d6dbe..d1993d06e17da 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 @@ -5,6 +5,8 @@ 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + 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; } @@ -148,20 +166,14 @@ public AuthorizationRule refresh(Context context) { return this; } - public AccessKeys listKeys() { - return serviceManager.namespaces().listKeys(resourceGroupName, namespaceName, authorizationRuleName); - } - public Response listKeysWithResponse(Context context) { return serviceManager .namespaces() .listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); } - public AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters) { - return serviceManager - .namespaces() - .regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); + public AccessKeys listKeys() { + return serviceManager.namespaces().listKeys(resourceGroupName, namespaceName, authorizationRuleName); } public Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context) { @@ -170,6 +182,12 @@ public Response regenerateKeysWithResponse(RegenerateAccessKeyParame .regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, context); } + public AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters) { + return serviceManager + .namespaces() + .regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); + } + public AuthorizationRuleImpl withRights(List rights) { this.innerModel().withRights(rights); return this; 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 5767f7ba5464b..ac1c772353efd 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 @@ -4,6 +4,8 @@ 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + 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 859fd81df6bde..c727e77dbc110 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 @@ -67,13 +67,14 @@ private interface HybridConnectionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections") + + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespace( + Mono> listAuthorizationRules( @HostParam("$host") String endpoint, @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, @@ -82,31 +83,35 @@ Mono> listByNamespace( @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections/{hybridConnectionName}") + + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules" + + "/{authorizationRuleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono> createOrUpdateAuthorizationRule( @HostParam("$host") String endpoint, @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") HybridConnectionInner parameters, + @BodyParam("application/json") AuthorizationRuleInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections/{hybridConnectionName}") + + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules" + + "/{authorizationRuleName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono> deleteAuthorizationRule( @HostParam("$host") String endpoint, @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, @@ -115,43 +120,47 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections/{hybridConnectionName}") + + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules" + + "/{authorizationRuleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> getAuthorizationRule( @HostParam("$host") String endpoint, @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); @Headers({"Content-Type: application/json"}) - @Get( + @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules") + + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}" + + "/listKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules( + Mono> listKeys( @HostParam("$host") String endpoint, @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); @Headers({"Content-Type: application/json"}) - @Put( + @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules" - + "/{authorizationRuleName}") + + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}" + + "/regenerateKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule( + Mono> regenerateKeys( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @@ -159,80 +168,71 @@ Mono> createOrUpdateAuthorizationRule( @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AuthorizationRuleInner parameters, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( + @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules" - + "/{authorizationRuleName}") - @ExpectedResponses({200, 204}) + + "/{namespaceName}/hybridConnections") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule( + Mono> listByNamespace( @HostParam("$host") String endpoint, @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); @Headers({"Content-Type: application/json"}) - @Get( + @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules" - + "/{authorizationRuleName}") + + "/{namespaceName}/hybridConnections/{hybridConnectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule( + Mono> createOrUpdate( @HostParam("$host") String endpoint, @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") HybridConnectionInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Post( + @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}" - + "/listKeys") - @ExpectedResponses({200}) + + "/{namespaceName}/hybridConnections/{hybridConnectionName}") + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( + Mono> delete( @HostParam("$host") String endpoint, @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); @Headers({"Content-Type: application/json"}) - @Post( + @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/hybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}" - + "/regenerateKeys") + + "/{namespaceName}/hybridConnections/{hybridConnectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys( + Mono> get( @HostParam("$host") String endpoint, @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") RegenerateAccessKeyParameters parameters, @HeaderParam("Accept") String accept, Context context); @@ -240,7 +240,7 @@ Mono> regenerateKeys( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespaceNext( + Mono> listAuthorizationRulesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -250,7 +250,7 @@ Mono> listByNamespaceNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRulesNext( + Mono> listByNamespaceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -258,19 +258,20 @@ Mono> listAuthorizationRulesNext( } /** - * Lists the hybrid connection within the namespace. + * Authorization rules for 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 response of the list hybrid connection operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync( - String resourceGroupName, String namespaceName) { + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -284,6 +285,10 @@ private Mono> listByNamespaceSinglePageAsyn 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( @@ -295,15 +300,16 @@ private Mono> listByNamespaceSinglePageAsyn .withContext( context -> service - .listByNamespace( + .listAuthorizationRules( this.client.getEndpoint(), resourceGroupName, namespaceName, + hybridConnectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -316,20 +322,21 @@ private Mono> listByNamespaceSinglePageAsyn } /** - * Lists the hybrid connection within the namespace. + * Authorization rules for 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. * @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}. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync( - String resourceGroupName, String namespaceName, Context context) { + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -343,6 +350,10 @@ private Mono> listByNamespaceSinglePageAsyn 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( @@ -352,10 +363,11 @@ private Mono> listByNamespaceSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByNamespace( + .listAuthorizationRules( this.client.getEndpoint(), resourceGroupName, namespaceName, + hybridConnectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -372,89 +384,102 @@ private Mono> listByNamespaceSinglePageAsyn } /** - * Lists the hybrid connection within the namespace. + * Authorization rules for 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 response of the list hybrid connection operation as paginated response with {@link PagedFlux}. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName) { return new PagedFlux<>( - () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, hybridConnectionName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); } /** - * Lists the hybrid connection within the namespace. + * Authorization rules for 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. * @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}. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNamespaceAsync( - String resourceGroupName, String namespaceName, Context context) { + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { return new PagedFlux<>( - () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); + () -> + listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, hybridConnectionName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); } /** - * Lists the hybrid connection within the namespace. + * Authorization rules for 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 response of the list hybrid connection operation as paginated response with {@link PagedIterable}. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName)); + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String hybridConnectionName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, hybridConnectionName)); } /** - * Lists the hybrid connection within the namespace. + * Authorization rules for 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. * @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}. + * @return the response from the list namespace 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)); + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { + return new PagedIterable<>( + listAuthorizationRulesAsync(resourceGroupName, namespaceName, hybridConnectionName, context)); } /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Creates or updates an authorization rule for 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. - * @param parameters Parameters supplied to create a hybrid connection. + * @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 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) { + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + String authorizationRuleName, + AuthorizationRuleInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -472,6 +497,10 @@ private Mono> createOrUpdateWithResponseAsync( 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( @@ -488,11 +517,12 @@ private Mono> createOrUpdateWithResponseAsync( .withContext( context -> service - .createOrUpdate( + .createOrUpdateAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, @@ -502,25 +532,27 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Creates or updates an authorization rule for 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. - * @param parameters Parameters supplied to create a hybrid connection. + * @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 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( + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( String resourceGroupName, String namespaceName, String hybridConnectionName, - HybridConnectionInner parameters, + String authorizationRuleName, + AuthorizationRuleInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -539,6 +571,10 @@ private Mono> createOrUpdateWithResponseAsync( 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( @@ -553,11 +589,12 @@ private Mono> createOrUpdateWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( + .createOrUpdateAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, @@ -566,81 +603,97 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Creates or updates an authorization rule for 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. - * @param parameters Parameters supplied to create a hybrid connection. + * @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 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) + 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())); } /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Creates or updates an authorization rule for 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. - * @param parameters Parameters supplied to create a hybrid connection. + * @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 hybrid connection resource. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner createOrUpdate( - String resourceGroupName, String namespaceName, String hybridConnectionName, HybridConnectionInner parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, hybridConnectionName, parameters).block(); + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, context) + .block(); } /** - * Creates or updates a service hybrid connection. This operation is idempotent. + * Creates or updates an authorization rule for 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. - * @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. + * @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}. + * @return single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( + public AuthorizationRuleInner createOrUpdateAuthorizationRule( String resourceGroupName, String namespaceName, String hybridConnectionName, - HybridConnectionInner parameters, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, namespaceName, hybridConnectionName, parameters, context) - .block(); + String authorizationRuleName, + AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, Context.NONE) + .getValue(); } /** - * Deletes a hybrid connection. + * Deletes a hybrid connection authorization rule. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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) { + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -658,6 +711,10 @@ private Mono> deleteWithResponseAsync( 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( @@ -669,11 +726,12 @@ private Mono> deleteWithResponseAsync( .withContext( context -> service - .delete( + .deleteAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -682,11 +740,12 @@ private Mono> deleteWithResponseAsync( } /** - * Deletes a hybrid connection. + * Deletes a hybrid connection authorization rule. * * @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 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. @@ -694,8 +753,12 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + String authorizationRuleName, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -713,6 +776,10 @@ private Mono> deleteWithResponseAsync( 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( @@ -722,11 +789,12 @@ private Mono> deleteWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .deleteAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -734,70 +802,84 @@ private Mono> deleteWithResponseAsync( } /** - * Deletes a hybrid connection. + * Deletes a hybrid connection authorization rule. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 hybridConnectionName) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName) + private Mono deleteAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName) .flatMap(ignored -> Mono.empty()); } /** - * Deletes a hybrid connection. + * Deletes a hybrid connection authorization rule. * * @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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, String hybridConnectionName) { - deleteAsync(resourceGroupName, namespaceName, hybridConnectionName).block(); + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + String authorizationRuleName, + Context context) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, context) + .block(); } /** - * Deletes a hybrid connection. + * Deletes a hybrid connection authorization rule. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, context).block(); + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { + deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, Context.NONE); } /** - * Returns the description for the specified hybrid connection. + * Hybrid connection authorization rule for a hybrid connection by name. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> getWithResponseAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName) { + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -815,6 +897,10 @@ private Mono> getWithResponseAsync( 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( @@ -826,11 +912,12 @@ private Mono> getWithResponseAsync( .withContext( context -> service - .get( + .getAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -839,21 +926,26 @@ private Mono> getWithResponseAsync( } /** - * Returns the description for the specified hybrid connection. + * Hybrid connection authorization rule for a hybrid connection by name. * * @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 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}. + * @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> getWithResponseAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + String authorizationRuleName, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -871,6 +963,10 @@ private Mono> getWithResponseAsync( 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( @@ -880,11 +976,12 @@ private Mono> getWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get( + .getAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -892,72 +989,85 @@ private Mono> getWithResponseAsync( } /** - * Returns the description for the specified hybrid connection. + * Hybrid connection authorization rule for a hybrid connection by name. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 getAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName) { - return getWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName) + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Returns the description for the specified hybrid connection. + * Hybrid connection authorization rule for a hybrid connection by name. * * @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 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. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public HybridConnectionInner get(String resourceGroupName, String namespaceName, String hybridConnectionName) { - return getAsync(resourceGroupName, namespaceName, hybridConnectionName).block(); + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + String authorizationRuleName, + Context context) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, context) + .block(); } /** - * Returns the description for the specified hybrid connection. + * Hybrid connection authorization rule for a hybrid connection by name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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}. + * @return single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, context).block(); + public AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, Context.NONE) + .getValue(); } /** - * Authorization rules 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 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 the response from the list namespace operation along with {@link PagedResponse} 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> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName) { + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -975,6 +1085,10 @@ private Mono> listAuthorizationRulesSingle 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( @@ -986,43 +1100,39 @@ private Mono> listAuthorizationRulesSingle .withContext( context -> service - .listAuthorizationRules( + .listKeys( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, 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())); } /** - * Authorization rules 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 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 response from the list namespace operation along with {@link PagedResponse} 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> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { + private Mono> listKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + String authorizationRuleName, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1040,6 +1150,10 @@ private Mono> listAuthorizationRulesSingle 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( @@ -1049,123 +1163,102 @@ private Mono> listAuthorizationRulesSingle final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAuthorizationRules( + .listKeys( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, + authorizationRuleName, 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)); + context); } /** - * Authorization rules 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 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 the response from the list namespace operation as paginated response with {@link PagedFlux}. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, hybridConnectionName), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + @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())); } /** - * Authorization rules 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 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 response from the list namespace operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { - return new PagedFlux<>( - () -> - listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, hybridConnectionName, context), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); - } - - /** - * Authorization rules for 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 response from the list namespace operation as paginated response with {@link PagedIterable}. + * @return namespace/Relay Connection String along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String hybridConnectionName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, hybridConnectionName)); + @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(); } /** - * Authorization rules 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 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 response from the list namespace operation as paginated response with {@link PagedIterable}. + * @return namespace/Relay Connection String. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { - return new PagedIterable<>( - listAuthorizationRulesAsync(resourceGroupName, namespaceName, hybridConnectionName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 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( + private Mono> regenerateKeysWithResponseAsync( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters) { + RegenerateAccessKeyParameters parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1203,7 +1296,7 @@ private Mono> createOrUpdateAuthorizationRuleWi .withContext( context -> service - .createOrUpdateAuthorizationRule( + .regenerateKeys( this.client.getEndpoint(), resourceGroupName, namespaceName, @@ -1218,27 +1311,26 @@ private Mono> createOrUpdateAuthorizationRuleWi } /** - * 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 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. * @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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + private Mono> regenerateKeysWithResponseAsync( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters, + RegenerateAccessKeyParameters parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1275,7 +1367,7 @@ private Mono> createOrUpdateAuthorizationRuleWi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdateAuthorizationRule( + .regenerateKeys( this.client.getEndpoint(), resourceGroupName, namespaceName, @@ -1289,97 +1381,96 @@ private Mono> createOrUpdateAuthorizationRuleWi } /** - * 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 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 on successful completion of {@link Mono}. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAuthorizationRuleAsync( + private Mono regenerateKeysAsync( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync( + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync( resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters) .flatMap(res -> Mono.justOrEmpty(res.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 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. + * @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. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner createOrUpdateAuthorizationRule( + public Response regenerateKeysWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleAsync( - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters) + RegenerateAccessKeyParameters parameters, + Context context) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, context) .block(); } /** - * 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 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAuthorizationRuleWithResponse( + public AccessKeysInner regenerateKeys( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters, - Context context) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, context) - .block(); + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponse( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, Context.NONE) + .getValue(); } /** - * Deletes a hybrid connection authorization rule. + * Lists the hybrid connection within the namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 the list hybrid connection operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { + private Mono> listByNamespaceSinglePageAsync( + String resourceGroupName, String namespaceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1393,14 +1484,6 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( 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( @@ -1412,39 +1495,41 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( .withContext( context -> service - .deleteAuthorizationRule( + .listByNamespace( this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, - authorizationRuleName, 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 hybrid connection authorization rule. + * Lists the hybrid connection within the namespace. * * @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 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 the list hybrid connection operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - Context context) { + private Mono> listByNamespaceSinglePageAsync( + String resourceGroupName, String namespaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1458,14 +1543,6 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( 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( @@ -1475,97 +1552,109 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .deleteAuthorizationRule( + .listByNamespace( this.client.getEndpoint(), resourceGroupName, namespaceName, - hybridConnectionName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Deletes a hybrid connection authorization rule. + * Lists the hybrid connection within the namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the list hybrid connection operation as paginated response with {@link PagedFlux}. */ - @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()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); } /** - * Deletes a hybrid connection authorization rule. + * Lists the hybrid connection within the namespace. * * @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 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.SINGLE) - public void deleteAuthorizationRule( - String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { - deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); } /** - * Deletes a hybrid connection authorization rule. + * 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)); + } + + /** + * Lists the hybrid connection within the namespace. * * @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 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 the list hybrid connection operation as paginated response with {@link PagedIterable}. */ - @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(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, 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 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 - * {@link Mono}. + * @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) { + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, HybridConnectionInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1583,54 +1672,55 @@ private Mono> getAuthorizationRuleWithResponseA 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(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .getAuthorizationRule( + .createOrUpdate( 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())); } /** - * 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 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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return description of hybrid connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( + private Mono> createOrUpdateWithResponseAsync( String resourceGroupName, String namespaceName, String hybridConnectionName, - String authorizationRuleName, + HybridConnectionInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1649,110 +1739,110 @@ private Mono> getAuthorizationRuleWithResponseA 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(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getAuthorizationRule( + .createOrUpdate( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), + parameters, accept, 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 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 on successful completion of {@link Mono}. + * @return description of hybrid connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName) + 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 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. + * @return description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { - return getAuthorizationRuleAsync(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + HybridConnectionInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, hybridConnectionName, parameters, context) .block(); } /** - * 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 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(); } /** - * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1770,10 +1860,6 @@ private Mono> listKeysWithResponseAsync( 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( @@ -1785,12 +1871,11 @@ private Mono> listKeysWithResponseAsync( .withContext( context -> service - .listKeys( + .delete( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -1799,25 +1884,20 @@ private Mono> listKeysWithResponseAsync( } /** - * 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 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - Context context) { + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1835,10 +1915,6 @@ private Mono> listKeysWithResponseAsync( 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( @@ -1848,12 +1924,11 @@ private Mono> listKeysWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listKeys( + .delete( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -1861,87 +1936,70 @@ private Mono> listKeysWithResponseAsync( } /** - * 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 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}. + * @return A {@link Mono} that completes when a successful response is received. */ @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())); + 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 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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys( - String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName) { - return listKeysAsync(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName).block(); + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, context).block(); } /** - * 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 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}. */ @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(); + public void delete(String resourceGroupName, String namespaceName, String hybridConnectionName) { + deleteWithResponse(resourceGroupName, namespaceName, hybridConnectionName, Context.NONE); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Returns the description for the specified hybrid connection. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 hybrid connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1959,62 +2017,45 @@ private Mono> regenerateKeysWithResponseAsync( 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(); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .regenerateKeys( + .get( 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())); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Returns the description for the specified hybrid connection. * * @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 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 description of hybrid connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context) { + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2032,126 +2073,91 @@ private Mono> regenerateKeysWithResponseAsync( 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(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .regenerateKeys( + .get( this.client.getEndpoint(), resourceGroupName, namespaceName, hybridConnectionName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, accept, context); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Returns the description for the specified hybrid connection. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 hybrid connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponseAsync( - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters) + private Mono getAsync( + String resourceGroupName, String namespaceName, String hybridConnectionName) { + return getWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Returns the description for the specified hybrid connection. * * @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 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. + * @return description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysAsync( - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters) - .block(); + public Response getWithResponse( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, hybridConnectionName, context).block(); } /** - * Regenerates the primary or secondary connection strings to the hybrid connection. + * Returns the description for the specified hybrid connection. * * @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 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 hybrid connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context) { - return regenerateKeysWithResponseAsync( - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, context) - .block(); + public HybridConnectionInner get(String resourceGroupName, String namespaceName, String hybridConnectionName) { + return getWithResponse(resourceGroupName, namespaceName, hybridConnectionName, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2163,8 +2169,9 @@ private Mono> listByNamespaceNextSinglePage } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext( + context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -2179,16 +2186,17 @@ private Mono> listByNamespaceNextSinglePage /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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}. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync( + private Mono> listAuthorizationRulesNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -2202,7 +2210,7 @@ private Mono> listByNamespaceNextSinglePage final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) + .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -2217,15 +2225,16 @@ private Mono> listByNamespaceNextSinglePage /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 hybrid connection operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { + private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2237,9 +2246,8 @@ private Mono> listAuthorizationRulesNextSi } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext(context -> service.listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -2254,16 +2262,17 @@ private Mono> listAuthorizationRulesNextSi /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 the list hybrid connection operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync( + private Mono> listByNamespaceNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -2277,7 +2286,7 @@ private Mono> listAuthorizationRulesNextSi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) + .listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( 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 3529d1e17ef22..917dd3e09d393 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 @@ -32,52 +32,6 @@ public HybridConnectionsImpl( this.serviceManager = serviceManager; } - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { - PagedIterable inner = - this.serviceClient().listByNamespace(resourceGroupName, namespaceName); - return Utils.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 Utils.mapPage(inner, inner1 -> new HybridConnectionImpl(inner1, this.manager())); - } - - public void delete(String resourceGroupName, String namespaceName, String hybridConnectionName) { - this.serviceClient().delete(resourceGroupName, namespaceName, hybridConnectionName); - } - - public Response deleteWithResponse( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, hybridConnectionName, context); - } - - 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 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 PagedIterable listAuthorizationRules( String resourceGroupName, String namespaceName, String hybridConnectionName) { PagedIterable inner = @@ -94,6 +48,29 @@ public PagedIterable listAuthorizationRules( return Utils.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; + } + } + public AuthorizationRule createOrUpdateAuthorizationRule( String resourceGroupName, String namespaceName, @@ -112,27 +89,16 @@ public AuthorizationRule createOrUpdateAuthorizationRule( } } - public Response createOrUpdateAuthorizationRuleWithResponse( + public Response deleteAuthorizationRuleWithResponse( 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 this + .serviceClient() + .deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, context); } public void deleteAuthorizationRule( @@ -142,16 +108,26 @@ public void deleteAuthorizationRule( .deleteAuthorizationRule(resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName); } - public Response deleteAuthorizationRuleWithResponse( + public Response getAuthorizationRuleWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, Context context) { - return this - .serviceClient() - .deleteAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, 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 AuthorizationRule getAuthorizationRule( @@ -167,23 +143,23 @@ public AuthorizationRule getAuthorizationRule( } } - public Response getAuthorizationRuleWithResponse( + public Response listKeysWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, Context context) { - Response inner = + Response inner = this .serviceClient() - .getAuthorizationRuleWithResponse( + .listKeysWithResponse( resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AuthorizationRuleImpl(inner.getValue(), this.manager())); + new AccessKeysImpl(inner.getValue(), this.manager())); } else { return null; } @@ -202,17 +178,18 @@ public AccessKeys listKeys( } } - public Response listKeysWithResponse( + public Response regenerateKeysWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, + RegenerateAccessKeyParameters parameters, Context context) { Response inner = this .serviceClient() - .listKeysWithResponse( - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, context); + .regenerateKeysWithResponse( + resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -242,24 +219,47 @@ public AccessKeys regenerateKeys( } } - public Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context) { - Response inner = - this - .serviceClient() - .regenerateKeysWithResponse( - resourceGroupName, namespaceName, hybridConnectionName, authorizationRuleName, parameters, context); + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().listByNamespace(resourceGroupName, namespaceName); + return Utils.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 Utils.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 AccessKeysImpl(inner.getValue(), this.manager())); + new HybridConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; } 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 e0e7a373dc2f1..367a169161b9f 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 @@ -37,6 +37,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.AuthorizationRuleListResult; import com.azure.resourcemanager.relay.models.CheckNameAvailability; @@ -74,112 +75,132 @@ public final class NamespacesClientImpl implements NamespacesClient { @ServiceInterface(name = "RelayApiNamespaces") private 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") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( + Mono> listAuthorizationRules( @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CheckNameAvailability parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces") + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" + + "/{namespaceName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> createOrUpdateAuthorizationRule( @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AuthorizationRuleInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces") - @ExpectedResponses({200}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" + + "/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( + Mono> deleteAuthorizationRule( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Put( + @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}") - @ExpectedResponses({200, 201}) + + "/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( + Mono> getAuthorizationRule( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RelayNamespaceInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( + @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}") - @ExpectedResponses({200, 202, 204}) + + "/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( + Mono> listKeys( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @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( + @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}") + + "/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( + Mono> regenerateKeys( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}") - @ExpectedResponses({200, 201}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Relay/checkNameAvailability") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono> checkNameAvailability( @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RelayUpdateParameters parameters, + @BodyParam("application/json") CheckNameAvailability parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/authorizationRules") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Relay/namespaces") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules( + Mono> list( + @HostParam("$host") 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") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, @@ -188,31 +209,29 @@ Mono> listAuthorizationRules( @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({200}) + + "/{namespaceName}") + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule( + Mono>> createOrUpdate( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AuthorizationRuleInner parameters, + @BodyParam("application/json") RelayNamespaceInner parameters, @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}) + + "/{namespaceName}") + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule( + Mono>> delete( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, @@ -221,49 +240,62 @@ Mono> deleteAuthorizationRule( @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/authorizationRules/{authorizationRuleName}") + + "/{namespaceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule( + Mono> getByResourceGroup( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @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( + @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") + + "/{namespaceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RelayUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" + + "/{namespaceName}/networkRuleSets/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( + Mono> createOrUpdateNetworkRuleSet( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkRuleSetInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Post( + @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + + "/{namespaceName}/networkRuleSets/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys( + Mono> getNetworkRuleSet( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateAccessKeyParameters parameters, @HeaderParam("Accept") String accept, Context context); @@ -271,7 +303,7 @@ Mono> regenerateKeys( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listAuthorizationRulesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -281,7 +313,7 @@ Mono> listNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -291,7 +323,7 @@ Mono> listByResourceGroupNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRulesNext( + Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -299,291 +331,403 @@ Mono> listAuthorizationRulesNext( } /** - * Check the specified namespace name availability. + * Authorization rules for a namespace. * - * @param parameters Parameters to check availability of the specified namespace name. + * @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 description of the check name availability request properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailability parameters) { + 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.")); } - 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 - .checkNameAvailability( + .listAuthorizationRules( this.client.getEndpoint(), + resourceGroupName, + namespaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, 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())); } /** - * Check the specified namespace name availability. + * Authorization rules for a namespace. * - * @param parameters Parameters to check availability of the specified namespace name. + * @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 description of the check name availability request properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailability parameters, Context context) { + 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.")); } - 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( + .listAuthorizationRules( this.client.getEndpoint(), + resourceGroupName, + namespaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Check the specified namespace name availability. + * Authorization rules for a namespace. * - * @param parameters Parameters to check availability of the specified namespace name. + * @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 description of the check name availability request properties on successful completion of {@link Mono}. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync(CheckNameAvailability parameters) { - return checkNameAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); } /** - * Check the specified namespace name availability. + * Authorization rules for a namespace. * - * @param parameters Parameters to check availability of the specified namespace name. + * @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 description of the check name availability request properties. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters) { - return checkNameAvailabilityAsync(parameters).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); } /** - * Check the specified namespace name availability. + * Authorization rules for a namespace. * - * @param parameters Parameters to check availability of the specified namespace name. - * @param context The context to associate with this operation. + * @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 description of the check name availability request properties along with {@link Response}. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - CheckNameAvailability parameters, Context context) { - return checkNameAvailabilityWithResponseAsync(parameters, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName)); } /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Authorization rules for a 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 from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, context)); + } + + /** + * Creates or updates an authorization rule for a namespace. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + 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 - .list( + .createOrUpdateAuthorizationRule( this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), + parameters, 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 all the available namespaces within the subscription regardless of the resourceGroups. + * Creates or updates an authorization rule for a namespace. * + * @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 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 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(Context context) { + 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(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( + .createOrUpdateAuthorizationRule( this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), + parameters, accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + context); } /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Creates or updates an authorization rule for a namespace. * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @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())); } /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Creates or updates an authorization rule for a namespace. * + * @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 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 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}. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ - @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) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, authorizationRuleName, parameters, context) + .block(); } /** - * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 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) { + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -594,6 +738,13 @@ private Mono> listByResourceGroupSinglePageAs 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( @@ -605,39 +756,33 @@ private Mono> listByResourceGroupSinglePageAs .withContext( context -> service - .listByResourceGroup( + .deleteAuthorizationRule( this.client.getEndpoint(), resourceGroupName, + namespaceName, + authorizationRuleName, 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 all the available namespaces within the ResourceGroup. + * Deletes a namespace authorization rule. * * @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 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, Context context) { + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -648,6 +793,13 @@ private Mono> listByResourceGroupSinglePageAs 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( @@ -657,100 +809,85 @@ private Mono> listByResourceGroupSinglePageAs final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( + .deleteAuthorizationRule( this.client.getEndpoint(), resourceGroupName, + namespaceName, + authorizationRuleName, 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)); + 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 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 PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * 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 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 deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, authorizationRuleName, context) + .block(); } /** - * 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 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 rule for a namespace by name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 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, RelayNamespaceInner parameters) { + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -764,49 +901,49 @@ private Mono>> createOrUpdateWithResponseAsync( 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 - .createOrUpdate( + .getAuthorizationRule( 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())); } /** - * Create Azure Relay namespace. + * Authorization rule for a namespace by name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 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, RelayNamespaceInner parameters, Context context) { + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -820,202 +957,99 @@ private Mono>> createOrUpdateWithResponseAsync( 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 - .createOrUpdate( + .getAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, accept, context); } /** - * Create Azure Relay namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @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. - */ - @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()); - } - - /** - * Create Azure Relay namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @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. - */ - @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); - } - - /** - * Create Azure Relay namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @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. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( - String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).getSyncPoller(); - } - - /** - * Create Azure Relay namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @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. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( - String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).getSyncPoller(); - } - - /** - * Create Azure Relay namespace. + * Authorization rule for a namespace by name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 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, RelayNamespaceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create Azure Relay namespace. + * Authorization rule for a namespace by name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 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); - } - - /** - * Create Azure Relay namespace. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @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. + * @return single item in a List or Get AuthorizationRule operation 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 getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context) + .block(); } /** - * Create Azure Relay namespace. + * Authorization rule for a namespace by name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 single item in a List or Get AuthorizationRule operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelayNamespaceInner createOrUpdate( - String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).block(); + public AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .getValue(); } /** - * 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 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 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) { + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1029,6 +1063,482 @@ private Mono>> deleteWithResponseAsync(String resource 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 + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + authorizationRuleName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + 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. + * + * @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 namespace/Relay Connection String on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE).getValue(); + } + + /** + * Regenerates the primary or 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 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}. + */ + @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(); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerates the primary or 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 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}. + */ + @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); + } + + /** + * Regenerates the primary or 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 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 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 namespace/Relay Connection String along with {@link Response}. + */ + @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(); + } + + /** + * Regenerates the primary or 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponse( + resourceGroupName, namespaceName, authorizationRuleName, parameters, Context.NONE) + .getValue(); + } + + /** + * Check the specified namespace name availability. + * + * @param parameters Parameters to check availability of the specified 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 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) { + 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"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + 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. + * + * @param parameters Parameters to check availability of the specified 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 description of the check name availability request properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync(CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(parameters, context).block(); + } + + /** + * Check the specified namespace name availability. + * + * @param parameters Parameters to check availability of the specified 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 description of the check name availability request properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailability parameters) { + return checkNameAvailabilityWithResponse(parameters, Context.NONE).getValue(); + } + + /** + * 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 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.")); + } if (this.client.getSubscriptionId() == null) { return Mono .error( @@ -1040,44 +1550,42 @@ private Mono>> deleteWithResponseAsync(String resource .withContext( context -> service - .delete( + .list( 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())); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * 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 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 from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, Context context) { + 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 (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( @@ -1087,163 +1595,88 @@ private Mono>> deleteWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .list( this.client.getEndpoint(), - resourceGroupName, - namespaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context); - } - - /** - * 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 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 PollerFlux} for polling of long-running operation. - */ - @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()); - } - - /** - * 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 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. - */ - @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); - } - - /** - * 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 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. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName) { - return beginDeleteAsync(resourceGroupName, namespaceName).getSyncPoller(); - } - - /** - * 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 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. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String namespaceName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, context).getSyncPoller(); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName) { - return beginDeleteAsync(resourceGroupName, namespaceName).last().flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * 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 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 {@link Mono} that completes when a successful response is received. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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.SINGLE) - public void delete(String resourceGroupName, String namespaceName) { - deleteAsync(resourceGroupName, namespaceName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); } /** - * Deletes an existing namespace. This operation also removes all associated resources under the namespace. + * 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 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}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, Context context) { - deleteAsync(resourceGroupName, namespaceName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Returns the description for the specified 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String namespaceName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1254,9 +1687,6 @@ private Mono> getByResourceGroupWithResponseAsync( 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( @@ -1268,31 +1698,39 @@ private Mono> getByResourceGroupWithResponseAsync( .withContext( context -> service - .getByResourceGroup( + .listByResourceGroup( 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())); } /** - * Returns the description for the specified 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 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 from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String namespaceName, Context context) { + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1303,9 +1741,6 @@ private Mono> getByResourceGroupWithResponseAsync( 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( @@ -1315,79 +1750,100 @@ private Mono> getByResourceGroupWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByResourceGroup( + .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - namespaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Returns the description for the specified 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 response from the list namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Returns the description for the specified namespace. + * 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)); + } + + /** + * Lists all the available namespaces within the ResourceGroup. * * @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 description of a namespace resource. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { - return getByResourceGroupAsync(resourceGroupName, namespaceName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Returns the description for the specified 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 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}. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String namespaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * 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 namespaceName The namespace name. - * @param parameters Parameters for updating a namespace resource. + * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String namespaceName, RelayUpdateParameters parameters) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1417,7 +1873,7 @@ private Mono> updateWithResponseAsync( .withContext( context -> service - .update( + .createOrUpdate( this.client.getEndpoint(), resourceGroupName, namespaceName, @@ -1430,12 +1886,11 @@ private Mono> updateWithResponseAsync( } /** - * 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 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. @@ -1443,8 +1898,8 @@ private Mono> updateWithResponseAsync( * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String namespaceName, RelayUpdateParameters parameters, Context context) { + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1472,7 +1927,7 @@ private Mono> updateWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .update( + .createOrUpdate( this.client.getEndpoint(), resourceGroupName, namespaceName, @@ -1484,264 +1939,176 @@ private Mono> updateWithResponseAsync( } /** - * 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 namespaceName The namespace name. - * @param parameters Parameters for updating 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String namespaceName, RelayUpdateParameters parameters) { - return updateWithResponseAsync(resourceGroupName, namespaceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 namespaceName The namespace name. - * @param parameters Parameters for updating a namespace resource. + * @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. + * @return the {@link PollerFlux} for polling of description of a namespace resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelayNamespaceInner update( - String resourceGroupName, String namespaceName, RelayUpdateParameters parameters) { - return updateAsync(resourceGroupName, namespaceName, parameters).block(); + @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()); } /** - * 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 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}. + * @return the {@link PollerFlux} for polling of description of a namespace resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String namespaceName, RelayUpdateParameters parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + @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); } /** - * Authorization rules for a namespace. + * Create Azure Relay namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 response from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the {@link SyncPoller} for polling of description of a namespace resource. */ - @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"; - 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).getSyncPoller(); } /** - * Authorization rules for a namespace. + * Create Azure Relay namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 response from the list namespace operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the {@link SyncPoller} for polling of description of a namespace resource. */ - @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)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).getSyncPoller(); } /** - * Authorization rules for a namespace. + * Create Azure Relay namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 response from the list namespace operation as paginated response with {@link PagedFlux}. + * @return description of a namespace resource on successful completion of {@link Mono}. */ - @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 Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Authorization rules for a namespace. + * Create Azure Relay namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 response from the list namespace operation as paginated response with {@link PagedFlux}. + * @return description of a namespace resource on successful completion of {@link Mono}. */ - @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.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Authorization rules for a namespace. + * Create Azure Relay namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 response from the list namespace operation as paginated response with {@link PagedIterable}. + * @return description of a namespace resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public RelayNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { + return createOrUpdateAsync(resourceGroupName, namespaceName, parameters).block(); } /** - * Authorization rules for a namespace. + * Create Azure Relay namespace. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 response from the list namespace operation as paginated response with {@link PagedIterable}. + * @return description of a namespace resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, Context context) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public RelayNamespaceInner createOrUpdate( + String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, namespaceName, parameters, context).block(); } /** - * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String namespaceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1755,60 +2122,42 @@ private Mono> createOrUpdateAuthorizationRuleWi 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( + .delete( 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())); } /** - * 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 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}. + * @return the {@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) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1822,120 +2171,172 @@ private Mono> createOrUpdateAuthorizationRuleWi 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 - .createOrUpdateAuthorizationRule( + .delete( this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, accept, 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 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 PollerFlux} for polling of long-running operation. + */ + @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()); + } + + /** + * 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 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. + */ + @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); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName) { + return beginDeleteAsync(resourceGroupName, namespaceName).getSyncPoller(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String namespaceName, Context context) { + return beginDeleteAsync(resourceGroupName, namespaceName, context).getSyncPoller(); + } + + /** + * 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 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 on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @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 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 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String namespaceName, Context context) { + return beginDeleteAsync(resourceGroupName, namespaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner createOrUpdateAuthorizationRule( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) - .block(); + public void delete(String resourceGroupName, String namespaceName) { + deleteAsync(resourceGroupName, namespaceName).block(); } /** - * 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 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}. */ @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(); + public void delete(String resourceGroupName, String namespaceName, Context context) { + deleteAsync(resourceGroupName, namespaceName, context).block(); } /** - * Deletes a namespace authorization rule. + * Returns the description for the specified namespace. * * @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 description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String namespaceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1949,10 +2350,6 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( 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( @@ -1964,11 +2361,10 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( .withContext( context -> service - .deleteAuthorizationRule( + .getByResourceGroup( this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -1977,20 +2373,19 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( } /** - * Deletes a namespace authorization rule. + * Returns the description for the specified 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 the {@link Response} on successful completion of {@link Mono}. + * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String namespaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2004,10 +2399,6 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( 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( @@ -2017,11 +2408,10 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .deleteAuthorizationRule( + .getByResourceGroup( this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -2029,73 +2419,68 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( } /** - * Deletes a namespace authorization rule. + * Returns the description for the specified namespace. * * @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 description of a namespace resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap(ignored -> Mono.empty()); + private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a namespace authorization rule. + * Returns the description for the specified 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 description of a namespace resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); } /** - * Deletes a namespace authorization rule. + * Returns the description for the specified 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 the {@link Response}. + * @return description of a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return deleteAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, authorizationRuleName, context) - .block(); + public RelayNamespaceInner getByResourceGroup(String resourceGroupName, String namespaceName) { + return getByResourceGroupWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); } /** - * Authorization rule for a namespace by name. + * 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters for updating 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 authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { + private Mono> updateWithResponseAsync( + String resourceGroupName, String namespaceName, RelayUpdateParameters parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2109,49 +2494,50 @@ private Mono> getAuthorizationRuleWithResponseA 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 - .getAuthorizationRule( + .update( 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())); } /** - * Authorization rule for a namespace by name. + * 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule 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. - * @return description of a namespace authorization rule along with {@link Response} on successful completion of - * {@link Mono}. + * @return description of a namespace resource 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) { + private Mono> updateWithResponseAsync( + String resourceGroupName, String namespaceName, RelayUpdateParameters parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2165,98 +2551,101 @@ private Mono> getAuthorizationRuleWithResponseA 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 - .getAuthorizationRule( + .update( this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), + parameters, accept, context); } /** - * Authorization rule for a namespace by name. + * 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. + * @param parameters Parameters for updating 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 authorization rule on successful completion of {@link Mono}. + * @return description of a namespace resource 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 updateAsync( + String resourceGroupName, String namespaceName, RelayUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Authorization rule for a namespace by name. + * 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule 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. - * @return description of a namespace authorization rule. + * @return description of a namespace resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + public Response updateWithResponse( + String resourceGroupName, String namespaceName, RelayUpdateParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); } /** - * Authorization rule for a namespace by name. + * 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @param parameters Parameters for updating 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 authorization rule along with {@link Response}. + * @return description of a namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context) - .block(); + public RelayNamespaceInner update( + String resourceGroupName, String namespaceName, RelayUpdateParameters parameters) { + return updateWithResponse(resourceGroupName, namespaceName, parameters, 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 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) { + private Mono> createOrUpdateNetworkRuleSetWithResponseAsync( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2270,48 +2659,49 @@ private Mono> listKeysWithResponseAsync( 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 - .listKeys( + .createOrUpdateNetworkRuleSet( 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())); } /** - * 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 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} 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, Context context) { + private Mono> createOrUpdateNetworkRuleSetWithResponseAsync( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2325,100 +2715,99 @@ private Mono> listKeysWithResponseAsync( 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 - .listKeys( + .createOrUpdateNetworkRuleSet( this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), + parameters, 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 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 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. + * @return description of topic resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { - return listKeysAsync(resourceGroupName, namespaceName, authorizationRuleName).block(); + public Response createOrUpdateNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context) { + return createOrUpdateNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, parameters, context) + .block(); } /** - * 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @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}. + * @return description of topic resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context).block(); + 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. + * Gets NetworkRuleSet for a Namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 networkRuleSet for a Namespace 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) { + private Mono> getNetworkRuleSetWithResponseAsync( + String resourceGroupName, String namespaceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2432,59 +2821,42 @@ private Mono> regenerateKeysWithResponseAsync( 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 - .regenerateKeys( + .getNetworkRuleSet( 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())); } /** - * Regenerates the primary or secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 networkRuleSet for a Namespace 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, - Context context) { + private Mono> getNetworkRuleSetWithResponseAsync( + String resourceGroupName, String namespaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2498,108 +2870,78 @@ private Mono> regenerateKeysWithResponseAsync( 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( + .getNetworkRuleSet( this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, accept, context); } /** - * Regenerates the primary or secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 networkRuleSet for a Namespace 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) + private Mono getNetworkRuleSetAsync(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Regenerates the primary or secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).block(); + public Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return getNetworkRuleSetWithResponseAsync(resourceGroupName, namespaceName, context).block(); } /** - * Regenerates the primary or secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. */ @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 NetworkRuleSetInner getNetworkRuleSet(String resourceGroupName, String namespaceName) { + return getNetworkRuleSetWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2607,7 +2949,7 @@ public Response regenerateKeysWithResponse( * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2619,8 +2961,9 @@ private Mono> listNextSinglePageAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext( + context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -2635,7 +2978,8 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -2644,7 +2988,8 @@ private Mono> listNextSinglePageAsync(String * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listAuthorizationRulesNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2657,7 +3002,7 @@ private Mono> listNextSinglePageAsync(String final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -2672,7 +3017,8 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2680,7 +3026,7 @@ private Mono> listNextSinglePageAsync(String * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2692,8 +3038,7 @@ private Mono> listByResourceGroupNextSinglePa } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -2709,7 +3054,8 @@ private Mono> listByResourceGroupNextSinglePa /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -2718,8 +3064,7 @@ private Mono> listByResourceGroupNextSinglePa * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2732,7 +3077,7 @@ private Mono> listByResourceGroupNextSinglePa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .listNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -2747,7 +3092,8 @@ private Mono> listByResourceGroupNextSinglePa /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2755,7 +3101,7 @@ private Mono> listByResourceGroupNextSinglePa * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2768,8 +3114,8 @@ private Mono> listAuthorizationRulesNextSi final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -2784,7 +3130,8 @@ private Mono> listAuthorizationRulesNextSi /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. @@ -2793,7 +3140,7 @@ private Mono> listAuthorizationRulesNextSi * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync( + private Mono> listByResourceGroupNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -2807,7 +3154,7 @@ private Mono> listAuthorizationRulesNextSi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( 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 2439ad8600bdb..d60cb66d384b3 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 @@ -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,10 +36,113 @@ public NamespacesImpl(NamespacesClient innerClient, com.azure.resourcemanager.re this.serviceManager = serviceManager; } - public CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters) { - CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(parameters); + public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + } + + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, context); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + } + + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + return this + .serviceClient() + .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + } + + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + } + + 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 CheckNameAvailabilityResultImpl(inner, this.manager()); + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AuthorizationRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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 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 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 AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters) { + AccessKeysInner inner = + this.serviceClient().regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); + if (inner != null) { + return new AccessKeysImpl(inner, this.manager()); } else { return null; } @@ -58,6 +163,15 @@ public Response checkNameAvailabilityWithResponse( } } + public CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); return Utils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); @@ -86,15 +200,6 @@ public void delete(String resourceGroupName, String namespaceName, Context conte this.serviceClient().delete(resourceGroupName, namespaceName, context); } - public RelayNamespace getByResourceGroup(String resourceGroupName, String namespaceName) { - RelayNamespaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); - if (inner != null) { - return new RelayNamespaceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String namespaceName, Context context) { Response inner = @@ -110,113 +215,62 @@ public Response getByResourceGroupWithResponse( } } - public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName) { - PagedIterable inner = - this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); - return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); - } - - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, Context context) { - PagedIterable inner = - this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, context); - return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); - } - - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); - } - - public Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return this - .serviceClient() - .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); - } - - public AuthorizationRule getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - AuthorizationRuleInner inner = - this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + public RelayNamespace getByResourceGroup(String resourceGroupName, String namespaceName) { + RelayNamespaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); if (inner != null) { - return new AuthorizationRuleImpl(inner, this.manager()); + return new RelayNamespaceImpl(inner, this.manager()); } else { return null; } } - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - Response inner = + public Response createOrUpdateNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters, Context context) { + Response inner = this .serviceClient() - .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + .createOrUpdateNetworkRuleSetWithResponse(resourceGroupName, namespaceName, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AuthorizationRuleImpl(inner.getValue(), this.manager())); + new NetworkRuleSetImpl(inner.getValue(), this.manager())); } else { return null; } } - public AccessKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { - AccessKeysInner inner = this.serviceClient().listKeys(resourceGroupName, namespaceName, authorizationRuleName); + 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 Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - Response inner = - this.serviceClient().listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); + public Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context) { + Response inner = + this.serviceClient().getNetworkRuleSetWithResponse(resourceGroupName, namespaceName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccessKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - 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 AccessKeysImpl(inner, this.manager()); + new NetworkRuleSetImpl(inner.getValue(), 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); + public NetworkRuleSet getNetworkRuleSet(String resourceGroupName, String namespaceName) { + NetworkRuleSetInner inner = this.serviceClient().getNetworkRuleSet(resourceGroupName, namespaceName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AccessKeysImpl(inner.getValue(), this.manager())); + return new NetworkRuleSetImpl(inner, this.manager()); } else { return null; } 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 0000000000000..64656d9ce193f --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NetworkRuleSetImpl.java @@ -0,0 +1,66 @@ +// 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.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 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 b7835ab36aacf..cc8e33cbccfca 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 @@ -22,10 +22,22 @@ public String name() { return this.innerModel().name(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public OperationDisplay display() { return this.innerModel().display(); } + public String origin() { + return this.innerModel().origin(); + } + + public Object properties() { + return this.innerModel().properties(); + } + 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 6574ac84156a0..618bf5019278b 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 @@ -198,7 +198,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -234,7 +235,8 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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. 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 0000000000000..b910cec52c592 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,184 @@ +// 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.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + + 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.namespaceName = Utils.getValueFromIdByName(innerObject.id(), "namespaces"); + this.privateEndpointConnectionName = Utils.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 0000000000000..21476a4ad044d --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1035 @@ +// 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.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.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.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 RelayApiImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(RelayApiImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RelayApiPrivateEndpointConnections to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RelayApiPrivateEndpo") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" + + "/{namespaceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" + + "/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"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("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the available PrivateEndpointConnections within a 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 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) { + 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 + .list( + 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())); + } + + /** + * Gets the available PrivateEndpointConnections within a 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 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, 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 + .list( + 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)); + } + + /** + * Gets the available PrivateEndpointConnections within a 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 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 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 available PrivateEndpointConnections within a namespace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the available PrivateEndpointConnections within a 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 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<>(listAsync(resourceGroupName, namespaceName)); + } + + /** + * Gets the available PrivateEndpointConnections within a 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 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<>(listAsync(resourceGroupName, namespaceName, context)); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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) { + 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 (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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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 + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String namespaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner 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 (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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + namespaceName, + privateEndpointConnectionName, + parameters, + accept, + context); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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) { + return createOrUpdateWithResponseAsync( + resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, context) + .block(); + } + + /** + * Creates or updates PrivateEndpointConnections of service namespace. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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) { + 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + 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. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * 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 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 Name of the Resource group within the Azure subscription. + * @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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 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) { + return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * 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 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) { + return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * 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 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 Name of the Resource group within the Azure subscription. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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) { + deleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).block(); + } + + /** + * 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 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) { + deleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context).block(); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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) { + 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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, + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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, + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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) { + return getWithResponseAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, context).block(); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of all private endpoint connections operation 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(), + 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 + *

The nextLink parameter. + * @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 of all private endpoint connections operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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.")); + } + 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)); + } +} 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 0000000000000..045d5de39ff02 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,209 @@ +// 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.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 PagedIterable list(String resourceGroupName, String namespaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, namespaceName); + return Utils.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 Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + 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 Response getWithResponse( + String resourceGroupName, String namespaceName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 0000000000000..4983c8022574c --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,64 @@ +// 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.implementation; + +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 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 0000000000000..2291d060f81b4 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,394 @@ +// 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.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 RelayApiImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(RelayApiImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RelayApiPrivateLinkResources to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "RelayApiPrivateLinkR") + private 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("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, + @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}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("namespaceName") String namespaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The PrivateLinkResource 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 privateLinkResourceName) { + 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 (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName 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, + privateLinkResourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The PrivateLinkResource 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} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String privateLinkResourceName, 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 (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName 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, + privateLinkResourceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The PrivateLinkResource 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 privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, namespaceName, privateLinkResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The PrivateLinkResource 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 privateLinkResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, privateLinkResourceName, context).block(); + } + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The PrivateLinkResource 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 PrivateLinkResourceInner get( + String resourceGroupName, String namespaceName, String privateLinkResourceName) { + return getWithResponse(resourceGroupName, namespaceName, privateLinkResourceName, Context.NONE).getValue(); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @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 lists of resources that supports Privatelinks along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 + .list( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @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 lists of resources that supports Privatelinks along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + 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 + .list( + this.client.getEndpoint(), + resourceGroupName, + namespaceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @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 lists of resources that supports Privatelinks 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())); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @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 lists of resources that supports Privatelinks along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String namespaceName, Context context) { + return listWithResponseAsync(resourceGroupName, namespaceName, context).block(); + } + + /** + * Gets lists of resources that supports Privatelinks. + * + * @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 lists of resources that supports Privatelinks. + */ + @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 0000000000000..64370baab7ef6 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,87 @@ +// 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.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); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourcesListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 0000000000000..53b4b5d88edfc --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/PrivateLinkResourcesListResultImpl.java @@ -0,0 +1,51 @@ +// 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.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/RelayApiBuilder.java index a826c74ba63e8..dbd96a1d1cbd0 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/RelayApiBuilder.java @@ -18,9 +18,8 @@ @ServiceClientBuilder(serviceClients = {RelayApiImpl.class}) public final class RelayApiBuilder { /* - * Subscription credentials which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every - * service call. + * Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. */ private String subscriptionId; @@ -122,23 +121,26 @@ public RelayApiBuilder serializerAdapter(SerializerAdapter serializerAdapter) { * @return an instance of RelayApiImpl. */ public RelayApiImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); RelayApiImpl client = - new RelayApiImpl(pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + new RelayApiImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); 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/RelayApiImpl.java index 42bca7163613c..ea571b90c5a86 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/RelayApiImpl.java @@ -25,6 +25,8 @@ 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.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.relay.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.relay.fluent.RelayApi; import com.azure.resourcemanager.relay.fluent.WcfRelaysClient; import java.io.IOException; @@ -115,18 +117,6 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - /** The NamespacesClient object to access its operations. */ private final NamespacesClient namespaces; @@ -163,6 +153,42 @@ public WcfRelaysClient getWcfRelays() { return this.wcfRelays; } + /** 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 OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + /** * Initializes an instance of RelayApi client. * @@ -186,11 +212,13 @@ public WcfRelaysClient getWcfRelays() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2017-04-01"; - this.operations = new OperationsClientImpl(this); + this.apiVersion = "2021-11-01"; 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.operations = new OperationsClientImpl(this); } /** 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 210cd06f29e1a..6e09f7d017792 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 @@ -5,15 +5,20 @@ 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 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 +54,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 +82,24 @@ 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 Region region() { return Region.fromName(this.regionName()); } @@ -206,6 +237,27 @@ 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; + } + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } 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 955d490bb44dc..e2f3a05400f27 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 @@ -4,6 +4,8 @@ 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String location() { + return this.innerModel().location(); + } + 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 f834d043408b1..819f0b1ea8299 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 @@ -67,13 +67,14 @@ private interface WcfRelaysService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays") + + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespace( + Mono> listAuthorizationRules( @HostParam("$host") String endpoint, @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, @@ -82,31 +83,33 @@ Mono> listByNamespace( @Headers({"Content-Type: application/json"}) @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays/{relayName}") + + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( + Mono> createOrUpdateAuthorizationRule( @HostParam("$host") String endpoint, @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, - @BodyParam("application/json") WcfRelayInner parameters, + @BodyParam("application/json") AuthorizationRuleInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays/{relayName}") + + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono> deleteAuthorizationRule( @HostParam("$host") String endpoint, @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, @@ -115,42 +118,44 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays/{relayName}") - @ExpectedResponses({200, 204}) + + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( + Mono> getAuthorizationRule( @HostParam("$host") String endpoint, @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( + @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules") + + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules( + Mono> listKeys( @HostParam("$host") String endpoint, @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"}) - @Put( + @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") + + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule( + Mono> regenerateKeys( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @@ -158,76 +163,71 @@ Mono> createOrUpdateAuthorizationRule( @PathParam("authorizationRuleName") String authorizationRuleName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AuthorizationRuleInner parameters, + @BodyParam("application/json") RegenerateAccessKeyParameters parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Delete( + @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") - @ExpectedResponses({200, 204}) + + "/{namespaceName}/wcfRelays") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule( + Mono> listByNamespace( @HostParam("$host") String endpoint, @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( + @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}") + + "/{namespaceName}/wcfRelays/{relayName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule( + Mono> createOrUpdate( @HostParam("$host") String endpoint, @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, + @BodyParam("application/json") WcfRelayInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) - @Post( + @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/listKeys") - @ExpectedResponses({200}) + + "/{namespaceName}/wcfRelays/{relayName}") + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( + Mono> delete( @HostParam("$host") String endpoint, @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( + @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces" - + "/{namespaceName}/wcfRelays/{relayName}/authorizationRules/{authorizationRuleName}/regenerateKeys") - @ExpectedResponses({200}) + + "/{namespaceName}/wcfRelays/{relayName}") + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys( + Mono> get( @HostParam("$host") String endpoint, @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, - @BodyParam("application/json") RegenerateAccessKeyParameters parameters, @HeaderParam("Accept") String accept, Context context); @@ -235,7 +235,7 @@ Mono> regenerateKeys( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByNamespaceNext( + Mono> listAuthorizationRulesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -245,7 +245,7 @@ Mono> listByNamespaceNext( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRulesNext( + Mono> listByNamespaceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -253,19 +253,20 @@ Mono> listAuthorizationRulesNext( } /** - * Lists the WCF relays within the namespace. + * Authorization rules for a WCF relay. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 of the list WCF relay operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync( - String resourceGroupName, String namespaceName) { + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String relayName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -279,6 +280,9 @@ private Mono> listByNamespaceSinglePageAsync( 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( @@ -290,15 +294,16 @@ private Mono> listByNamespaceSinglePageAsync( .withContext( context -> service - .listByNamespace( + .listAuthorizationRules( this.client.getEndpoint(), resourceGroupName, namespaceName, + relayName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -311,20 +316,21 @@ private Mono> listByNamespaceSinglePageAsync( } /** - * Lists the WCF relays within the namespace. + * Authorization rules for a 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 the response of the list WCF relay operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceSinglePageAsync( - String resourceGroupName, String namespaceName, Context context) { + private Mono> listAuthorizationRulesSinglePageAsync( + String resourceGroupName, String namespaceName, String relayName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -338,6 +344,9 @@ private Mono> listByNamespaceSinglePageAsync( 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( @@ -347,10 +356,11 @@ private Mono> listByNamespaceSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByNamespace( + .listAuthorizationRules( this.client.getEndpoint(), resourceGroupName, namespaceName, + relayName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -367,89 +377,100 @@ private Mono> listByNamespaceSinglePageAsync( } /** - * Lists the WCF relays within the namespace. + * Authorization rules for a WCF relay. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 of the list WCF relay operation as paginated response with {@link PagedFlux}. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String relayName) { return new PagedFlux<>( - () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, relayName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); } /** - * Lists the WCF relays within the namespace. + * Authorization rules for a 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 the response of the list WCF relay operation as paginated response with {@link PagedFlux}. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNamespaceAsync( - String resourceGroupName, String namespaceName, Context context) { + private PagedFlux listAuthorizationRulesAsync( + String resourceGroupName, String namespaceName, String relayName, Context context) { return new PagedFlux<>( - () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, relayName, context), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); } /** - * Lists the WCF relays within the namespace. + * Authorization rules for a WCF relay. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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 of the list WCF relay operation as paginated response with {@link PagedIterable}. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { - return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName)); + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String relayName) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, relayName)); } /** - * Lists the WCF relays within the namespace. + * Authorization rules for a 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 the response of the list WCF relay operation as paginated response with {@link PagedIterable}. + * @return the response from the list namespace 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)); + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String relayName, Context context) { + return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, relayName, context)); } /** - * Creates or updates a WCF relay. This operation is idempotent. + * Creates or updates an authorization rule for a WCF relay. * * @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 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 the WCF relay 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 relayName, WcfRelayInner parameters) { + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + AuthorizationRuleInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -466,6 +487,10 @@ private Mono> createOrUpdateWithResponseAsync( 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( @@ -482,11 +507,12 @@ private Mono> createOrUpdateWithResponseAsync( .withContext( context -> service - .createOrUpdate( + .createOrUpdateAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, @@ -496,22 +522,28 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Creates or updates a WCF relay. This operation is idempotent. + * Creates or updates an authorization rule for a WCF relay. * * @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 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 the WCF relay 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 relayName, WcfRelayInner parameters, Context context) { + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -528,6 +560,10 @@ private Mono> createOrUpdateWithResponseAsync( 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( @@ -542,11 +578,12 @@ private Mono> createOrUpdateWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( + .createOrUpdateAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, @@ -555,76 +592,97 @@ private Mono> createOrUpdateWithResponseAsync( } /** - * Creates or updates a WCF relay. This operation is idempotent. + * Creates or updates an authorization rule for a WCF relay. * * @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 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 the WCF relay 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 relayName, WcfRelayInner parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, relayName, parameters) + 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())); } /** - * Creates or updates a WCF relay. This operation is idempotent. + * Creates or updates an authorization rule for a WCF relay. * * @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 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 the WCF relay resource. + * @return single item in a List or Get AuthorizationRule operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WcfRelayInner createOrUpdate( - String resourceGroupName, String namespaceName, String relayName, WcfRelayInner parameters) { - return createOrUpdateAsync(resourceGroupName, namespaceName, relayName, parameters).block(); + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context) { + return createOrUpdateAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters, context) + .block(); } /** - * Creates or updates a WCF relay. This operation is idempotent. + * Creates or updates an authorization rule for a WCF relay. * * @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. + * @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 the WCF relay resource along with {@link Response}. + * @return single item in a List or Get AuthorizationRule operation. */ @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(); - } - + public AuthorizationRuleInner createOrUpdateAuthorizationRule( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + AuthorizationRuleInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters, Context.NONE) + .getValue(); + } + /** - * Deletes a WCF relay. + * Deletes a WCF relay authorization rule. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 relayName) { + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -641,6 +699,10 @@ private Mono> deleteWithResponseAsync( 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( @@ -652,11 +714,12 @@ private Mono> deleteWithResponseAsync( .withContext( context -> service - .delete( + .deleteAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -665,11 +728,12 @@ private Mono> deleteWithResponseAsync( } /** - * Deletes a WCF relay. + * Deletes a WCF relay authorization rule. * * @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 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. @@ -677,8 +741,12 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String namespaceName, String relayName, Context context) { + private Mono> deleteAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -695,6 +763,10 @@ private Mono> deleteWithResponseAsync( 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( @@ -704,11 +776,12 @@ private Mono> deleteWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .delete( + .deleteAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -716,69 +789,84 @@ private Mono> deleteWithResponseAsync( } /** - * Deletes a WCF relay. + * Deletes a WCF relay authorization rule. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 relayName) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, relayName).flatMap(ignored -> Mono.empty()); + private Mono deleteAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, relayName, authorizationRuleName) + .flatMap(ignored -> Mono.empty()); } /** - * Deletes a WCF relay. + * Deletes a WCF relay authorization rule. * * @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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, String relayName) { - deleteAsync(resourceGroupName, namespaceName, relayName).block(); + public Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + Context context) { + return deleteAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, relayName, authorizationRuleName, context) + .block(); } /** - * Deletes a WCF relay. + * Deletes a WCF relay authorization rule. * * @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. + * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String namespaceName, String relayName, Context context) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, relayName, context).block(); + public void deleteAuthorizationRule( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { + deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, relayName, authorizationRuleName, Context.NONE); } /** - * Returns the description for the specified WCF relay. + * Get authorizationRule for a WCF relay by name. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 + * @return authorizationRule for a WCF relay by name along with {@link Response} on successful completion of {@link * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String namespaceName, String relayName) { + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -795,6 +883,10 @@ private Mono> getWithResponseAsync( 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( @@ -806,11 +898,12 @@ private Mono> getWithResponseAsync( .withContext( context -> service - .get( + .getAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -819,21 +912,26 @@ private Mono> getWithResponseAsync( } /** - * Returns the description for the specified WCF relay. + * Get authorizationRule for a WCF relay by name. * * @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 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 + * @return authorizationRule for a WCF relay by name 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) { + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -850,6 +948,10 @@ private Mono> getWithResponseAsync( 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( @@ -859,11 +961,12 @@ private Mono> getWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .get( + .getAuthorizationRule( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, + authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -871,71 +974,84 @@ private Mono> getWithResponseAsync( } /** - * Returns the description for the specified WCF relay. + * Get authorizationRule for a WCF relay by name. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 getAsync(String resourceGroupName, String namespaceName, String relayName) { - return getWithResponseAsync(resourceGroupName, namespaceName, relayName) + private Mono getAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Returns the description for the specified WCF relay. + * Get authorizationRule for a WCF relay by name. * * @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 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. + * @return authorizationRule for a WCF relay by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WcfRelayInner get(String resourceGroupName, String namespaceName, String relayName) { - return getAsync(resourceGroupName, namespaceName, relayName).block(); + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + Context context) { + return getAuthorizationRuleWithResponseAsync( + resourceGroupName, namespaceName, relayName, authorizationRuleName, context) + .block(); } /** - * Returns the description for the specified WCF relay. + * Get authorizationRule for a WCF relay by name. * * @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. + * @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}. + * @return authorizationRule for a WCF relay by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String namespaceName, String relayName, Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, relayName, context).block(); + public AuthorizationRuleInner getAuthorizationRule( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, relayName, authorizationRuleName, Context.NONE) + .getValue(); } /** - * Authorization rules 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 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 response from the list namespace operation along with {@link PagedResponse} 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> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName, String relayName) { + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -952,6 +1068,10 @@ private Mono> listAuthorizationRulesSingle 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( @@ -963,43 +1083,39 @@ private Mono> listAuthorizationRulesSingle .withContext( context -> service - .listAuthorizationRules( + .listKeys( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, + authorizationRuleName, 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())); } /** - * Authorization rules 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 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 response from the list namespace operation along with {@link PagedResponse} 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> listAuthorizationRulesSinglePageAsync( - String resourceGroupName, String namespaceName, String relayName, Context context) { + private Mono> listKeysWithResponseAsync( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1016,6 +1132,10 @@ private Mono> listAuthorizationRulesSingle 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( @@ -1025,121 +1145,100 @@ private Mono> listAuthorizationRulesSingle final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAuthorizationRules( + .listKeys( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, + authorizationRuleName, 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)); + context); } /** - * Authorization rules 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 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 response from the list namespace operation as paginated response with {@link PagedFlux}. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String relayName) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, relayName), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + @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())); } /** - * Authorization rules 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 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 response from the list namespace operation as paginated response with {@link PagedFlux}. + * @return namespace/Relay Connection String along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync( - String resourceGroupName, String namespaceName, String relayName, Context context) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, relayName, context), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + @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(); } /** - * Authorization rules 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 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 response from the list namespace operation as paginated response with {@link PagedIterable}. + * @return namespace/Relay Connection String. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String relayName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, relayName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessKeysInner listKeys( + String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, Context.NONE) + .getValue(); } /** - * Authorization rules for a 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 the response from the list namespace 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)); - } - - /** - * 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 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 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( + private Mono> regenerateKeysWithResponseAsync( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters) { + RegenerateAccessKeyParameters parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1176,7 +1275,7 @@ private Mono> createOrUpdateAuthorizationRuleWi .withContext( context -> service - .createOrUpdateAuthorizationRule( + .regenerateKeys( this.client.getEndpoint(), resourceGroupName, namespaceName, @@ -1191,27 +1290,26 @@ private Mono> createOrUpdateAuthorizationRuleWi } /** - * 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 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. * @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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + private Mono> regenerateKeysWithResponseAsync( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters, + RegenerateAccessKeyParameters parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1247,7 +1345,7 @@ private Mono> createOrUpdateAuthorizationRuleWi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdateAuthorizationRule( + .regenerateKeys( this.client.getEndpoint(), resourceGroupName, namespaceName, @@ -1261,97 +1359,96 @@ private Mono> createOrUpdateAuthorizationRuleWi } /** - * 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 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 on successful completion of {@link Mono}. + * @return namespace/Relay Connection String on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAuthorizationRuleAsync( + private Mono regenerateKeysAsync( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync( + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponseAsync( resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters) .flatMap(res -> Mono.justOrEmpty(res.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 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. + * @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. + * @return namespace/Relay Connection String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner createOrUpdateAuthorizationRule( + public Response regenerateKeysWithResponse( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters) { - return createOrUpdateAuthorizationRuleAsync( - resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters) + RegenerateAccessKeyParameters parameters, + Context context) { + return regenerateKeysWithResponseAsync( + resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters, context) .block(); } /** - * 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 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. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAuthorizationRuleWithResponse( + public AccessKeysInner regenerateKeys( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters, - Context context) { - return createOrUpdateAuthorizationRuleWithResponseAsync( - resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters, context) - .block(); + RegenerateAccessKeyParameters parameters) { + return regenerateKeysWithResponse( + resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters, Context.NONE) + .getValue(); } /** - * Deletes a WCF relay authorization rule. + * Lists the WCF relays within the namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 the list WCF relay operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { + private Mono> listByNamespaceSinglePageAsync( + String resourceGroupName, String namespaceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1365,13 +1462,6 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( 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( @@ -1383,39 +1473,41 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( .withContext( context -> service - .deleteAuthorizationRule( + .listByNamespace( this.client.getEndpoint(), resourceGroupName, namespaceName, - relayName, - authorizationRuleName, 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 WCF relay authorization rule. + * Lists the WCF relays within the namespace. * * @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 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 the list WCF relay operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - Context context) { + private Mono> listByNamespaceSinglePageAsync( + String resourceGroupName, String namespaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1429,13 +1521,6 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( 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( @@ -1445,96 +1530,109 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .deleteAuthorizationRule( + .listByNamespace( this.client.getEndpoint(), resourceGroupName, namespaceName, - relayName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context); + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Deletes a WCF relay authorization rule. + * Lists the WCF relays within the namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the list WCF relay operation as paginated response with {@link PagedFlux}. */ - @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()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink)); } /** - * Deletes a WCF relay authorization rule. + * Lists the WCF relays within the namespace. * * @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 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.SINGLE) - public void deleteAuthorizationRule( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { - deleteAuthorizationRuleAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNamespaceAsync( + String resourceGroupName, String namespaceName, Context context) { + return new PagedFlux<>( + () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, context), + nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); } /** - * Deletes a WCF relay authorization rule. + * 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)); + } + + /** + * Lists the WCF relays within the namespace. * * @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 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 the list WCF relay operation as paginated response with {@link PagedIterable}. */ - @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(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByNamespace( + String resourceGroupName, String namespaceName, Context context) { + return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, 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 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 {@link + * @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) { + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName, WcfRelayInner parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1551,55 +1649,52 @@ private Mono> getAuthorizationRuleWithResponseA 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"; return FluxUtil .withContext( context -> service - .getAuthorizationRule( + .createOrUpdate( 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())); } /** - * 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 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 along with {@link Response} on successful completion of {@link + * @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, - Context context) { + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName, WcfRelayInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1616,108 +1711,104 @@ private Mono> getAuthorizationRuleWithResponseA 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 - .getAuthorizationRule( + .createOrUpdate( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), + parameters, accept, 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 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName) + * @return description of the WCF relay resource 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) .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 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. + * @return description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AuthorizationRuleInner getAuthorizationRule( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { - return getAuthorizationRuleAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName).block(); + public Response createOrUpdateWithResponse( + String resourceGroupName, String namespaceName, String relayName, WcfRelayInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, relayName, parameters, context) + .block(); } /** - * 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 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(); } /** - * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1734,10 +1825,6 @@ private Mono> listKeysWithResponseAsync( 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( @@ -1749,12 +1836,11 @@ private Mono> listKeysWithResponseAsync( .withContext( context -> service - .listKeys( + .delete( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -1763,25 +1849,20 @@ private Mono> listKeysWithResponseAsync( } /** - * 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 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - Context context) { + private Mono> deleteWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1798,10 +1879,6 @@ private Mono> listKeysWithResponseAsync( 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( @@ -1811,12 +1888,11 @@ private Mono> listKeysWithResponseAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listKeys( + .delete( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, @@ -1824,86 +1900,69 @@ private Mono> listKeysWithResponseAsync( } /** - * 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 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}. + * @return A {@link Mono} that completes when a successful response is received. */ @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())); + 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 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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner listKeys( - String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName) { - return listKeysAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName).block(); + public Response deleteWithResponse( + String resourceGroupName, String namespaceName, String relayName, Context context) { + return deleteWithResponseAsync(resourceGroupName, namespaceName, relayName, context).block(); } /** - * 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 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}. */ @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(); + public void delete(String resourceGroupName, String namespaceName, String relayName) { + deleteWithResponse(resourceGroupName, namespaceName, relayName, Context.NONE); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * 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 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 description of the WCF relay resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1920,62 +1979,45 @@ private Mono> regenerateKeysWithResponseAsync( 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"; return FluxUtil .withContext( context -> service - .regenerateKeys( + .get( 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())); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * 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 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 description of the WCF relay resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeysWithResponseAsync( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context) { + private Mono> getWithResponseAsync( + String resourceGroupName, String namespaceName, String relayName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1992,125 +2034,90 @@ private Mono> regenerateKeysWithResponseAsync( 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( + .get( this.client.getEndpoint(), resourceGroupName, namespaceName, relayName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, accept, context); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * 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 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 description of the WCF relay resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysWithResponseAsync( - resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters) + private Mono getAsync(String resourceGroupName, String namespaceName, String relayName) { + return getWithResponseAsync(resourceGroupName, namespaceName, relayName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * 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 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. + * @return description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccessKeysInner regenerateKeys( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters) { - return regenerateKeysAsync(resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters) - .block(); + public Response getWithResponse( + String resourceGroupName, String namespaceName, String relayName, Context context) { + return getWithResponseAsync(resourceGroupName, namespaceName, relayName, context).block(); } /** - * Regenerates the primary or secondary connection strings to the WCF relay. + * 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 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 description of the WCF relay resource. */ @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(); + public WcfRelayInner get(String resourceGroupName, String namespaceName, String relayName) { + return getWithResponse(resourceGroupName, namespaceName, relayName, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { + private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2122,8 +2129,9 @@ private Mono> listByNamespaceNextSinglePageAsync(St } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext( + context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -2138,16 +2146,18 @@ private Mono> listByNamespaceNextSinglePageAsync(St /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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}. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNamespaceNextSinglePageAsync(String nextLink, Context context) { + private Mono> listAuthorizationRulesNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2160,7 +2170,7 @@ private Mono> listByNamespaceNextSinglePageAsync(St final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) + .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( @@ -2175,15 +2185,16 @@ private Mono> listByNamespaceNextSinglePageAsync(St /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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) { + private Mono> listByNamespaceNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2195,9 +2206,8 @@ private Mono> listAuthorizationRulesNextSi } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .withContext(context -> service.listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -2212,17 +2222,17 @@ private Mono> listAuthorizationRulesNextSi /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 the list WCF relay operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAuthorizationRulesNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByNamespaceNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2235,7 +2245,7 @@ private Mono> listAuthorizationRulesNextSi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) + .listByNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( 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 503ea0809fe7b..3b56b595b5f15 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 @@ -31,64 +31,43 @@ 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 Utils.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 Utils.mapPage(inner, inner1 -> new WcfRelayImpl(inner1, this.manager())); - } - - public void delete(String resourceGroupName, String namespaceName, String relayName) { - this.serviceClient().delete(resourceGroupName, namespaceName, relayName); + public PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String relayName) { + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, relayName); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } - public Response deleteWithResponse( + public PagedIterable listAuthorizationRules( String resourceGroupName, String namespaceName, String relayName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, namespaceName, relayName, context); - } - - 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; - } + PagedIterable inner = + this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, relayName, context); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String namespaceName, String relayName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, namespaceName, relayName, context); + 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 WcfRelayImpl(inner.getValue(), this.manager())); + 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 Utils.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 Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); - } - public AuthorizationRule createOrUpdateAuthorizationRule( String resourceGroupName, String namespaceName, @@ -107,27 +86,16 @@ public AuthorizationRule createOrUpdateAuthorizationRule( } } - public Response createOrUpdateAuthorizationRuleWithResponse( + public Response deleteAuthorizationRuleWithResponse( 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 this + .serviceClient() + .deleteAuthorizationRuleWithResponse( + resourceGroupName, namespaceName, relayName, authorizationRuleName, context); } public void deleteAuthorizationRule( @@ -137,16 +105,26 @@ public void deleteAuthorizationRule( .deleteAuthorizationRule(resourceGroupName, namespaceName, relayName, authorizationRuleName); } - public Response deleteAuthorizationRuleWithResponse( + public Response getAuthorizationRuleWithResponse( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, Context context) { - return this - .serviceClient() - .deleteAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, relayName, authorizationRuleName, 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 AuthorizationRule getAuthorizationRule( @@ -162,23 +140,22 @@ public AuthorizationRule getAuthorizationRule( } } - public Response getAuthorizationRuleWithResponse( + public Response listKeysWithResponse( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, Context context) { - Response inner = + Response inner = this .serviceClient() - .getAuthorizationRuleWithResponse( - resourceGroupName, namespaceName, relayName, authorizationRuleName, context); + .listKeysWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AuthorizationRuleImpl(inner.getValue(), this.manager())); + new AccessKeysImpl(inner.getValue(), this.manager())); } else { return null; } @@ -195,16 +172,18 @@ public AccessKeys listKeys( } } - public Response listKeysWithResponse( + public Response regenerateKeysWithResponse( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, + RegenerateAccessKeyParameters parameters, Context context) { Response inner = this .serviceClient() - .listKeysWithResponse(resourceGroupName, namespaceName, relayName, authorizationRuleName, context); + .regenerateKeysWithResponse( + resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -233,24 +212,45 @@ public AccessKeys regenerateKeys( } } - public Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context) { - Response inner = - this - .serviceClient() - .regenerateKeysWithResponse( - resourceGroupName, namespaceName, relayName, authorizationRuleName, parameters, context); + public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { + PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); + return Utils.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 Utils.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 AccessKeysImpl(inner.getValue(), this.manager())); + new WcfRelayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; } 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 e33bef1abf3d2..b581b56b6ac93 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 @@ -4,47 +4,38 @@ package com.azure.resourcemanager.relay.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for AccessRights. */ -public enum AccessRights { - /** Enum value Manage. */ - MANAGE("Manage"), +public final class AccessRights extends ExpandableStringEnum { + /** Static value Manage for AccessRights. */ + public static final AccessRights MANAGE = fromString("Manage"); - /** Enum value Send. */ - SEND("Send"), + /** Static value Send for AccessRights. */ + public static final AccessRights SEND = fromString("Send"); - /** Enum value Listen. */ - LISTEN("Listen"); - - /** The actual serialized value for a AccessRights instance. */ - private final String value; - - AccessRights(String value) { - this.value = value; - } + /** Static value Listen for AccessRights. */ + public static final AccessRights LISTEN = fromString("Listen"); /** - * 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. */ @JsonCreator - public static AccessRights fromString(String value) { - 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); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known AccessRights values. + * + * @return known AccessRights values. + */ + public static Collection values() { + return values(AccessRights.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 c4a4ac3c36bf3..2fa60b901db29 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 @@ -5,6 +5,8 @@ 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; @@ -32,6 +34,20 @@ public interface AuthorizationRule { */ String type(); + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + /** * Gets the rights property: The rights associated with the rule. * @@ -39,6 +55,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. * @@ -55,10 +85,7 @@ public interface AuthorizationRule { /** The entirety of the AuthorizationRule definition. */ interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithRights, - DefinitionStages.WithCreate { + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** The AuthorizationRule definition stages. */ interface DefinitionStages { @@ -74,23 +101,13 @@ interface WithParentResource { * @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. * @@ -106,6 +123,16 @@ 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); + } } /** * Begins update for the AuthorizationRule resource. @@ -162,43 +189,43 @@ interface WithRights { /** * Primary and secondary connection strings to the namespace. * + * @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 namespace/Relay Connection String along with {@link Response}. */ - AccessKeys listKeys(); + Response listKeysWithResponse(Context context); /** * Primary and secondary connection strings to the namespace. * - * @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 namespace/Relay Connection String. */ - Response listKeysWithResponse(Context context); + AccessKeys listKeys(); /** * Regenerates the primary or secondary connection strings to the namespace. * * @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 namespace/Relay Connection String along with {@link Response}. */ - AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters); + Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context); /** * Regenerates the primary or secondary connection strings to the namespace. * * @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 namespace/Relay Connection String. */ - Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context); + AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters); } 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/models/AuthorizationRuleListResult.java index e8b6188306466..3c3c0304c3daf 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/models/AuthorizationRuleListResult.java @@ -19,12 +19,15 @@ public final class AuthorizationRuleListResult { private List value; /* - * Link to the next set of results. Not empty if value contains incomplete - * list of authorization rules. + * Link to the next set of results. Not empty if value contains incomplete list of authorization rules. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of AuthorizationRuleListResult class. */ + public AuthorizationRuleListResult() { + } + /** * Get the value property: Result of the list authorization rules operation. * 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 1f7446b7bac36..0e93ef9237e0e 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 @@ -12,13 +12,16 @@ @Fluent public final class CheckNameAvailability { /* - * The namespace name to check for availability. The namespace name can - * contain only letters, numbers, and hyphens. The namespace must start - * with a letter, and it must end with a letter or number. + * The namespace name to check for availability. The namespace name can contain only letters, numbers, and hyphens. + * The namespace must start with a letter, and it must end with a letter or number. */ @JsonProperty(value = "name", required = true) private String name; + /** Creates an instance of CheckNameAvailability class. */ + public CheckNameAvailability() { + } + /** * Get the name property: The namespace name to check for availability. The namespace name can contain only letters, * numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number. 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 0000000000000..650564d3548d8 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ConnectionState.java @@ -0,0 +1,76 @@ +// 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; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ConnectionState information. */ +@Fluent +public final class ConnectionState { + /* + * Status of the connection. + */ + @JsonProperty(value = "status") + private PrivateLinkConnectionStatus status; + + /* + * Description of the connection state. + */ + @JsonProperty(value = "description") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 0000000000000..85bf5169e4274 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/DefaultAction.java @@ -0,0 +1,38 @@ +// 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; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a DefaultAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultAction. + */ + @JsonCreator + 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 0000000000000..538d9b640bb76 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/EndPointProvisioningState.java @@ -0,0 +1,50 @@ +// 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; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a EndPointProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndPointProvisioningState. + */ + @JsonCreator + 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 3d52e4a2c1a08..509e18c43b22b 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 @@ -4,6 +4,8 @@ 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; @@ -31,6 +33,20 @@ public interface HybridConnection { */ String type(); + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + /** * Gets the createdAt property: The time the hybrid connection was created. * @@ -70,6 +86,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. * 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/models/HybridConnectionListResult.java index 28a1ed910d111..261dd0e3ea2c8 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/models/HybridConnectionListResult.java @@ -19,12 +19,15 @@ public final class HybridConnectionListResult { private List value; /* - * Link to the next set of results. Not empty if value contains incomplete - * list hybrid connection operation. + * Link to the next set of results. Not empty if value contains incomplete list hybrid connection operation. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of HybridConnectionListResult class. */ + public HybridConnectionListResult() { + } + /** * Get the value property: Result of the list hybrid connections. * 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 3ac611b78a451..1466770fdcb7a 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 @@ -12,84 +12,18 @@ /** Resource collection API of HybridConnections. */ public interface HybridConnections { /** - * 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}. - */ - 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}. - */ - PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); - - /** - * 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 com.azure.core.management.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 hybridConnectionName); - - /** - * 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. - * @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}. - */ - Response deleteWithResponse( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); - - /** - * Returns the description for the specified 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 com.azure.core.management.exception.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); - - /** - * Returns the description for the specified hybrid connection. + * Authorization rules for 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. - * @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 response from the list namespace operation as paginated response with {@link PagedIterable}. */ - Response getWithResponse( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String hybridConnectionName); /** * Authorization rules for a hybrid connection. @@ -97,28 +31,36 @@ Response getWithResponse( * @param resourceGroupName Name of the Resource group within the Azure subscription. * @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}. */ PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String hybridConnectionName); + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); /** - * Authorization rules for 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 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 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}. */ - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String hybridConnectionName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context); /** * Creates or updates an authorization rule for a hybrid connection. @@ -131,7 +73,7 @@ PagedIterable listAuthorizationRules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 single item in a List or Get AuthorizationRule operation. */ AuthorizationRule createOrUpdateAuthorizationRule( String resourceGroupName, @@ -141,25 +83,23 @@ AuthorizationRule createOrUpdateAuthorizationRule( AuthorizationRuleInner parameters); /** - * Creates or updates an authorization rule for a hybrid connection. + * Deletes a hybrid connection authorization rule. * * @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 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 the {@link Response}. */ - Response createOrUpdateAuthorizationRuleWithResponse( + Response deleteAuthorizationRuleWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, - AuthorizationRuleInner parameters, Context context); /** @@ -177,7 +117,7 @@ void deleteAuthorizationRule( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName); /** - * Deletes a hybrid connection authorization rule. + * Hybrid connection authorization rule for a hybrid connection by name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name. @@ -187,9 +127,9 @@ void deleteAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 deleteAuthorizationRuleWithResponse( + Response getAuthorizationRuleWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, @@ -206,13 +146,13 @@ Response deleteAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 single item in a List or Get AuthorizationRule operation. */ AuthorizationRule getAuthorizationRule( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName); /** - * Hybrid connection authorization rule for a hybrid connection by name. + * Primary and secondary connection strings to the hybrid connection. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name. @@ -222,9 +162,9 @@ AuthorizationRule getAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 getAuthorizationRuleWithResponse( + Response listKeysWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, @@ -247,23 +187,25 @@ AccessKeys listKeys( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName); /** - * Primary and secondary connection strings to the 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 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}. */ - Response listKeysWithResponse( + Response regenerateKeysWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, String authorizationRuleName, + RegenerateAccessKeyParameters parameters, Context context); /** @@ -287,26 +229,84 @@ AccessKeys regenerateKeys( RegenerateAccessKeyParameters parameters); /** - * 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 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}. + */ + 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}. + */ + PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); + + /** + * 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. - * @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}. */ - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String hybridConnectionName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context); + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); + + /** + * 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 com.azure.core.management.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 hybridConnectionName); + + /** + * Returns the description for the specified hybrid connection. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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 description of hybrid connection resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); + + /** + * Returns the description for the specified 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 com.azure.core.management.exception.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); /** * 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 c913d38dfd874..c41ce163d7c64 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 @@ -4,44 +4,35 @@ package com.azure.resourcemanager.relay.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; -/** Defines values for KeyType. */ -public enum KeyType { - /** Enum value PrimaryKey. */ - PRIMARY_KEY("PrimaryKey"), +/** The access key to regenerate. */ +public final class KeyType extends ExpandableStringEnum { + /** Static value PrimaryKey for KeyType. */ + public static final KeyType PRIMARY_KEY = fromString("PrimaryKey"); - /** Enum value SecondaryKey. */ - SECONDARY_KEY("SecondaryKey"); - - /** The actual serialized value for a KeyType instance. */ - private final String value; - - KeyType(String value) { - this.value = value; - } + /** Static value SecondaryKey for KeyType. */ + public static final KeyType SECONDARY_KEY = fromString("SecondaryKey"); /** - * 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. */ @JsonCreator - public static KeyType fromString(String value) { - 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); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known KeyType values. + * + * @return known KeyType values. + */ + 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 0000000000000..2fac744e2cb46 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NWRuleSetIpRules.java @@ -0,0 +1,76 @@ +// 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; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The response from the List namespace operation. */ +@Fluent +public final class NWRuleSetIpRules { + /* + * IP Mask + */ + @JsonProperty(value = "ipMask") + private String ipMask; + + /* + * The IP Filter Action + */ + @JsonProperty(value = "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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 87c87771dbac4..a717800f710b0 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 @@ -7,272 +7,328 @@ 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 rules for a namespace. * - * @param parameters Parameters to check availability of the specified namespace name. + * @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 description of the check name availability request properties. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ - CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters); + PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); /** - * Check the specified namespace name availability. + * Authorization rules for a namespace. * - * @param parameters Parameters to check availability of the specified namespace name. + * @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 description of the check name availability request properties along with {@link Response}. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ - Response checkNameAvailabilityWithResponse( - CheckNameAvailability parameters, Context context); + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, Context context); /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Deletes a namespace authorization rule. + * + * @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 the {@link Response}. + */ + Response deleteAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + + /** + * Deletes a namespace authorization rule. * + * @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 com.azure.core.management.exception.ManagementException thrown 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(); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * Authorization rule for a namespace by name. * + * @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 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}. */ - PagedIterable list(Context context); + Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); /** - * Lists all the available namespaces within the ResourceGroup. + * Authorization rule for a namespace by name. * * @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 com.azure.core.management.exception.ManagementException thrown 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. */ - PagedIterable listByResourceGroup(String resourceGroupName); + AuthorizationRule getAuthorizationRule( + String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Lists all the available namespaces within the ResourceGroup. + * 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 com.azure.core.management.exception.ManagementException thrown 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 namespace/Relay Connection String along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + 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 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 com.azure.core.management.exception.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 deleteByResourceGroup(String resourceGroupName, String namespaceName); + AccessKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * 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 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); /** - * Returns the description for the specified namespace. + * Regenerates the primary or 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 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 description of a namespace resource. + * @return namespace/Relay Connection String. */ - RelayNamespace getByResourceGroup(String resourceGroupName, String namespaceName); + AccessKeys regenerateKeys( + String resourceGroupName, + String namespaceName, + String authorizationRuleName, + RegenerateAccessKeyParameters parameters); /** - * Returns the description for the specified namespace. + * Check the specified namespace name availability. * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @param namespaceName The namespace name. + * @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 com.azure.core.management.exception.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}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String namespaceName, Context context); + Response checkNameAvailabilityWithResponse( + CheckNameAvailability parameters, Context context); /** - * Authorization rules for a namespace. + * Check the specified namespace name availability. + * + * @param parameters Parameters to check availability of the specified 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 the check name availability request properties. + */ + CheckNameAvailabilityResult checkNameAvailability(CheckNameAvailability parameters); + + /** + * Lists all the available namespaces within the subscription regardless of the resourceGroups. + * + * @throws com.azure.core.management.exception.ManagementException thrown 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(); + + /** + * 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 from the list namespace operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the available namespaces within the ResourceGroup. * * @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 from the list namespace operation as paginated response with {@link PagedIterable}. */ - PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Authorization rules 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 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); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deletes a namespace authorization rule. + * 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 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. */ - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + void deleteByResourceGroup(String resourceGroupName, String namespaceName); /** - * Deletes a namespace authorization rule. + * 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 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 {@link Response}. */ - Response deleteAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + void delete(String resourceGroupName, String namespaceName, Context context); /** - * Authorization rule for a namespace by name. + * Returns the description for the specified 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 com.azure.core.management.exception.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 a namespace resource along with {@link Response}. */ - AuthorizationRule getAuthorizationRule( - String resourceGroupName, String namespaceName, String authorizationRuleName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String namespaceName, Context context); /** - * Authorization rule for a namespace by name. + * Returns the description for the specified 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 com.azure.core.management.exception.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 a namespace resource. */ - Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + RelayNamespace getByResourceGroup(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 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. + * @return description of topic resource along with {@link Response}. */ - AccessKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); + 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 namespaceName The namespace name. - * @param authorizationRuleName The authorization rule name. - * @param context The context to associate with this operation. + * @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 along with {@link Response}. + * @return description of topic resource. */ - Response listKeysWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); + NetworkRuleSet createOrUpdateNetworkRuleSet( + String resourceGroupName, String namespaceName, NetworkRuleSetInner parameters); /** - * Regenerates the primary or secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 along with {@link Response}. */ - AccessKeys regenerateKeys( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters); + Response getNetworkRuleSetWithResponse( + String resourceGroupName, String namespaceName, Context context); /** - * Regenerates the primary or secondary connection strings to the namespace. + * Gets NetworkRuleSet for a Namespace. * * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. */ - Response regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context); + NetworkRuleSet getNetworkRuleSet(String resourceGroupName, String namespaceName); /** * Returns the description for the specified namespace. @@ -304,7 +360,7 @@ Response regenerateKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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); @@ -316,7 +372,7 @@ Response regenerateKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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); 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 0000000000000..a948a18bec149 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleIpAction.java @@ -0,0 +1,35 @@ +// 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; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a NetworkRuleIpAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkRuleIpAction. + */ + @JsonCreator + 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 0000000000000..a38d97faa3d97 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/NetworkRuleSet.java @@ -0,0 +1,69 @@ +// 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; + +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: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 32a26b5513fa0..3dee901aa8465 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 @@ -16,12 +16,33 @@ public interface Operation { String name(); /** - * Gets the display property: The object that represents the operation. + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Display of the operation. * * @return the display value. */ OperationDisplay display(); + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Properties of the operation. + * + * @return the properties value. + */ + Object properties(); + /** * 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 6fbc7736f994d..51fd560a36796 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 @@ -7,29 +7,39 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The object that represents the operation. */ +/** Operation display payload. */ @Immutable public final class OperationDisplay { /* - * Service provider: Relay. + * Resource provider of the operation */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * Resource on which the operation is performed: Invoice, etc. + * Resource of the operation */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * Operation type: Read, write, delete, etc. + * Localized friendly name for the operation */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; + /* + * Localized friendly description for the operation + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** - * Get the provider property: Service provider: Relay. + * Get the provider property: Resource provider of the operation. * * @return the provider value. */ @@ -38,7 +48,7 @@ public String provider() { } /** - * Get the resource property: Resource on which the operation is performed: Invoice, etc. + * Get the resource property: Resource of the operation. * * @return the resource value. */ @@ -47,7 +57,7 @@ public String resource() { } /** - * Get the operation property: Operation type: Read, write, delete, etc. + * Get the operation property: Localized friendly name for the operation. * * @return the operation value. */ @@ -55,6 +65,15 @@ public String operation() { return this.operation; } + /** + * Get the description property: Localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + /** * Validates the instance. * 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/models/OperationListResult.java index 73bd948fdaea8..3df4fe5a24009 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/models/OperationListResult.java @@ -16,7 +16,7 @@ @Immutable public final class OperationListResult { /* - * List of Relay operations supported by resource provider. + * List of Relay operations supported by the Microsoft.Relay resource provider. */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; @@ -27,8 +27,12 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** - * Get the value property: List of Relay operations supported by resource provider. + * Get the value property: List of Relay operations supported by the Microsoft.Relay resource provider. * * @return the value value. */ 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 0000000000000..f1f24d13aaaf6 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpoint.java @@ -0,0 +1,50 @@ +// 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; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PrivateEndpoint information. */ +@Fluent +public final class PrivateEndpoint { + /* + * The ARM identifier for Private Endpoint. + */ + @JsonProperty(value = "id") + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 0000000000000..eddea0ab58213 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnection.java @@ -0,0 +1,248 @@ +// 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; + +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 systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * 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 Name of the Resource group within the Azure subscription. + * @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/PrivateEndpointConnectionListResult.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..d4e3914078354 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,81 @@ +// 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; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the list of all private endpoint connections operation. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * A collection of private endpoint connection resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link for the next page of private endpoint connection resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: A collection of private endpoint connection resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of private endpoint connection resources. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of private endpoint connection resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of private endpoint connection resources. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult 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()); + } + } +} 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 0000000000000..1cee072a99d71 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateEndpointConnections.java @@ -0,0 +1,144 @@ +// 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; + +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 the available PrivateEndpointConnections within a 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 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 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 available PrivateEndpointConnections within a namespace as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String namespaceName, Context context); + + /** + * 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 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 Name of the Resource group within the Azure subscription. + * @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 a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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 Name of the Resource group within the Azure subscription. + * @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); + + /** + * 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 0000000000000..e450fb1f9ebe3 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkConnectionStatus.java @@ -0,0 +1,44 @@ +// 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; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a PrivateLinkConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateLinkConnectionStatus. + */ + @JsonCreator + 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 0000000000000..79b954d08a860 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResource.java @@ -0,0 +1,60 @@ +// 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; + +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 identifier of the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * 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 0000000000000..71f8aa928a27a --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResources.java @@ -0,0 +1,65 @@ +// 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; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The PrivateLinkResource 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 privateLinkResourceName, Context context); + + /** + * Gets a description for the specified Private Endpoint Connection name. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @param namespaceName The namespace name. + * @param privateLinkResourceName The PrivateLinkResource 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. + */ + PrivateLinkResource get(String resourceGroupName, String namespaceName, String privateLinkResourceName); + + /** + * Gets lists of resources that supports Privatelinks. + * + * @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 lists of resources that supports Privatelinks along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String namespaceName, Context context); + + /** + * Gets lists of resources that supports Privatelinks. + * + * @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 lists of resources that supports Privatelinks. + */ + 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 0000000000000..6c660ee0259a4 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PrivateLinkResourcesListResult.java @@ -0,0 +1,32 @@ +// 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; + +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 3d3fd471e42d9..0000000000000 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/ProvisioningStateEnum.java +++ /dev/null @@ -1,59 +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; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** 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. - */ - @JsonCreator - public static ProvisioningStateEnum fromString(String value) { - ProvisioningStateEnum[] items = ProvisioningStateEnum.values(); - for (ProvisioningStateEnum item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @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 0000000000000..0280c0e6535c1 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/PublicNetworkAccess.java @@ -0,0 +1,41 @@ +// 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; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + 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 be06454088eed..c149445d7c4ba 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 @@ -8,7 +8,7 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** 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 { /* @@ -18,12 +18,15 @@ public final class RegenerateAccessKeyParameters { private KeyType keyType; /* - * Optional. If the key value is provided, this is set to key type, or - * autogenerated key value set for key type. + * Optional. If the key value is provided, this is set to key type, or autogenerated key value set for key type. */ @JsonProperty(value = "key") private String key; + /** Creates an instance of RegenerateAccessKeyParameters class. */ + public RegenerateAccessKeyParameters() { + } + /** * Get the keyType property: The access key to regenerate. * 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 4339ff6ae03d9..50d44aee20a7d 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 @@ -5,9 +5,12 @@ 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; /** An immutable client-side representation of RelayNamespace. */ @@ -55,11 +58,25 @@ public interface RelayNamespace { Sku sku(); /** - * Gets the provisioningState property: The provisioningState property. + * Gets the systemData property: The system meta data relating to this resource. + * + * @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. @@ -89,6 +106,21 @@ 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 region of the resource. * @@ -161,7 +193,11 @@ 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 { /** * Executes the create request. * @@ -197,6 +233,28 @@ 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); + } } /** * Begins update for the RelayNamespace resource. @@ -206,7 +264,11 @@ interface WithSku { RelayNamespace.Update update(); /** The template for RelayNamespace update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithPrivateEndpointConnections, + UpdateStages.WithPublicNetworkAccess { /** * Executes the update request. * @@ -244,6 +306,28 @@ 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); + } } /** * Refreshes the resource to sync with Azure. 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/models/RelayNamespaceListResult.java index 1ed496e8949fd..6a296f77e44da 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/models/RelayNamespaceListResult.java @@ -19,12 +19,15 @@ public final class RelayNamespaceListResult { private List value; /* - * Link to the next set of results. Not empty if value contains incomplete - * list of namespaces. + * Link to the next set of results. Not empty if value contains incomplete list of namespaces. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of RelayNamespaceListResult class. */ + public RelayNamespaceListResult() { + } + /** * Get the value property: Result of the list namespace operation. * 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 fe5fc36d732b9..9cd0d4589794b 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 @@ -5,9 +5,11 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.relay.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Description of a namespace resource. */ @@ -25,6 +27,10 @@ public final class RelayUpdateParameters extends ResourceNamespacePatch { @JsonProperty(value = "properties") private RelayNamespaceProperties innerProperties; + /** Creates an instance of RelayUpdateParameters class. */ + public RelayUpdateParameters() { + } + /** * Get the sku property: SKU of the namespace. * @@ -62,14 +68,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. * @@ -106,6 +121,55 @@ public String metricId() { return this.innerProperties() == null ? null : this.innerProperties().metricId(); } + /** + * 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. + * + * @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(); + } + 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; + } + /** * Validates the instance. * 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 432c2ac702687..41822703374bb 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 @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for Relaytype. */ +/** WCF relay type. */ public enum Relaytype { /** Enum value NetTcp. */ NET_TCP("NetTcp"), @@ -30,6 +30,9 @@ public enum Relaytype { */ @JsonCreator public static Relaytype fromString(String value) { + if (value == null) { + return null; + } Relaytype[] items = Relaytype.values(); for (Relaytype item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static Relaytype fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { 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 47fa2fe493129..99814ed40dfc7 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 @@ -20,6 +20,10 @@ public class ResourceNamespacePatch extends ProxyResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of ResourceNamespacePatch class. */ + public ResourceNamespacePatch() { + } + /** * Get the tags property: Resource tags. * 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 ba33831977c78..d86ec956ea225 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; /** SKU of the namespace. */ @@ -14,7 +15,7 @@ public final class Sku { * Name of this SKU. */ @JsonProperty(value = "name", required = true) - private String name = "Standard"; + private SkuName name; /* * The tier of this SKU. @@ -24,7 +25,6 @@ public final class Sku { /** Creates an instance of Sku class. */ public Sku() { - name = "Standard"; } /** @@ -32,7 +32,7 @@ public Sku() { * * @return the name value. */ - public String name() { + public SkuName name() { return this.name; } @@ -42,7 +42,7 @@ public String name() { * @param name the name value to set. * @return the Sku object itself. */ - public Sku withName(String name) { + public Sku withName(SkuName name) { this.name = name; return this; } @@ -73,5 +73,11 @@ public Sku withTier(SkuTier tier) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); } 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 0000000000000..b5af01d957407 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/SkuName.java @@ -0,0 +1,35 @@ +// 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; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + 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 b1f1b4aa4726c..ec4e512cebd06 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 @@ -4,41 +4,32 @@ package com.azure.resourcemanager.relay.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; -/** Defines values for SkuTier. */ -public enum SkuTier { - /** Enum value Standard. */ - STANDARD("Standard"); - - /** The actual serialized value for a SkuTier instance. */ - private final String value; - - SkuTier(String value) { - this.value = value; - } +/** The tier of this SKU. */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); /** - * 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. */ @JsonCreator - public static SkuTier fromString(String value) { - 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); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known SkuTier values. + * + * @return known SkuTier values. + */ + public static Collection values() { + return values(SkuTier.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 50b8d8b696aa6..f3f4d95b9fb23 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 @@ -4,56 +4,48 @@ package com.azure.resourcemanager.relay.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; -/** Defines values for UnavailableReason. */ -public enum UnavailableReason { - /** Enum value None. */ - NONE("None"), +/** Specifies the reason for the unavailability of the service. */ +public final class UnavailableReason extends ExpandableStringEnum { + /** Static value None for UnavailableReason. */ + public static final UnavailableReason NONE = fromString("None"); - /** Enum value InvalidName. */ - INVALID_NAME("InvalidName"), + /** Static value InvalidName for UnavailableReason. */ + public static final UnavailableReason INVALID_NAME = fromString("InvalidName"); - /** Enum value SubscriptionIsDisabled. */ - SUBSCRIPTION_IS_DISABLED("SubscriptionIsDisabled"), + /** Static value SubscriptionIsDisabled for UnavailableReason. */ + public static final UnavailableReason SUBSCRIPTION_IS_DISABLED = fromString("SubscriptionIsDisabled"); - /** Enum value NameInUse. */ - NAME_IN_USE("NameInUse"), + /** Static value NameInUse for UnavailableReason. */ + public static final UnavailableReason NAME_IN_USE = fromString("NameInUse"); - /** Enum value NameInLockdown. */ - NAME_IN_LOCKDOWN("NameInLockdown"), + /** Static value NameInLockdown for UnavailableReason. */ + public static final UnavailableReason NAME_IN_LOCKDOWN = fromString("NameInLockdown"); - /** Enum value TooManyNamespaceInCurrentSubscription. */ - TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION("TooManyNamespaceInCurrentSubscription"); - - /** The actual serialized value for a UnavailableReason instance. */ - private final String value; - - UnavailableReason(String value) { - this.value = value; - } + /** Static value TooManyNamespaceInCurrentSubscription for UnavailableReason. */ + public static final UnavailableReason TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION = + fromString("TooManyNamespaceInCurrentSubscription"); /** - * 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. */ @JsonCreator - public static UnavailableReason fromString(String value) { - 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); } - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known UnavailableReason values. + * + * @return known UnavailableReason values. + */ + 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 4a758f8f19a41..f2ffa6b2a7a9a 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 @@ -4,6 +4,8 @@ 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; @@ -31,6 +33,20 @@ public interface WcfRelay { */ String type(); + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + /** * Gets the isDynamic property: Returns true if the relay is dynamic; otherwise, false. * @@ -92,6 +108,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. * 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 335c7e33f8b7e..dac180fe45925 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 @@ -12,84 +12,18 @@ /** Resource collection API of WcfRelays. */ public interface WcfRelays { /** - * 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}. - */ - 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}. - */ - PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); - - /** - * Deletes a WCF relay. - * - * @param resourceGroupName Name of the Resource group within the Azure subscription. - * @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. - */ - void delete(String resourceGroupName, String namespaceName, String relayName); - - /** - * Deletes a 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 com.azure.core.management.exception.ManagementException 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}. - */ - Response deleteWithResponse( - String resourceGroupName, String namespaceName, String relayName, Context context); - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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); - - /** - * Returns the description for the specified WCF relay. + * Authorization rules for a 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 com.azure.core.management.exception.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 response from the list namespace operation as paginated response with {@link PagedIterable}. */ - Response getWithResponse( - String resourceGroupName, String namespaceName, String relayName, Context context); + PagedIterable listAuthorizationRules( + String resourceGroupName, String namespaceName, String relayName); /** * Authorization rules for a WCF relay. @@ -97,28 +31,36 @@ Response getWithResponse( * @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 com.azure.core.management.exception.ManagementException thrown 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, String relayName); + String resourceGroupName, String namespaceName, String relayName, Context context); /** - * Authorization rules for 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 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 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}. */ - PagedIterable listAuthorizationRules( - String resourceGroupName, String namespaceName, String relayName, Context context); + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, + String namespaceName, + String relayName, + String authorizationRuleName, + AuthorizationRuleInner parameters, + Context context); /** * Creates or updates an authorization rule for a WCF relay. @@ -131,7 +73,7 @@ PagedIterable listAuthorizationRules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 single item in a List or Get AuthorizationRule operation. */ AuthorizationRule createOrUpdateAuthorizationRule( String resourceGroupName, @@ -141,25 +83,23 @@ AuthorizationRule createOrUpdateAuthorizationRule( AuthorizationRuleInner parameters); /** - * Creates or updates an authorization rule for a WCF relay. + * Deletes a WCF relay authorization rule. * * @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 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 the {@link Response}. */ - Response createOrUpdateAuthorizationRuleWithResponse( + Response deleteAuthorizationRuleWithResponse( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, - AuthorizationRuleInner parameters, Context context); /** @@ -177,7 +117,7 @@ void deleteAuthorizationRule( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); /** - * Deletes a WCF relay authorization rule. + * Get authorizationRule for a WCF relay by name. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name. @@ -187,9 +127,9 @@ void deleteAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 authorizationRule for a WCF relay by name along with {@link Response}. */ - Response deleteAuthorizationRuleWithResponse( + Response getAuthorizationRuleWithResponse( String resourceGroupName, String namespaceName, String relayName, @@ -212,7 +152,7 @@ AuthorizationRule getAuthorizationRule( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); /** - * Get authorizationRule for a WCF relay by name. + * Primary and secondary connection strings to the WCF relay. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param namespaceName The namespace name. @@ -222,9 +162,9 @@ AuthorizationRule getAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 namespace/Relay Connection String along with {@link Response}. */ - Response getAuthorizationRuleWithResponse( + Response listKeysWithResponse( String resourceGroupName, String namespaceName, String relayName, @@ -246,23 +186,25 @@ Response getAuthorizationRuleWithResponse( AccessKeys listKeys(String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName); /** - * Primary and secondary connection strings to the 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 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}. */ - Response listKeysWithResponse( + Response regenerateKeysWithResponse( String resourceGroupName, String namespaceName, String relayName, String authorizationRuleName, + RegenerateAccessKeyParameters parameters, Context context); /** @@ -286,26 +228,84 @@ AccessKeys regenerateKeys( RegenerateAccessKeyParameters parameters); /** - * 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 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}. + */ + 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}. + */ + PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); + + /** + * Deletes a WCF relay. * * @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 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 regenerateKeysWithResponse( - String resourceGroupName, - String namespaceName, - String relayName, - String authorizationRuleName, - RegenerateAccessKeyParameters parameters, - Context context); + Response deleteWithResponse( + String resourceGroupName, String namespaceName, String relayName, Context context); + + /** + * Deletes a WCF relay. + * + * @param resourceGroupName Name of the Resource group within the Azure subscription. + * @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. + */ + void delete(String resourceGroupName, String namespaceName, String relayName); + + /** + * 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 com.azure.core.management.exception.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}. + */ + Response getWithResponse( + String resourceGroupName, String namespaceName, String relayName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); /** * Returns the description for the specified WCF relay. 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/models/WcfRelaysListResult.java index 79e33eb4486c1..cdebeeb0ea0e1 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/models/WcfRelaysListResult.java @@ -19,12 +19,15 @@ public final class WcfRelaysListResult { private List value; /* - * Link to the next set of results. Not empty if value contains incomplete - * list of WCF relays. + * Link to the next set of results. Not empty if value contains incomplete list of WCF relays. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of WcfRelaysListResult class. */ + public WcfRelaysListResult() { + } + /** * Get the value property: Result of the list WCF relay operation. * 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 3f16bd43201a1..c2e7127723087 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 @@ -12,7 +12,7 @@ /** Samples for HybridConnections CreateOrUpdateAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 b261198f31096..169aa362581f3 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 @@ -7,7 +7,7 @@ /** Samples for HybridConnections CreateOrUpdate. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 5bcf63655c03c..4780d00768c92 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 @@ -9,14 +9,14 @@ /** Samples for HybridConnections DeleteAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionAuthorizationRuleDelete.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleDelete. + * Sample code: RelayHybridConnectionAuthorizationRuleDelete. * * @param manager Entry point to RelayManager. */ - public static void relayHybridConnectionAutorizationRuleDelete( + public static void relayHybridConnectionAuthorizationRuleDelete( com.azure.resourcemanager.relay.RelayManager manager) { manager .hybridConnections() 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 4a5a80d7e3080..3aab8be5107db 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 @@ -9,7 +9,7 @@ /** Samples for HybridConnections Delete. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 f805f9a974093..4b852972cc76b 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 @@ -9,14 +9,14 @@ /** Samples for HybridConnections GetAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( 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 1672059a9dc94..c25fe06bc1622 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 @@ -9,7 +9,7 @@ /** Samples for HybridConnections Get. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 1b7e7700e3f34..0e2e46599f484 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 @@ -9,14 +9,14 @@ /** Samples for HybridConnections ListAuthorizationRules. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionAuthorizationRuleListAll.json */ /** - * Sample code: RelayHybridConnectionAutorizationRuleListAll. + * Sample code: RelayHybridConnectionAuthorizationRuleListAll. * * @param manager Entry point to RelayManager. */ - public static void relayHybridConnectionAutorizationRuleListAll( + public static void relayHybridConnectionAuthorizationRuleListAll( com.azure.resourcemanager.relay.RelayManager manager) { manager .hybridConnections() 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 d536e32291b96..7792cdda1df38 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 @@ -9,7 +9,7 @@ /** Samples for HybridConnections ListByNamespace. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 d6eb510ef184e..2d703584bd373 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 @@ -9,7 +9,7 @@ /** Samples for HybridConnections ListKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 d1f5de8545ff2..f21cdac28e32f 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 @@ -11,14 +11,14 @@ /** Samples for HybridConnections RegenerateKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/HybridConnection/RelayHybridConnectionAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayHybridConnectionAuthorizationRuleRegenrateKey. + * Sample code: RelayHybridConnectionAuthorizationRuleRegenerateKey. * * @param manager Entry point to RelayManager. */ - public static void relayHybridConnectionAuthorizationRuleRegenrateKey( + public static void relayHybridConnectionAuthorizationRuleRegenerateKey( com.azure.resourcemanager.relay.RelayManager manager) { manager .hybridConnections() 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 2e9c7eb146618..c455aa84fa58b 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 @@ -10,7 +10,7 @@ /** Samples for Namespaces 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceCheckNameAvailability.json */ /** * Sample code: RelayCheckNameAvailability. @@ -20,6 +20,7 @@ public final class NamespacesCheckNameAvailabilitySamples { public static void relayCheckNameAvailability(com.azure.resourcemanager.relay.RelayManager manager) { manager .namespaces() - .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("sdk-Namespace1321"), Context.NONE); + .checkNameAvailabilityWithResponse( + new CheckNameAvailability().withName("example-RelayNamespace1321"), 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 9d7c3a1db5031..a9e1451a420e2 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 @@ -10,7 +10,7 @@ /** Samples for Namespaces CreateOrUpdateAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 0000000000000..322183dd3c27d --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java @@ -0,0 +1,42 @@ +// 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.generated; + +import com.azure.core.util.Context; +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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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() + .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))), + 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 53ecaf6e498e5..c11ee570a3531 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 @@ -5,6 +5,7 @@ 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 java.util.HashMap; import java.util.Map; @@ -12,7 +13,7 @@ /** Samples for Namespaces CreateOrUpdate. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceCreate.json */ /** * Sample code: RelayNamespaceCreate. @@ -22,11 +23,11 @@ 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)) .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 4213a2245b9e1..5879dcda04973 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 @@ -9,14 +9,14 @@ /** Samples for Namespaces DeleteAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( 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 5bee20aebd386..48e838a829b95 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 @@ -9,7 +9,7 @@ /** Samples for Namespaces Delete. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceDelete.json */ /** * Sample code: RelayNameSpaceDelete. @@ -17,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", Context.NONE); + manager.namespaces().delete("SouthCentralUS", "example-RelayNamespace-5849", 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 ed29752b8ca30..273c178dc5f86 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 @@ -9,14 +9,14 @@ /** Samples for Namespaces GetAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( 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 3c874a16cd319..2ff779e674f86 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 @@ -9,7 +9,7 @@ /** Samples for Namespaces GetByResourceGroup. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceGet.json */ /** * Sample code: RelayNameSpaceGet. @@ -17,6 +17,6 @@ public final class NamespacesGetByResourceGroupSamples { * @param manager Entry point to RelayManager. */ public static void relayNameSpaceGet(com.azure.resourcemanager.relay.RelayManager manager) { - manager.namespaces().getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", Context.NONE); + manager.namespaces().getByResourceGroupWithResponse("RG-eg", "example-RelayRelayNamespace-01", 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 0000000000000..dcebc27df0a29 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.relay.generated; + +import com.azure.core.util.Context; + +/** Samples for Namespaces GetNetworkRuleSet. */ +public final class NamespacesGetNetworkRuleSetSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", 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 4359c0a098ebd..b5b37889f5bef 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 @@ -9,14 +9,14 @@ /** Samples for Namespaces ListAuthorizationRules. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", 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 05700c73595d4..87c716a0d07cb 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 @@ -9,7 +9,7 @@ /** Samples for Namespaces ListByResourceGroup. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 90cae25758f17..c1255d66f27c0 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 @@ -9,7 +9,7 @@ /** Samples for Namespaces ListKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 fc99db6120ee9..0234b5122a0d1 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 @@ -9,7 +9,7 @@ /** Samples for Namespaces List. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 80757d77812c6..548942980c7b2 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 @@ -11,14 +11,14 @@ /** Samples for Namespaces RegenerateKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceAuthorizationRuleRegenerateKey.json */ /** - * Sample code: RelayNameSpaceAuthorizationRuleRegenrateKey. + * Sample code: RelayNameSpaceAuthorizationRuleRegenerateKey. * * @param manager Entry point to RelayManager. */ - public static void relayNameSpaceAuthorizationRuleRegenrateKey( + public static void relayNameSpaceAuthorizationRuleRegenerateKey( com.azure.resourcemanager.relay.RelayManager manager) { manager .namespaces() 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 c0ba5f9ae0699..52f38cc5b33d9 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 @@ -12,7 +12,7 @@ /** Samples for Namespaces Update. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceUpdate.json */ /** * Sample code: RelayNameSpaceUpdate. @@ -23,7 +23,7 @@ public static void relayNameSpaceUpdate(com.azure.resourcemanager.relay.RelayMan RelayNamespace resource = manager .namespaces() - .getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", Context.NONE) + .getByResourceGroupWithResponse("RG-eg", "example-RelayRelayNamespace-01", Context.NONE) .getValue(); resource .update() 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 c3a75164cca94..c65864c3f7ab6 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 @@ -9,7 +9,7 @@ /** Samples for Operations List. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 0000000000000..e222d8b6e9391 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// 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.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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 0000000000000..4e5f5f7680324 --- /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) AutoRest Code Generator. + +package com.azure.resourcemanager.relay.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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}", 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 0000000000000..10435c84288ba --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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}", 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 0000000000000..97ee08ad3ba8c --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", 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 0000000000000..235a820d26d4f --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/PrivateEndpointConnections/PrivateLinkResourcesGet.json + */ + /** + * Sample code: NameSpacePrivateEndPointConnectionGet. + * + * @param manager Entry point to RelayManager. + */ + public static void nameSpacePrivateEndPointConnectionGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .privateLinkResources() + .getWithResponse( + "resourcegroup", "example-RelayNamespace-5849", "{PrivateLinkResource name}", 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 0000000000000..c31fdcde3b1cc --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/PrivateLinkResourcesListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources List. */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", 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 0155a861195e2..b31d59c17378c 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 @@ -12,7 +12,7 @@ /** Samples for WcfRelays CreateOrUpdateAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 527db815eb62a..39b4c3ff306f4 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 @@ -9,7 +9,7 @@ /** Samples for WcfRelays CreateOrUpdate. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 fc85fb7971ac3..0ed4b32de4b8d 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 @@ -9,14 +9,14 @@ /** Samples for WcfRelays DeleteAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( 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 fd01219e3ca88..40c65a9e8429d 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 @@ -9,7 +9,7 @@ /** Samples for WcfRelays Delete. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 9c7c2c0f3f8e1..abe183b4a2f56 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 @@ -9,14 +9,14 @@ /** Samples for WcfRelays GetAuthorizationRule. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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( 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 64f2ed2e206eb..f793df10747d4 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 @@ -9,7 +9,7 @@ /** Samples for WcfRelays Get. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 19737f343e462..d0246969e7bf1 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 @@ -9,14 +9,14 @@ /** Samples for WcfRelays ListAuthorizationRules. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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", 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 bd0e7703b5499..0192d02fce007 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 @@ -9,7 +9,7 @@ /** Samples for WcfRelays ListByNamespace. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 fe398c1eeb139..6ec39ff0aed94 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 @@ -9,7 +9,7 @@ /** Samples for WcfRelays ListKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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 a4d4a362e9ac9..1fa6b66b7eeb9 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 @@ -11,14 +11,14 @@ /** Samples for WcfRelays RegenerateKeys. */ 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: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/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(