diff --git a/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md b/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md index 147f7a13a21a..4e0b625ef131 100644 --- a/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md +++ b/sdk/relay/azure-resourcemanager-relay/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-03-14) +- 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). ## 1.0.0-beta.1 (2020-12-18) diff --git a/sdk/relay/azure-resourcemanager-relay/README.md b/sdk/relay/azure-resourcemanager-relay/README.md index 065e213e9d43..68e57750f931 100644 --- a/sdk/relay/azure-resourcemanager-relay/README.md +++ b/sdk/relay/azure-resourcemanager-relay/README.md @@ -4,6 +4,20 @@ 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). +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + ## Getting started ### Prerequisites @@ -18,7 +32,7 @@ This package contains Microsoft Azure SDK for Relay Management SDK. Use these AP com.azure.resourcemanager azure-resourcemanager-relay - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -60,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/relay/azure-resourcemanager-relay/SAMPLE.md) + + ## Troubleshooting ## Next steps @@ -75,6 +92,8 @@ For details on contributing to this repository, see the [contributing guide](htt 1. Create new Pull Request +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/relay/azure-resourcemanager-relay/SAMPLE.md b/sdk/relay/azure-resourcemanager-relay/SAMPLE.md new file mode 100644 index 000000000000..e466aa6107ac --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/SAMPLE.md @@ -0,0 +1,945 @@ +# Code snippets and samples + + +## HybridConnections + +- [CreateOrUpdate](#hybridconnections_createorupdate) +- [CreateOrUpdateAuthorizationRule](#hybridconnections_createorupdateauthorizationrule) +- [Delete](#hybridconnections_delete) +- [DeleteAuthorizationRule](#hybridconnections_deleteauthorizationrule) +- [Get](#hybridconnections_get) +- [GetAuthorizationRule](#hybridconnections_getauthorizationrule) +- [ListAuthorizationRules](#hybridconnections_listauthorizationrules) +- [ListByNamespace](#hybridconnections_listbynamespace) +- [ListKeys](#hybridconnections_listkeys) +- [RegenerateKeys](#hybridconnections_regeneratekeys) + +## Namespaces + +- [CheckNameAvailability](#namespaces_checknameavailability) +- [CreateOrUpdate](#namespaces_createorupdate) +- [CreateOrUpdateAuthorizationRule](#namespaces_createorupdateauthorizationrule) +- [Delete](#namespaces_delete) +- [DeleteAuthorizationRule](#namespaces_deleteauthorizationrule) +- [GetAuthorizationRule](#namespaces_getauthorizationrule) +- [GetByResourceGroup](#namespaces_getbyresourcegroup) +- [List](#namespaces_list) +- [ListAuthorizationRules](#namespaces_listauthorizationrules) +- [ListByResourceGroup](#namespaces_listbyresourcegroup) +- [ListKeys](#namespaces_listkeys) +- [RegenerateKeys](#namespaces_regeneratekeys) +- [Update](#namespaces_update) + +## Operations + +- [List](#operations_list) + +## WcfRelays + +- [CreateOrUpdate](#wcfrelays_createorupdate) +- [CreateOrUpdateAuthorizationRule](#wcfrelays_createorupdateauthorizationrule) +- [Delete](#wcfrelays_delete) +- [DeleteAuthorizationRule](#wcfrelays_deleteauthorizationrule) +- [Get](#wcfrelays_get) +- [GetAuthorizationRule](#wcfrelays_getauthorizationrule) +- [ListAuthorizationRules](#wcfrelays_listauthorizationrules) +- [ListByNamespace](#wcfrelays_listbynamespace) +- [ListKeys](#wcfrelays_listkeys) +- [RegenerateKeys](#wcfrelays_regeneratekeys) +### HybridConnections_CreateOrUpdate + +```java +/** 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 + */ + /** + * Sample code: RelayHybridConnectionCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .define("example-Relay-Hybrid-01") + .withExistingNamespace("resourcegroup", "example-RelayNamespace-01") + .withRequiresClientAuthorization(true) + .create(); + } +} +``` + +### HybridConnections_CreateOrUpdateAuthorizationRule + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.relay.models.AccessRights; +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 + */ + /** + * Sample code: RelayHybridConnectionAuthorizationRuleCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAuthorizationRuleCreate( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .createOrUpdateAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} +``` + +### HybridConnections_Delete + +```java +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 + */ + /** + * Sample code: RelayHybridconnectionDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridconnectionDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .deleteWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", Context.NONE); + } +} +``` + +### HybridConnections_DeleteAuthorizationRule + +```java +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 + */ + /** + * Sample code: RelayHybridConnectionAutorizationRuleDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAutorizationRuleDelete( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .deleteAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} +``` + +### HybridConnections_Get + +```java +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 + */ + /** + * Sample code: RelayHybridConnectionGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .getWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", Context.NONE); + } +} +``` + +### HybridConnections_GetAuthorizationRule + +```java +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 + */ + /** + * Sample code: RelayHybridConnectionAutorizationRuleGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .getAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} +``` + +### HybridConnections_ListAuthorizationRules + +```java +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 + */ + /** + * Sample code: RelayHybridConnectionAutorizationRuleListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAutorizationRuleListAll( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .listAuthorizationRules( + "resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", Context.NONE); + } +} +``` + +### HybridConnections_ListByNamespace + +```java +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 + */ + /** + * Sample code: RelayHybridConnectionListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionListAll(com.azure.resourcemanager.relay.RelayManager manager) { + manager.hybridConnections().listByNamespace("resourcegroup", "example-RelayNamespace-01", Context.NONE); + } +} +``` + +### HybridConnections_ListKeys + +```java +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 + */ + /** + * Sample code: RelayHybridConnectionAuthorizationRuleListKey. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAuthorizationRuleListKey( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .listKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} +``` + +### HybridConnections_RegenerateKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.models.KeyType; +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 + */ + /** + * Sample code: RelayHybridConnectionAuthorizationRuleRegenrateKey. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAuthorizationRuleRegenrateKey( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .regenerateKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} +``` + +### Namespaces_CheckNameAvailability + +```java +import com.azure.core.util.Context; +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 + */ + /** + * Sample code: RelayCheckNameAvailability. + * + * @param manager Entry point to RelayManager. + */ + public static void relayCheckNameAvailability(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("sdk-Namespace1321"), Context.NONE); + } +} +``` + +### Namespaces_CreateOrUpdate + +```java +import com.azure.resourcemanager.relay.models.Sku; +import com.azure.resourcemanager.relay.models.SkuTier; +import java.util.HashMap; +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 + */ + /** + * Sample code: RelayNamespaceCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNamespaceCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .define("example-RelayNamespace-01") + .withRegion("West US") + .withExistingResourceGroup("resourcegroup") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withSku(new Sku().withTier(SkuTier.STANDARD)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Namespaces_CreateOrUpdateAuthorizationRule + +```java +import com.azure.resourcemanager.relay.models.AccessRights; +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 + */ + /** + * Sample code: RelayNameSpaceAuthorizationRuleCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAuthorizationRuleCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .defineAuthorizationRule("example-RelayAuthRules-01") + .withExistingNamespace("resourcegroup", "example-RelayNamespace-01") + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)) + .create(); + } +} +``` + +### Namespaces_Delete + +```java +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 + */ + /** + * Sample code: RelayNameSpaceDelete. + * + * @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); + } +} +``` + +### Namespaces_DeleteAuthorizationRule + +```java +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 + */ + /** + * Sample code: RelayNameSpaceAutorizationRuleDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .deleteAuthorizationRuleWithResponse( + "resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", Context.NONE); + } +} +``` + +### Namespaces_GetAuthorizationRule + +```java +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 + */ + /** + * Sample code: RelayNameSpaceAutorizationRuleGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .getAuthorizationRuleWithResponse( + "resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", Context.NONE); + } +} +``` + +### Namespaces_GetByResourceGroup + +```java +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 + */ + /** + * Sample code: RelayNameSpaceGet. + * + * @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); + } +} +``` + +### Namespaces_List + +```java +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 + */ + /** + * Sample code: RelayNameSpaceListBySubscription. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceListBySubscription(com.azure.resourcemanager.relay.RelayManager manager) { + manager.namespaces().list(Context.NONE); + } +} +``` + +### Namespaces_ListAuthorizationRules + +```java +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 + */ + /** + * Sample code: RelayNameSpaceAutorizationRuleListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAutorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { + manager.namespaces().listAuthorizationRules("resourcegroup", "example-RelayNamespace-01", Context.NONE); + } +} +``` + +### Namespaces_ListByResourceGroup + +```java +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 + */ + /** + * Sample code: RelayNameSpaceListByResourceGroup. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceListByResourceGroup(com.azure.resourcemanager.relay.RelayManager manager) { + manager.namespaces().listByResourceGroup("resourcegroup", Context.NONE); + } +} +``` + +### Namespaces_ListKeys + +```java +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 + */ + /** + * Sample code: RelayNameSpaceAuthorizationRuleListKey. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAuthorizationRuleListKey(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .listKeysWithResponse( + "resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", Context.NONE); + } +} +``` + +### Namespaces_RegenerateKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.models.KeyType; +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 + */ + /** + * Sample code: RelayNameSpaceAuthorizationRuleRegenrateKey. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAuthorizationRuleRegenrateKey( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .regenerateKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-RelayAuthRules-01", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} +``` + +### Namespaces_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.models.RelayNamespace; +import java.util.HashMap; +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 + */ + /** + * Sample code: RelayNameSpaceUpdate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceUpdate(com.azure.resourcemanager.relay.RelayManager manager) { + RelayNamespace resource = + manager + .namespaces() + .getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("tag3", "value3", "tag4", "value4", "tag5", "value5", "tag6", "value6")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +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 + */ + /** + * Sample code: RelayOperationsList. + * + * @param manager Entry point to RelayManager. + */ + public static void relayOperationsList(com.azure.resourcemanager.relay.RelayManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### WcfRelays_CreateOrUpdate + +```java +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 + */ + /** + * Sample code: RelayCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .define("example-Relay-Wcf-1194") + .withExistingNamespace("resourcegroup", "example-RelayNamespace-9953") + .withRelayType(Relaytype.NET_TCP) + .withRequiresClientAuthorization(true) + .withRequiresTransportSecurity(true) + .create(); + } +} +``` + +### WcfRelays_CreateOrUpdateAuthorizationRule + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.relay.models.AccessRights; +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 + */ + /** + * Sample code: RelayAuthorizationRuleCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAuthorizationRuleCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .createOrUpdateAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} +``` + +### WcfRelays_Delete + +```java +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 + */ + /** + * Sample code: RelayDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .deleteWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-wcf-01", Context.NONE); + } +} +``` + +### WcfRelays_DeleteAuthorizationRule + +```java +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 + */ + /** + * Sample code: RelayAutorizationRuleDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .deleteAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} +``` + +### WcfRelays_Get + +```java +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 + */ + /** + * Sample code: RelayGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .getWithResponse("resourcegroup", "example-RelayNamespace-9953", "example-Relay-Wcf-1194", Context.NONE); + } +} +``` + +### WcfRelays_GetAuthorizationRule + +```java +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 + */ + /** + * Sample code: RelayAutorizationRuleGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .getAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} +``` + +### WcfRelays_ListAuthorizationRules + +```java +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 + */ + /** + * Sample code: RelayAutorizationRuleListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAutorizationRuleListAll(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .listAuthorizationRules("resourcegroup", "example-RelayNamespace-01", "example-Relay-Wcf-01", Context.NONE); + } +} +``` + +### WcfRelays_ListByNamespace + +```java +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 + */ + /** + * Sample code: RelayListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayListAll(com.azure.resourcemanager.relay.RelayManager manager) { + manager.wcfRelays().listByNamespace("resourcegroup", "example-RelayNamespace-01", Context.NONE); + } +} +``` + +### WcfRelays_ListKeys + +```java +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 + */ + /** + * Sample code: RelayAuthorizationRuleListKey.json. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAuthorizationRuleListKeyJson(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .listKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} +``` + +### WcfRelays_RegenerateKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.models.KeyType; +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 + */ + /** + * Sample code: RelayAuthorizationRuleRegenrateKey.json. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAuthorizationRuleRegenrateKeyJson(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .regenerateKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} +``` + diff --git a/sdk/relay/azure-resourcemanager-relay/pom.xml b/sdk/relay/azure-resourcemanager-relay/pom.xml index 0908b07d6be0..c53e8f5abcb7 100644 --- a/sdk/relay/azure-resourcemanager-relay/pom.xml +++ b/sdk/relay/azure-resourcemanager-relay/pom.xml @@ -1,50 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-relay - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-relay + 1.0.0-beta.2 + jar - Microsoft Azure SDK for Relay Management - 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 https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java + 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. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core-management - 1.5.3 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.26.0 + + + com.azure + azure-core-management + 1.5.3 + + 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 5e40fa85401f..1158cedccc89 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 @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -35,6 +36,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to RelayManager. Use these API to manage Azure Relay resources through Azure Resource Manager. */ public final class RelayManager { @@ -84,11 +86,12 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -128,6 +131,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -146,9 +160,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -164,25 +180,53 @@ public RelayManager authenticate(TokenCredential credential, AzureProfile profil Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.relay") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); - policies - .add( - new UserAgentPolicy( - null, - "com.azure.resourcemanager.relay", - "1.0.0-beta.1", - Configuration.getGlobalConfiguration())); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = 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 6a1b5770be1a..df616e9f65c1 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 @@ -24,7 +24,7 @@ public interface HybridConnectionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the list hybrid connection operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByNamespace(String resourceGroupName, String namespaceName); @@ -38,7 +38,7 @@ public interface HybridConnectionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the list hybrid connection operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByNamespace( @@ -71,7 +71,7 @@ HybridConnectionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -104,7 +104,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -134,7 +134,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -149,7 +149,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules( @@ -165,7 +165,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 the response from the list namespace operation. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules( @@ -204,7 +204,7 @@ AuthorizationRuleInner createOrUpdateAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateAuthorizationRuleWithResponse( @@ -241,7 +241,7 @@ 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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteAuthorizationRuleWithResponse( @@ -278,7 +278,7 @@ AuthorizationRuleInner 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. + * @return description of a namespace authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAuthorizationRuleWithResponse( @@ -315,7 +315,7 @@ AccessKeysInner listKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listKeysWithResponse( @@ -358,7 +358,7 @@ AccessKeysInner regenerateKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response regenerateKeysWithResponse( 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 db806011809e..b44498cc3720 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 @@ -41,7 +41,7 @@ public interface NamespacesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of the check name availability request properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkNameAvailabilityWithResponse( @@ -52,7 +52,7 @@ Response checkNameAvailabilityWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -64,7 +64,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -76,7 +76,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -89,7 +89,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -103,9 +103,9 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( String resourceGroupName, String namespaceName, RelayNamespaceInner parameters); @@ -119,9 +119,9 @@ SyncPoller, RelayNamespaceInner> beginCreateOrUp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context); @@ -163,9 +163,9 @@ RelayNamespaceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName); /** @@ -177,9 +177,9 @@ RelayNamespaceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, Context context); /** @@ -229,7 +229,7 @@ RelayNamespaceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of a namespace resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -261,7 +261,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of a namespace resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -275,7 +275,7 @@ 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); @@ -289,7 +289,7 @@ 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules( @@ -325,7 +325,7 @@ AuthorizationRuleInner createOrUpdateAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateAuthorizationRuleWithResponse( @@ -358,7 +358,7 @@ Response createOrUpdateAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteAuthorizationRuleWithResponse( @@ -389,7 +389,7 @@ AuthorizationRuleInner 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. + * @return description of a namespace authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAuthorizationRuleWithResponse( @@ -419,7 +419,7 @@ Response getAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listKeysWithResponse( @@ -455,7 +455,7 @@ AccessKeysInner regenerateKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response regenerateKeysWithResponse( diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/OperationsClient.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/OperationsClient.java index 6c98d1e944ad..4cdbe0a2c157 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/OperationsClient.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/WcfRelaysClient.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/WcfRelaysClient.java index b46371aea26e..bd3bbf3e97f8 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 @@ -24,7 +24,7 @@ public interface WcfRelaysClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the list WCF relay operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByNamespace(String resourceGroupName, String namespaceName); @@ -38,7 +38,7 @@ public interface WcfRelaysClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the list WCF relay operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); @@ -70,7 +70,7 @@ WcfRelayInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -99,7 +99,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -129,7 +129,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -144,7 +144,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules( @@ -160,7 +160,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 the response from the list namespace operation. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAuthorizationRules( @@ -199,7 +199,7 @@ AuthorizationRuleInner createOrUpdateAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateAuthorizationRuleWithResponse( @@ -236,7 +236,7 @@ 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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteAuthorizationRuleWithResponse( @@ -273,7 +273,7 @@ AuthorizationRuleInner 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. + * @return authorizationRule for a WCF relay by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAuthorizationRuleWithResponse( @@ -310,7 +310,7 @@ AccessKeysInner listKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listKeysWithResponse( @@ -353,7 +353,7 @@ AccessKeysInner regenerateKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response regenerateKeysWithResponse( 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 f710dbd24806..354546e2c689 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Namespace/Relay Connection String. */ @Fluent public final class AccessKeysInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessKeysInner.class); - /* * 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 8465be445750..efdf3c39ac05 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 @@ -5,25 +5,29 @@ package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.models.AccessRights; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Description of a namespace authorization rule. */ -@JsonFlatten @Fluent -public class AuthorizationRuleInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationRuleInner.class); - +public final class AuthorizationRuleInner extends ProxyResource { /* - * The rights associated with the rule. + * Authorization rule properties. + */ + @JsonProperty(value = "properties", required = true) + private AuthorizationRuleProperties innerProperties = new AuthorizationRuleProperties(); + + /** + * Get the innerProperties property: Authorization rule properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.rights", required = true) - private List rights; + private AuthorizationRuleProperties innerProperties() { + return this.innerProperties; + } /** * Get the rights property: The rights associated with the rule. @@ -31,7 +35,7 @@ public class AuthorizationRuleInner extends ProxyResource { * @return the rights value. */ public List rights() { - return this.rights; + return this.innerProperties() == null ? null : this.innerProperties().rights(); } /** @@ -41,7 +45,10 @@ public List rights() { * @return the AuthorizationRuleInner object itself. */ public AuthorizationRuleInner withRights(List rights) { - this.rights = rights; + if (this.innerProperties() == null) { + this.innerProperties = new AuthorizationRuleProperties(); + } + this.innerProperties().withRights(rights); return this; } @@ -51,10 +58,15 @@ public AuthorizationRuleInner withRights(List rights) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (rights() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( - new IllegalArgumentException("Missing required property rights in model AuthorizationRuleInner")); + new IllegalArgumentException( + "Missing required property innerProperties in model AuthorizationRuleInner")); + } else { + 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 new file mode 100644 index 000000000000..5c412461d85c --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/AuthorizationRuleProperties.java @@ -0,0 +1,57 @@ +// 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.util.logging.ClientLogger; +import com.azure.resourcemanager.relay.models.AccessRights; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Authorization rule properties. */ +@Fluent +public final class AuthorizationRuleProperties { + /* + * The rights associated with the rule. + */ + @JsonProperty(value = "rights", required = true) + private List rights; + + /** + * Get the rights property: The rights associated with the rule. + * + * @return the rights value. + */ + public List rights() { + return this.rights; + } + + /** + * Set the rights property: The rights associated with the rule. + * + * @param rights the rights value to set. + * @return the AuthorizationRuleProperties object itself. + */ + public AuthorizationRuleProperties withRights(List rights) { + this.rights = rights; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rights() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rights in model AuthorizationRuleProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AuthorizationRuleProperties.class); +} 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 ebbe8c9970e1..312d10400b3d 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 @@ -5,16 +5,12 @@ package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.models.UnavailableReason; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Description of the check name availability request properties. */ @Fluent public final class CheckNameAvailabilityResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); - /* * 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 ee69f7af73ce..5040b3c9fa06 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 @@ -5,53 +5,27 @@ package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Description of hybrid connection resource. */ -@JsonFlatten @Fluent -public class HybridConnectionInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionInner.class); - - /* - * The time the hybrid connection was created. - */ - @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdAt; - +public final class HybridConnectionInner extends ProxyResource { /* - * The time the namespace was updated. + * Properties of the HybridConnection. */ - @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime updatedAt; + @JsonProperty(value = "properties") + private HybridConnectionProperties innerProperties; - /* - * The number of listeners for this hybrid connection. Note that min : 1 - * and max:25 are supported. - */ - @JsonProperty(value = "properties.listenerCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer listenerCount; - - /* - * Returns true if client authorization is needed for this hybrid - * connection; otherwise, false. - */ - @JsonProperty(value = "properties.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. + /** + * Get the innerProperties property: Properties of the HybridConnection. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.userMetadata") - private String userMetadata; + private HybridConnectionProperties innerProperties() { + return this.innerProperties; + } /** * Get the createdAt property: The time the hybrid connection was created. @@ -59,7 +33,7 @@ public class HybridConnectionInner extends ProxyResource { * @return the createdAt value. */ public OffsetDateTime createdAt() { - return this.createdAt; + return this.innerProperties() == null ? null : this.innerProperties().createdAt(); } /** @@ -68,7 +42,7 @@ public OffsetDateTime createdAt() { * @return the updatedAt value. */ public OffsetDateTime updatedAt() { - return this.updatedAt; + return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); } /** @@ -78,7 +52,7 @@ public OffsetDateTime updatedAt() { * @return the listenerCount value. */ public Integer listenerCount() { - return this.listenerCount; + return this.innerProperties() == null ? null : this.innerProperties().listenerCount(); } /** @@ -88,7 +62,7 @@ public Integer listenerCount() { * @return the requiresClientAuthorization value. */ public Boolean requiresClientAuthorization() { - return this.requiresClientAuthorization; + return this.innerProperties() == null ? null : this.innerProperties().requiresClientAuthorization(); } /** @@ -99,7 +73,10 @@ public Boolean requiresClientAuthorization() { * @return the HybridConnectionInner object itself. */ public HybridConnectionInner withRequiresClientAuthorization(Boolean requiresClientAuthorization) { - this.requiresClientAuthorization = requiresClientAuthorization; + if (this.innerProperties() == null) { + this.innerProperties = new HybridConnectionProperties(); + } + this.innerProperties().withRequiresClientAuthorization(requiresClientAuthorization); return this; } @@ -111,7 +88,7 @@ public HybridConnectionInner withRequiresClientAuthorization(Boolean requiresCli * @return the userMetadata value. */ public String userMetadata() { - return this.userMetadata; + return this.innerProperties() == null ? null : this.innerProperties().userMetadata(); } /** @@ -123,7 +100,10 @@ public String userMetadata() { * @return the HybridConnectionInner object itself. */ public HybridConnectionInner withUserMetadata(String userMetadata) { - this.userMetadata = userMetadata; + if (this.innerProperties() == null) { + this.innerProperties = new HybridConnectionProperties(); + } + this.innerProperties().withUserMetadata(userMetadata); return this; } @@ -133,5 +113,8 @@ public HybridConnectionInner withUserMetadata(String userMetadata) { * @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/HybridConnectionProperties.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionProperties.java new file mode 100644 index 000000000000..cb5361f3763b --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/HybridConnectionProperties.java @@ -0,0 +1,130 @@ +// 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.time.OffsetDateTime; + +/** Properties of the HybridConnection. */ +@Fluent +public final class HybridConnectionProperties { + /* + * The time the hybrid connection was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * The time the namespace was updated. + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAt; + + /* + * 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. + */ + @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. + */ + @JsonProperty(value = "userMetadata") + private String userMetadata; + + /** + * Get the createdAt property: The time the hybrid connection was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The time the namespace was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the listenerCount property: The number of listeners for this hybrid connection. Note that min : 1 and max:25 + * are supported. + * + * @return the listenerCount value. + */ + public Integer listenerCount() { + return this.listenerCount; + } + + /** + * Get the requiresClientAuthorization property: Returns true if client authorization is needed for this hybrid + * connection; otherwise, false. + * + * @return the requiresClientAuthorization value. + */ + public Boolean requiresClientAuthorization() { + return this.requiresClientAuthorization; + } + + /** + * Set the requiresClientAuthorization property: Returns true if client authorization is needed for this hybrid + * connection; otherwise, false. + * + * @param requiresClientAuthorization the requiresClientAuthorization value to set. + * @return the HybridConnectionProperties object itself. + */ + public HybridConnectionProperties withRequiresClientAuthorization(Boolean requiresClientAuthorization) { + this.requiresClientAuthorization = requiresClientAuthorization; + return this; + } + + /** + * Get the userMetadata property: 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. + * + * @return the userMetadata value. + */ + public String userMetadata() { + return this.userMetadata; + } + + /** + * Set the userMetadata property: 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. + * + * @param userMetadata the userMetadata value to set. + * @return the HybridConnectionProperties object itself. + */ + public HybridConnectionProperties withUserMetadata(String userMetadata) { + this.userMetadata = userMetadata; + 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/OperationInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/OperationInner.java index c9fc6467027b..500eef1a0f43 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 @@ -5,16 +5,12 @@ package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A Relay REST API operation. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * Operation name: {provider}/{resource}/{operation} */ 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 fde6b4c20b95..b8994d70ec69 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 @@ -5,22 +5,16 @@ package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.models.ProvisioningStateEnum; import com.azure.resourcemanager.relay.models.Sku; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; /** Description of a namespace resource. */ -@JsonFlatten @Fluent -public class RelayNamespaceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RelayNamespaceInner.class); - +public final class RelayNamespaceInner extends Resource { /* * SKU of the namespace. */ @@ -28,34 +22,10 @@ public class RelayNamespaceInner extends Resource { private Sku sku; /* - * The provisioningState property. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningStateEnum provisioningState; - - /* - * The time the namespace was created. - */ - @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdAt; - - /* - * The time the namespace was updated. - */ - @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime updatedAt; - - /* - * Endpoint you can use to perform Service Bus operations. - */ - @JsonProperty(value = "properties.serviceBusEndpoint", access = JsonProperty.Access.WRITE_ONLY) - private String serviceBusEndpoint; - - /* - * Identifier for Azure Insights metrics. + * Description of Relay namespace */ - @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) - private String metricId; + @JsonProperty(value = "properties") + private RelayNamespaceProperties innerProperties; /** * Get the sku property: SKU of the namespace. @@ -77,13 +47,36 @@ public RelayNamespaceInner withSku(Sku sku) { return this; } + /** + * Get the innerProperties property: Description of Relay namespace. + * + * @return the innerProperties value. + */ + private RelayNamespaceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public RelayNamespaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RelayNamespaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the provisioningState property: The provisioningState property. * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -92,7 +85,7 @@ public ProvisioningStateEnum provisioningState() { * @return the createdAt value. */ public OffsetDateTime createdAt() { - return this.createdAt; + return this.innerProperties() == null ? null : this.innerProperties().createdAt(); } /** @@ -101,7 +94,7 @@ public OffsetDateTime createdAt() { * @return the updatedAt value. */ public OffsetDateTime updatedAt() { - return this.updatedAt; + return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); } /** @@ -110,7 +103,7 @@ public OffsetDateTime updatedAt() { * @return the serviceBusEndpoint value. */ public String serviceBusEndpoint() { - return this.serviceBusEndpoint; + return this.innerProperties() == null ? null : this.innerProperties().serviceBusEndpoint(); } /** @@ -119,21 +112,7 @@ public String serviceBusEndpoint() { * @return the metricId value. */ public String metricId() { - return this.metricId; - } - - /** {@inheritDoc} */ - @Override - public RelayNamespaceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public RelayNamespaceInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().metricId(); } /** @@ -145,5 +124,8 @@ public void validate() { if (sku() != null) { sku().validate(); } + if (innerProperties() != null) { + innerProperties().validate(); + } } } 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 new file mode 100644 index 000000000000..fe0d6148361d --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/RelayNamespaceProperties.java @@ -0,0 +1,97 @@ +// 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.Immutable; +import com.azure.resourcemanager.relay.models.ProvisioningStateEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of the namespace. */ +@Immutable +public final class RelayNamespaceProperties { + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStateEnum provisioningState; + + /* + * The time the namespace was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * The time the namespace was updated. + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAt; + + /* + * Endpoint you can use to perform Service Bus operations. + */ + @JsonProperty(value = "serviceBusEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceBusEndpoint; + + /* + * Identifier for Azure Insights metrics. + */ + @JsonProperty(value = "metricId", access = JsonProperty.Access.WRITE_ONLY) + private String metricId; + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdAt property: The time the namespace was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The time the namespace was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations. + * + * @return the serviceBusEndpoint value. + */ + public String serviceBusEndpoint() { + return this.serviceBusEndpoint; + } + + /** + * Get the metricId property: Identifier for Azure Insights metrics. + * + * @return the metricId value. + */ + public String metricId() { + return this.metricId; + } + + /** + * 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/WcfRelayInner.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayInner.java index c7375f4901c6..5d528a9786d5 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 @@ -5,73 +5,28 @@ package com.azure.resourcemanager.relay.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.models.Relaytype; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Description of the WCF relay resource. */ -@JsonFlatten @Fluent -public class WcfRelayInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WcfRelayInner.class); - - /* - * Returns true if the relay is dynamic; otherwise, false. - */ - @JsonProperty(value = "properties.isDynamic", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDynamic; - - /* - * The time the WCF relay was created. - */ - @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdAt; - +public final class WcfRelayInner extends ProxyResource { /* - * The time the namespace was updated. + * Properties of the WCF relay. */ - @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime updatedAt; + @JsonProperty(value = "properties") + private WcfRelayProperties innerProperties; - /* - * The number of listeners for this relay. Note that min :1 and max:25 are - * supported. - */ - @JsonProperty(value = "properties.listenerCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer listenerCount; - - /* - * WCF relay type. - */ - @JsonProperty(value = "properties.relayType") - private Relaytype relayType; - - /* - * Returns true if client authorization is needed for this relay; - * otherwise, false. - */ - @JsonProperty(value = "properties.requiresClientAuthorization") - private Boolean requiresClientAuthorization; - - /* - * Returns true if transport security is needed for this relay; otherwise, - * false. - */ - @JsonProperty(value = "properties.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. + /** + * Get the innerProperties property: Properties of the WCF relay. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.userMetadata") - private String userMetadata; + private WcfRelayProperties innerProperties() { + return this.innerProperties; + } /** * Get the isDynamic property: Returns true if the relay is dynamic; otherwise, false. @@ -79,7 +34,7 @@ public class WcfRelayInner extends ProxyResource { * @return the isDynamic value. */ public Boolean isDynamic() { - return this.isDynamic; + return this.innerProperties() == null ? null : this.innerProperties().isDynamic(); } /** @@ -88,7 +43,7 @@ public Boolean isDynamic() { * @return the createdAt value. */ public OffsetDateTime createdAt() { - return this.createdAt; + return this.innerProperties() == null ? null : this.innerProperties().createdAt(); } /** @@ -97,7 +52,7 @@ public OffsetDateTime createdAt() { * @return the updatedAt value. */ public OffsetDateTime updatedAt() { - return this.updatedAt; + return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); } /** @@ -107,7 +62,7 @@ public OffsetDateTime updatedAt() { * @return the listenerCount value. */ public Integer listenerCount() { - return this.listenerCount; + return this.innerProperties() == null ? null : this.innerProperties().listenerCount(); } /** @@ -116,7 +71,7 @@ public Integer listenerCount() { * @return the relayType value. */ public Relaytype relayType() { - return this.relayType; + return this.innerProperties() == null ? null : this.innerProperties().relayType(); } /** @@ -126,7 +81,10 @@ public Relaytype relayType() { * @return the WcfRelayInner object itself. */ public WcfRelayInner withRelayType(Relaytype relayType) { - this.relayType = relayType; + if (this.innerProperties() == null) { + this.innerProperties = new WcfRelayProperties(); + } + this.innerProperties().withRelayType(relayType); return this; } @@ -137,7 +95,7 @@ public WcfRelayInner withRelayType(Relaytype relayType) { * @return the requiresClientAuthorization value. */ public Boolean requiresClientAuthorization() { - return this.requiresClientAuthorization; + return this.innerProperties() == null ? null : this.innerProperties().requiresClientAuthorization(); } /** @@ -148,7 +106,10 @@ public Boolean requiresClientAuthorization() { * @return the WcfRelayInner object itself. */ public WcfRelayInner withRequiresClientAuthorization(Boolean requiresClientAuthorization) { - this.requiresClientAuthorization = requiresClientAuthorization; + if (this.innerProperties() == null) { + this.innerProperties = new WcfRelayProperties(); + } + this.innerProperties().withRequiresClientAuthorization(requiresClientAuthorization); return this; } @@ -159,7 +120,7 @@ public WcfRelayInner withRequiresClientAuthorization(Boolean requiresClientAutho * @return the requiresTransportSecurity value. */ public Boolean requiresTransportSecurity() { - return this.requiresTransportSecurity; + return this.innerProperties() == null ? null : this.innerProperties().requiresTransportSecurity(); } /** @@ -170,7 +131,10 @@ public Boolean requiresTransportSecurity() { * @return the WcfRelayInner object itself. */ public WcfRelayInner withRequiresTransportSecurity(Boolean requiresTransportSecurity) { - this.requiresTransportSecurity = requiresTransportSecurity; + if (this.innerProperties() == null) { + this.innerProperties = new WcfRelayProperties(); + } + this.innerProperties().withRequiresTransportSecurity(requiresTransportSecurity); return this; } @@ -182,7 +146,7 @@ public WcfRelayInner withRequiresTransportSecurity(Boolean requiresTransportSecu * @return the userMetadata value. */ public String userMetadata() { - return this.userMetadata; + return this.innerProperties() == null ? null : this.innerProperties().userMetadata(); } /** @@ -194,7 +158,10 @@ public String userMetadata() { * @return the WcfRelayInner object itself. */ public WcfRelayInner withUserMetadata(String userMetadata) { - this.userMetadata = userMetadata; + if (this.innerProperties() == null) { + this.innerProperties = new WcfRelayProperties(); + } + this.innerProperties().withUserMetadata(userMetadata); return this; } @@ -204,5 +171,8 @@ public WcfRelayInner withUserMetadata(String userMetadata) { * @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/WcfRelayProperties.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayProperties.java new file mode 100644 index 000000000000..6d130c8a0dc0 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/fluent/models/WcfRelayProperties.java @@ -0,0 +1,201 @@ +// 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.Relaytype; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of the WCF relay. */ +@Fluent +public final class WcfRelayProperties { + /* + * Returns true if the relay is dynamic; otherwise, false. + */ + @JsonProperty(value = "isDynamic", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDynamic; + + /* + * The time the WCF relay was created. + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAt; + + /* + * The time the namespace was updated. + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedAt; + + /* + * 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; + + /* + * WCF relay type. + */ + @JsonProperty(value = "relayType") + private Relaytype relayType; + + /* + * 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. + */ + @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. + */ + @JsonProperty(value = "userMetadata") + private String userMetadata; + + /** + * Get the isDynamic property: Returns true if the relay is dynamic; otherwise, false. + * + * @return the isDynamic value. + */ + public Boolean isDynamic() { + return this.isDynamic; + } + + /** + * Get the createdAt property: The time the WCF relay was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: The time the namespace was updated. + * + * @return the updatedAt value. + */ + public OffsetDateTime updatedAt() { + return this.updatedAt; + } + + /** + * Get the listenerCount property: The number of listeners for this relay. Note that min :1 and max:25 are + * supported. + * + * @return the listenerCount value. + */ + public Integer listenerCount() { + return this.listenerCount; + } + + /** + * Get the relayType property: WCF relay type. + * + * @return the relayType value. + */ + public Relaytype relayType() { + return this.relayType; + } + + /** + * Set the relayType property: WCF relay type. + * + * @param relayType the relayType value to set. + * @return the WcfRelayProperties object itself. + */ + public WcfRelayProperties withRelayType(Relaytype relayType) { + this.relayType = relayType; + return this; + } + + /** + * Get the requiresClientAuthorization property: Returns true if client authorization is needed for this relay; + * otherwise, false. + * + * @return the requiresClientAuthorization value. + */ + public Boolean requiresClientAuthorization() { + return this.requiresClientAuthorization; + } + + /** + * Set the requiresClientAuthorization property: Returns true if client authorization is needed for this relay; + * otherwise, false. + * + * @param requiresClientAuthorization the requiresClientAuthorization value to set. + * @return the WcfRelayProperties object itself. + */ + public WcfRelayProperties withRequiresClientAuthorization(Boolean requiresClientAuthorization) { + this.requiresClientAuthorization = requiresClientAuthorization; + return this; + } + + /** + * Get the requiresTransportSecurity property: Returns true if transport security is needed for this relay; + * otherwise, false. + * + * @return the requiresTransportSecurity value. + */ + public Boolean requiresTransportSecurity() { + return this.requiresTransportSecurity; + } + + /** + * Set the requiresTransportSecurity property: Returns true if transport security is needed for this relay; + * otherwise, false. + * + * @param requiresTransportSecurity the requiresTransportSecurity value to set. + * @return the WcfRelayProperties object itself. + */ + public WcfRelayProperties withRequiresTransportSecurity(Boolean requiresTransportSecurity) { + this.requiresTransportSecurity = requiresTransportSecurity; + return this; + } + + /** + * Get the userMetadata property: 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. + * + * @return the userMetadata value. + */ + public String userMetadata() { + return this.userMetadata; + } + + /** + * Set the userMetadata property: 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. + * + * @param userMetadata the userMetadata value to set. + * @return the WcfRelayProperties object itself. + */ + public WcfRelayProperties withUserMetadata(String userMetadata) { + this.userMetadata = userMetadata; + 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/implementation/AccessKeysImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AccessKeysImpl.java index 4bd253cb0628..d28735428fe6 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AccessKeysImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AccessKeysImpl.java @@ -4,16 +4,15 @@ package com.azure.resourcemanager.relay.implementation; -import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.models.AccessKeys; public final class AccessKeysImpl implements AccessKeys { private AccessKeysInner innerObject; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; - AccessKeysImpl(AccessKeysInner innerObject, RelayManager serviceManager) { + AccessKeysImpl(AccessKeysInner innerObject, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -42,7 +41,7 @@ public AccessKeysInner innerModel() { return this.innerObject; } - private RelayManager manager() { + 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/AuthorizationRuleImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/AuthorizationRuleImpl.java index 7b97159490c4..ba7fdbb10081 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 @@ -4,11 +4,13 @@ package com.azure.resourcemanager.relay.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.relay.models.AccessKeys; import com.azure.resourcemanager.relay.models.AccessRights; import com.azure.resourcemanager.relay.models.AuthorizationRule; +import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; import java.util.Collections; import java.util.List; @@ -16,7 +18,7 @@ public final class AuthorizationRuleImpl implements AuthorizationRule, AuthorizationRule.Definition, AuthorizationRule.Update { private AuthorizationRuleInner innerObject; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; public String id() { return this.innerModel().id(); @@ -43,7 +45,7 @@ public AuthorizationRuleInner innerModel() { return this.innerObject; } - private RelayManager manager() { + private com.azure.resourcemanager.relay.RelayManager manager() { return this.serviceManager; } @@ -81,7 +83,7 @@ public AuthorizationRule create(Context context) { return this; } - AuthorizationRuleImpl(String name, RelayManager serviceManager) { + AuthorizationRuleImpl(String name, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = new AuthorizationRuleInner(); this.serviceManager = serviceManager; this.authorizationRuleName = name; @@ -113,7 +115,8 @@ public AuthorizationRule apply(Context context) { return this; } - AuthorizationRuleImpl(AuthorizationRuleInner innerObject, RelayManager serviceManager) { + AuthorizationRuleImpl( + AuthorizationRuleInner innerObject, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -141,6 +144,28 @@ 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 Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context) { + return serviceManager + .namespaces() + .regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, context); + } + 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/CheckNameAvailabilityResultImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/CheckNameAvailabilityResultImpl.java index 1e57e3783550..2f26b9b2484e 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/CheckNameAvailabilityResultImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/CheckNameAvailabilityResultImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.relay.implementation; -import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.models.CheckNameAvailabilityResultInner; import com.azure.resourcemanager.relay.models.CheckNameAvailabilityResult; import com.azure.resourcemanager.relay.models.UnavailableReason; @@ -12,9 +11,10 @@ public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { private CheckNameAvailabilityResultInner innerObject; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; - CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner innerObject, RelayManager serviceManager) { + CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -35,7 +35,7 @@ public CheckNameAvailabilityResultInner innerModel() { return this.innerObject; } - private RelayManager manager() { + 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/HybridConnectionImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/HybridConnectionImpl.java index eddd11524d60..078e44acfa35 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.relay.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.models.HybridConnectionInner; import com.azure.resourcemanager.relay.models.HybridConnection; import java.time.OffsetDateTime; @@ -14,7 +13,7 @@ public final class HybridConnectionImpl implements HybridConnection, HybridConnection.Definition, HybridConnection.Update { private HybridConnectionInner innerObject; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; public String id() { return this.innerModel().id(); @@ -52,7 +51,7 @@ public HybridConnectionInner innerModel() { return this.innerObject; } - private RelayManager manager() { + private com.azure.resourcemanager.relay.RelayManager manager() { return this.serviceManager; } @@ -90,7 +89,7 @@ public HybridConnection create(Context context) { return this; } - HybridConnectionImpl(String name, RelayManager serviceManager) { + HybridConnectionImpl(String name, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = new HybridConnectionInner(); this.serviceManager = serviceManager; this.hybridConnectionName = name; @@ -122,7 +121,8 @@ public HybridConnection apply(Context context) { return this; } - HybridConnectionImpl(HybridConnectionInner innerObject, RelayManager serviceManager) { + HybridConnectionImpl( + HybridConnectionInner innerObject, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); 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 63d9a4f14727..c48b3ba6f398 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 @@ -29,7 +29,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.fluent.HybridConnectionsClient; import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; @@ -41,8 +40,6 @@ /** An instance of this class provides access to all the operations defined in HybridConnectionsClient. */ public final class HybridConnectionsClientImpl implements HybridConnectionsClient { - private final ClientLogger logger = new ClientLogger(HybridConnectionsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final HybridConnectionsService service; @@ -268,7 +265,8 @@ Mono> listAuthorizationRulesNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response of the list hybrid connection operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByNamespaceSinglePageAsync( @@ -314,7 +312,7 @@ private Mono> listByNamespaceSinglePageAsyn res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -326,7 +324,8 @@ private Mono> listByNamespaceSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response of the list hybrid connection operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByNamespaceSinglePageAsync( @@ -380,7 +379,7 @@ private Mono> listByNamespaceSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response of the list hybrid connection operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { @@ -398,7 +397,7 @@ private PagedFlux listByNamespaceAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response of the list hybrid connection operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByNamespaceAsync( @@ -416,7 +415,7 @@ private PagedFlux listByNamespaceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @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) { @@ -432,7 +431,7 @@ public PagedIterable listByNamespace(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response of the list hybrid connection operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByNamespace( @@ -450,7 +449,8 @@ public PagedIterable listByNamespace( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of hybrid connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -498,7 +498,7 @@ private Mono> createOrUpdateWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -512,7 +512,8 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of hybrid connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -574,7 +575,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of hybrid connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -619,7 +620,7 @@ public HybridConnectionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -642,7 +643,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -684,7 +685,7 @@ private Mono> deleteWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -697,7 +698,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -748,7 +749,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @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) { @@ -781,7 +782,7 @@ public void delete(String resourceGroupName, String namespaceName, String hybrid * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -798,7 +799,8 @@ public Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of hybrid connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -840,7 +842,7 @@ private Mono> getWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -853,7 +855,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of hybrid connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -904,7 +907,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of hybrid connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -946,7 +949,7 @@ public HybridConnectionInner get(String resourceGroupName, String namespaceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of hybrid connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -963,7 +966,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync( @@ -1014,7 +1018,7 @@ private Mono> listAuthorizationRulesSingle res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1027,7 +1031,8 @@ private Mono> listAuthorizationRulesSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync( @@ -1087,7 +1092,7 @@ private Mono> listAuthorizationRulesSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAuthorizationRulesAsync( @@ -1107,7 +1112,7 @@ private PagedFlux listAuthorizationRulesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAuthorizationRulesAsync( @@ -1127,7 +1132,7 @@ private PagedFlux listAuthorizationRulesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules( @@ -1145,7 +1150,7 @@ public PagedIterable listAuthorizationRules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules( @@ -1165,7 +1170,8 @@ public PagedIterable listAuthorizationRules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( @@ -1222,7 +1228,7 @@ private Mono> createOrUpdateAuthorizationRuleWi parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1237,7 +1243,8 @@ private Mono> createOrUpdateAuthorizationRuleWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( @@ -1306,7 +1313,7 @@ private Mono> createOrUpdateAuthorizationRuleWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAuthorizationRuleAsync( @@ -1364,7 +1371,7 @@ public AuthorizationRuleInner createOrUpdateAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateAuthorizationRuleWithResponse( @@ -1389,7 +1396,7 @@ public Response createOrUpdateAuthorizationRuleWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAuthorizationRuleWithResponseAsync( @@ -1436,7 +1443,7 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1450,7 +1457,7 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAuthorizationRuleWithResponseAsync( @@ -1511,7 +1518,7 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAuthorizationRuleAsync( @@ -1550,7 +1557,7 @@ public void deleteAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteAuthorizationRuleWithResponse( @@ -1574,7 +1581,8 @@ public Response deleteAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAuthorizationRuleWithResponseAsync( @@ -1621,7 +1629,7 @@ private Mono> getAuthorizationRuleWithResponseA this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1635,7 +1643,8 @@ private Mono> getAuthorizationRuleWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAuthorizationRuleWithResponseAsync( @@ -1696,7 +1705,7 @@ private Mono> getAuthorizationRuleWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAuthorizationRuleAsync( @@ -1743,7 +1752,7 @@ public AuthorizationRuleInner getAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAuthorizationRuleWithResponse( @@ -1767,7 +1776,7 @@ public Response getAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -1814,7 +1823,7 @@ private Mono> listKeysWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1828,7 +1837,7 @@ private Mono> listKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -1889,7 +1898,7 @@ private Mono> listKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listKeysAsync( @@ -1934,7 +1943,7 @@ public AccessKeysInner listKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysWithResponse( @@ -1959,7 +1968,7 @@ public Response listKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regenerateKeysWithResponseAsync( @@ -2016,7 +2025,7 @@ private Mono> regenerateKeysWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2031,7 +2040,7 @@ private Mono> regenerateKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regenerateKeysWithResponseAsync( @@ -2100,7 +2109,7 @@ private Mono> regenerateKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regenerateKeysAsync( @@ -2158,7 +2167,7 @@ public AccessKeysInner regenerateKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response regenerateKeysWithResponse( @@ -2180,7 +2189,8 @@ public Response regenerateKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @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> listByNamespaceNextSinglePageAsync(String nextLink) { @@ -2205,7 +2215,7 @@ private Mono> listByNamespaceNextSinglePage res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2216,7 +2226,8 @@ private Mono> listByNamespaceNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the list hybrid connection operation. + * @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> listByNamespaceNextSinglePageAsync( @@ -2252,7 +2263,8 @@ private Mono> listByNamespaceNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { @@ -2278,7 +2290,7 @@ private Mono> listAuthorizationRulesNextSi res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2289,7 +2301,8 @@ private Mono> listAuthorizationRulesNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesNextSinglePageAsync( 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 673552041d26..3529d1e17ef2 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 @@ -9,7 +9,6 @@ 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.RelayManager; import com.azure.resourcemanager.relay.fluent.HybridConnectionsClient; import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; @@ -19,16 +18,16 @@ import com.azure.resourcemanager.relay.models.HybridConnection; import com.azure.resourcemanager.relay.models.HybridConnections; import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class HybridConnectionsImpl implements HybridConnections { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(HybridConnectionsImpl.class); private final HybridConnectionsClient innerClient; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; - public HybridConnectionsImpl(HybridConnectionsClient innerClient, RelayManager serviceManager) { + public HybridConnectionsImpl( + HybridConnectionsClient innerClient, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -36,14 +35,14 @@ public HybridConnectionsImpl(HybridConnectionsClient innerClient, RelayManager s public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); - return inner.mapPage(inner1 -> new HybridConnectionImpl(inner1, this.manager())); + 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 inner.mapPage(inner1 -> new HybridConnectionImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new HybridConnectionImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String namespaceName, String hybridConnectionName) { @@ -83,7 +82,7 @@ public PagedIterable listAuthorizationRules( String resourceGroupName, String namespaceName, String hybridConnectionName) { PagedIterable inner = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, hybridConnectionName); - return inner.mapPage(inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } public PagedIterable listAuthorizationRules( @@ -92,7 +91,7 @@ public PagedIterable listAuthorizationRules( this .serviceClient() .listAuthorizationRules(resourceGroupName, namespaceName, hybridConnectionName, context); - return inner.mapPage(inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } public AuthorizationRule createOrUpdateAuthorizationRule( @@ -269,7 +268,7 @@ public Response regenerateKeysWithResponse( public HybridConnection getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -277,14 +276,14 @@ public HybridConnection getById(String id) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String hybridConnectionName = Utils.getValueFromIdByName(id, "hybridConnections"); if (hybridConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -297,7 +296,7 @@ public HybridConnection getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -305,14 +304,14 @@ public Response getByIdWithResponse(String id, Context context } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String hybridConnectionName = Utils.getValueFromIdByName(id, "hybridConnections"); if (hybridConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -325,7 +324,7 @@ public Response getByIdWithResponse(String id, Context context public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -333,27 +332,27 @@ public void deleteById(String id) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String hybridConnectionName = Utils.getValueFromIdByName(id, "hybridConnections"); if (hybridConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format( "The resource ID '%s' is not valid. Missing path segment 'hybridConnections'.", id))); } - this.deleteWithResponse(resourceGroupName, namespaceName, hybridConnectionName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, namespaceName, hybridConnectionName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -361,14 +360,14 @@ public Response deleteByIdWithResponse(String id, Context context) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String hybridConnectionName = Utils.getValueFromIdByName(id, "hybridConnections"); if (hybridConnectionName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -382,7 +381,7 @@ private HybridConnectionsClient serviceClient() { return this.innerClient; } - private RelayManager manager() { + 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/NamespacesClientImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/NamespacesClientImpl.java index 7ca2d69efced..44a8bd74e834 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 @@ -31,7 +31,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.relay.fluent.NamespacesClient; @@ -50,8 +49,6 @@ /** An instance of this class provides access to all the operations defined in NamespacesClient. */ public final class NamespacesClientImpl implements NamespacesClient { - private final ClientLogger logger = new ClientLogger(NamespacesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final NamespacesService service; @@ -308,7 +305,8 @@ Mono> listAuthorizationRulesNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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( @@ -342,7 +340,7 @@ private Mono> checkNameAvailabilityWi parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -353,7 +351,8 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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( @@ -394,7 +393,7 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of the check name availability request properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync(CheckNameAvailability parameters) { @@ -431,7 +430,7 @@ public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailabil * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of the check name availability request properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse( @@ -444,7 +443,8 @@ public Response checkNameAvailabilityWithRespo * * @throws ManagementException thrown 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. + * @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() { @@ -480,7 +480,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -490,7 +490,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @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(Context context) { @@ -531,7 +532,7 @@ private Mono> listSinglePageAsync(Context con * * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -545,7 +546,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -558,7 +559,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -572,7 +573,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -586,7 +587,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -627,7 +629,7 @@ private Mono> listByResourceGroupSinglePageAs res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -638,7 +640,8 @@ private Mono> listByResourceGroupSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -687,7 +690,7 @@ private Mono> listByResourceGroupSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -704,7 +707,7 @@ private PagedFlux listByResourceGroupAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @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) { @@ -720,7 +723,7 @@ private PagedFlux listByResourceGroupAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -735,7 +738,7 @@ public PagedIterable listByResourceGroup(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @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) { @@ -751,7 +754,7 @@ public PagedIterable listByResourceGroup(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -794,7 +797,7 @@ private Mono>> createOrUpdateWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -807,7 +810,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -859,9 +862,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, RelayNamespaceInner> beginCreateOrUpdateAsync( String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { Mono>> mono = @@ -873,7 +876,7 @@ private PollerFlux, RelayNamespaceInner> beginCr this.client.getHttpPipeline(), RelayNamespaceInner.class, RelayNamespaceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -886,9 +889,9 @@ private PollerFlux, RelayNamespaceInner> beginCr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, RelayNamespaceInner> beginCreateOrUpdateAsync( String resourceGroupName, String namespaceName, RelayNamespaceInner parameters, Context context) { context = this.client.mergeContext(context); @@ -909,9 +912,9 @@ private PollerFlux, RelayNamespaceInner> beginCr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, RelayNamespaceInner> beginCreateOrUpdate( String resourceGroupName, String namespaceName, RelayNamespaceInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).getSyncPoller(); @@ -927,9 +930,9 @@ public SyncPoller, RelayNamespaceInner> beginCre * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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) + @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(); @@ -944,7 +947,7 @@ public SyncPoller, RelayNamespaceInner> beginCre * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -964,7 +967,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -1017,7 +1020,7 @@ public RelayNamespaceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String namespaceName) { @@ -1053,7 +1056,7 @@ private Mono>> deleteWithResponseAsync(String resource this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1065,7 +1068,7 @@ private Mono>> deleteWithResponseAsync(String 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1110,14 +1113,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @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, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1129,9 +1133,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String namespaceName, Context context) { context = this.client.mergeContext(context); @@ -1149,9 +1153,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName) { return beginDeleteAsync(resourceGroupName, namespaceName).getSyncPoller(); } @@ -1165,9 +1169,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String namespaceName, Context context) { return beginDeleteAsync(resourceGroupName, namespaceName, context).getSyncPoller(); @@ -1181,7 +1185,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String namespaceName) { @@ -1197,7 +1201,7 @@ private Mono deleteAsync(String resourceGroupName, String namespaceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @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) { @@ -1243,7 +1247,7 @@ public void delete(String resourceGroupName, String namespaceName, Context conte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1280,7 +1284,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1292,7 +1296,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1337,7 +1341,7 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { @@ -1376,7 +1380,7 @@ public RelayNamespaceInner getByResourceGroup(String resourceGroupName, String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -1394,7 +1398,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1437,7 +1441,7 @@ private Mono> updateWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1451,7 +1455,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1504,7 +1508,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1549,7 +1553,7 @@ public RelayNamespaceInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of a namespace resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1565,7 +1569,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync( @@ -1611,7 +1616,7 @@ private Mono> listAuthorizationRulesSingle res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1623,7 +1628,8 @@ private Mono> listAuthorizationRulesSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync( @@ -1677,7 +1683,7 @@ private Mono> listAuthorizationRulesSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAuthorizationRulesAsync( @@ -1696,7 +1702,7 @@ private PagedFlux listAuthorizationRulesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAuthorizationRulesAsync( @@ -1714,7 +1720,7 @@ private PagedFlux listAuthorizationRulesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules( @@ -1731,7 +1737,7 @@ public PagedIterable listAuthorizationRules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules( @@ -1749,7 +1755,8 @@ public PagedIterable listAuthorizationRules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( @@ -1800,7 +1807,7 @@ private Mono> createOrUpdateAuthorizationRuleWi parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1814,7 +1821,8 @@ private Mono> createOrUpdateAuthorizationRuleWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( @@ -1876,7 +1884,7 @@ private Mono> createOrUpdateAuthorizationRuleWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAuthorizationRuleAsync( @@ -1929,7 +1937,7 @@ public AuthorizationRuleInner createOrUpdateAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateAuthorizationRuleWithResponse( @@ -1952,7 +1960,7 @@ public Response createOrUpdateAuthorizationRuleWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAuthorizationRuleWithResponseAsync( @@ -1994,7 +2002,7 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2007,7 +2015,7 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAuthorizationRuleWithResponseAsync( @@ -2058,7 +2066,7 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAuthorizationRuleAsync( @@ -2092,7 +2100,7 @@ public void deleteAuthorizationRule(String resourceGroupName, String namespaceNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteAuthorizationRuleWithResponse( @@ -2111,7 +2119,8 @@ public Response deleteAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAuthorizationRuleWithResponseAsync( @@ -2153,7 +2162,7 @@ private Mono> getAuthorizationRuleWithResponseA this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2166,7 +2175,8 @@ private Mono> getAuthorizationRuleWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAuthorizationRuleWithResponseAsync( @@ -2217,7 +2227,7 @@ private Mono> getAuthorizationRuleWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAuthorizationRuleAsync( @@ -2260,7 +2270,7 @@ public AuthorizationRuleInner getAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAuthorizationRuleWithResponse( @@ -2278,7 +2288,7 @@ public Response getAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -2320,7 +2330,7 @@ private Mono> listKeysWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2333,7 +2343,7 @@ private Mono> listKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -2384,7 +2394,7 @@ private Mono> listKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listKeysAsync( @@ -2426,7 +2436,7 @@ public AccessKeysInner listKeys(String resourceGroupName, String namespaceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysWithResponse( @@ -2444,7 +2454,7 @@ public Response listKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regenerateKeysWithResponseAsync( @@ -2495,7 +2505,7 @@ private Mono> regenerateKeysWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2509,7 +2519,7 @@ private Mono> regenerateKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regenerateKeysWithResponseAsync( @@ -2571,7 +2581,7 @@ private Mono> regenerateKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regenerateKeysAsync( @@ -2622,7 +2632,7 @@ public AccessKeysInner regenerateKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response regenerateKeysWithResponse( @@ -2643,7 +2653,8 @@ public Response regenerateKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2668,7 +2679,7 @@ private Mono> listNextSinglePageAsync(String res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2679,7 +2690,8 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -2714,7 +2726,8 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -2740,7 +2753,7 @@ private Mono> listByResourceGroupNextSinglePa res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2751,7 +2764,8 @@ private Mono> listByResourceGroupNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( @@ -2787,7 +2801,8 @@ private Mono> listByResourceGroupNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { @@ -2813,7 +2828,7 @@ private Mono> listAuthorizationRulesNextSi res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2824,7 +2839,8 @@ private Mono> listAuthorizationRulesNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesNextSinglePageAsync( 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 550485aabb0e..2439ad8600bd 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 @@ -9,7 +9,6 @@ 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.RelayManager; import com.azure.resourcemanager.relay.fluent.NamespacesClient; import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; @@ -22,16 +21,15 @@ import com.azure.resourcemanager.relay.models.Namespaces; import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; import com.azure.resourcemanager.relay.models.RelayNamespace; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class NamespacesImpl implements Namespaces { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NamespacesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(NamespacesImpl.class); private final NamespacesClient innerClient; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; - public NamespacesImpl(NamespacesClient innerClient, RelayManager serviceManager) { + public NamespacesImpl(NamespacesClient innerClient, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -62,22 +60,22 @@ public Response checkNameAvailabilityWithResponse( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return inner.mapPage(inner1 -> new RelayNamespaceImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return inner.mapPage(inner1 -> new RelayNamespaceImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return inner.mapPage(inner1 -> new RelayNamespaceImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return inner.mapPage(inner1 -> new RelayNamespaceImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new RelayNamespaceImpl(inner1, this.manager())); } public void deleteByResourceGroup(String resourceGroupName, String namespaceName) { @@ -115,14 +113,14 @@ public Response getByResourceGroupWithResponse( public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName) { PagedIterable inner = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); - return inner.mapPage(inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + 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 inner.mapPage(inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { @@ -227,7 +225,7 @@ public Response regenerateKeysWithResponse( public RelayNamespace getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -235,7 +233,7 @@ public RelayNamespace getById(String id) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); @@ -246,7 +244,7 @@ public RelayNamespace getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -254,7 +252,7 @@ public Response getByIdWithResponse(String id, Context context) } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); @@ -265,7 +263,7 @@ public Response getByIdWithResponse(String id, Context context) public AuthorizationRule getAuthorizationRuleById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -273,14 +271,14 @@ public AuthorizationRule getAuthorizationRuleById(String id) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String authorizationRuleName = Utils.getValueFromIdByName(id, "authorizationRules"); if (authorizationRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -295,7 +293,7 @@ public AuthorizationRule getAuthorizationRuleById(String id) { public Response getAuthorizationRuleByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -303,14 +301,14 @@ public Response getAuthorizationRuleByIdWithResponse(String i } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String authorizationRuleName = Utils.getValueFromIdByName(id, "authorizationRules"); if (authorizationRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -323,7 +321,7 @@ public Response getAuthorizationRuleByIdWithResponse(String i public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -331,7 +329,7 @@ public void deleteById(String id) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); @@ -342,7 +340,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -350,7 +348,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); @@ -361,7 +359,7 @@ public void deleteByIdWithResponse(String id, Context context) { public void deleteAuthorizationRuleById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -369,29 +367,27 @@ public void deleteAuthorizationRuleById(String id) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String authorizationRuleName = Utils.getValueFromIdByName(id, "authorizationRules"); if (authorizationRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format( "The resource ID '%s' is not valid. Missing path segment 'authorizationRules'.", id))); } - this - .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) - .getValue(); + this.deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE); } public Response deleteAuthorizationRuleByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -399,14 +395,14 @@ public Response deleteAuthorizationRuleByIdWithResponse(String id, Context } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String authorizationRuleName = Utils.getValueFromIdByName(id, "authorizationRules"); if (authorizationRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -421,7 +417,7 @@ private NamespacesClient serviceClient() { return this.innerClient; } - private RelayManager manager() { + 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 f260b0a30dfd..b7835ab36aac 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 @@ -4,7 +4,6 @@ package com.azure.resourcemanager.relay.implementation; -import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.models.OperationInner; import com.azure.resourcemanager.relay.models.Operation; import com.azure.resourcemanager.relay.models.OperationDisplay; @@ -12,9 +11,9 @@ public final class OperationImpl implements Operation { private OperationInner innerObject; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; - OperationImpl(OperationInner innerObject, RelayManager serviceManager) { + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -31,7 +30,7 @@ public OperationInner innerModel() { return this.innerObject; } - private RelayManager manager() { + 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/OperationsClientImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsClientImpl.java index 715cbc58d0df..6574ac84156a 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 @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.fluent.OperationsClient; import com.azure.resourcemanager.relay.fluent.models.OperationInner; import com.azure.resourcemanager.relay.models.OperationListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -85,7 +82,8 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -108,7 +106,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -118,7 +116,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +147,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +161,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +174,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +188,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +202,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -228,7 +228,7 @@ private Mono> listNextSinglePageAsync(String nextL res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -239,7 +239,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsImpl.java index fe3a7522371b..3662d2218f0e 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsImpl.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/OperationsImpl.java @@ -7,40 +7,38 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.OperationsClient; import com.azure.resourcemanager.relay.fluent.models.OperationInner; import com.azure.resourcemanager.relay.models.Operation; import com.azure.resourcemanager.relay.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; - public OperationsImpl(OperationsClient innerClient, RelayManager serviceManager) { + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { return this.innerClient; } - private RelayManager manager() { + 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/RelayApiImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayApiImpl.java index 1c640a3de165..b907c91b58f4 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 @@ -39,8 +39,6 @@ /** Initializes a new instance of the RelayApiImpl type. */ @ServiceClient(builder = RelayApiBuilder.class) public final class RelayApiImpl implements RelayApi { - private final ClientLogger logger = new ClientLogger(RelayApiImpl.class); - /** * Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part * of the URI for every service call. @@ -277,8 +275,8 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } - } catch (IOException ioe) { - logger.logThrowableAsWarning(ioe); + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -306,7 +304,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { @@ -337,4 +335,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(RelayApiImpl.class); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayNamespaceImpl.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/RelayNamespaceImpl.java index ec139b588e39..2b48b9be1e04 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 @@ -6,7 +6,6 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; -import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner; import com.azure.resourcemanager.relay.models.ProvisioningStateEnum; import com.azure.resourcemanager.relay.models.RelayNamespace; @@ -19,7 +18,7 @@ public final class RelayNamespaceImpl implements RelayNamespace, RelayNamespace.Definition, RelayNamespace.Update { private RelayNamespaceInner innerObject; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; public String id() { return this.innerModel().id(); @@ -82,7 +81,7 @@ public RelayNamespaceInner innerModel() { return this.innerObject; } - private RelayManager manager() { + private com.azure.resourcemanager.relay.RelayManager manager() { return this.serviceManager; } @@ -115,7 +114,7 @@ public RelayNamespace create(Context context) { return this; } - RelayNamespaceImpl(String name, RelayManager serviceManager) { + RelayNamespaceImpl(String name, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = new RelayNamespaceInner(); this.serviceManager = serviceManager; this.namespaceName = name; @@ -146,7 +145,7 @@ public RelayNamespace apply(Context context) { return this; } - RelayNamespaceImpl(RelayNamespaceInner innerObject, RelayManager serviceManager) { + RelayNamespaceImpl(RelayNamespaceInner innerObject, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/Utils.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/Utils.java index 7393cca62663..9004f41e59d1 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/Utils.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/Utils.java @@ -4,12 +4,20 @@ package com.azure.resourcemanager.relay.implementation; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.CoreUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; final class Utils { static String getValueFromIdByName(String id, String name) { @@ -64,4 +72,133 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } return null; } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } } diff --git a/sdk/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 ec16f03e2147..b3f300629089 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.relay.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.relay.RelayManager; import com.azure.resourcemanager.relay.fluent.models.WcfRelayInner; import com.azure.resourcemanager.relay.models.Relaytype; import com.azure.resourcemanager.relay.models.WcfRelay; @@ -14,7 +13,7 @@ public final class WcfRelayImpl implements WcfRelay, WcfRelay.Definition, WcfRelay.Update { private WcfRelayInner innerObject; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; public String id() { return this.innerModel().id(); @@ -64,7 +63,7 @@ public WcfRelayInner innerModel() { return this.innerObject; } - private RelayManager manager() { + private com.azure.resourcemanager.relay.RelayManager manager() { return this.serviceManager; } @@ -101,7 +100,7 @@ public WcfRelay create(Context context) { return this; } - WcfRelayImpl(String name, RelayManager serviceManager) { + WcfRelayImpl(String name, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = new WcfRelayInner(); this.serviceManager = serviceManager; this.relayName = name; @@ -132,7 +131,7 @@ public WcfRelay apply(Context context) { return this; } - WcfRelayImpl(WcfRelayInner innerObject, RelayManager serviceManager) { + WcfRelayImpl(WcfRelayInner innerObject, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); 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 49e55d6320a5..331dccc74a6e 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 @@ -29,7 +29,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.fluent.WcfRelaysClient; import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; @@ -41,8 +40,6 @@ /** An instance of this class provides access to all the operations defined in WcfRelaysClient. */ public final class WcfRelaysClientImpl implements WcfRelaysClient { - private final ClientLogger logger = new ClientLogger(WcfRelaysClientImpl.class); - /** The proxy service used to perform REST calls. */ private final WcfRelaysService service; @@ -263,7 +260,8 @@ Mono> listAuthorizationRulesNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response of the list WCF relay operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByNamespaceSinglePageAsync( @@ -309,7 +307,7 @@ private Mono> listByNamespaceSinglePageAsync( res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -321,7 +319,8 @@ private Mono> listByNamespaceSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response of the list WCF relay operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByNamespaceSinglePageAsync( @@ -375,7 +374,7 @@ private Mono> listByNamespaceSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response of the list WCF relay operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByNamespaceAsync(String resourceGroupName, String namespaceName) { @@ -393,7 +392,7 @@ private PagedFlux listByNamespaceAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response of the list WCF relay operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByNamespaceAsync( @@ -411,7 +410,7 @@ private PagedFlux listByNamespaceAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @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) { @@ -427,7 +426,7 @@ public PagedIterable listByNamespace(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the list WCF relay operation. + * @return the response of the list WCF relay operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByNamespace( @@ -445,7 +444,8 @@ public PagedIterable listByNamespace( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of the WCF relay resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -492,7 +492,7 @@ private Mono> createOrUpdateWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -506,7 +506,8 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of the WCF relay resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -563,7 +564,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of the WCF relay resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -608,7 +609,7 @@ public WcfRelayInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -626,7 +627,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -667,7 +668,7 @@ private Mono> deleteWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -680,7 +681,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -730,7 +731,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @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) { @@ -763,7 +764,7 @@ public void delete(String resourceGroupName, String namespaceName, String relayN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -780,7 +781,8 @@ public Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of the WCF relay resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -821,7 +823,7 @@ private Mono> getWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -834,7 +836,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of the WCF relay resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -884,7 +887,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 description of the WCF relay resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String namespaceName, String relayName) { @@ -925,7 +928,7 @@ public WcfRelayInner get(String resourceGroupName, String namespaceName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the WCF relay resource. + * @return description of the WCF relay resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -942,7 +945,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync( @@ -992,7 +996,7 @@ private Mono> listAuthorizationRulesSingle res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1005,7 +1009,8 @@ private Mono> listAuthorizationRulesSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesSinglePageAsync( @@ -1064,7 +1069,7 @@ private Mono> listAuthorizationRulesSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAuthorizationRulesAsync( @@ -1084,7 +1089,7 @@ private PagedFlux listAuthorizationRulesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAuthorizationRulesAsync( @@ -1103,7 +1108,7 @@ private PagedFlux listAuthorizationRulesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules( @@ -1121,7 +1126,7 @@ public PagedIterable listAuthorizationRules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules( @@ -1140,7 +1145,8 @@ public PagedIterable listAuthorizationRules( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( @@ -1196,7 +1202,7 @@ private Mono> createOrUpdateAuthorizationRuleWi parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1211,7 +1217,8 @@ private Mono> createOrUpdateAuthorizationRuleWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( @@ -1279,7 +1286,7 @@ private Mono> createOrUpdateAuthorizationRuleWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAuthorizationRuleAsync( @@ -1337,7 +1344,7 @@ public AuthorizationRuleInner createOrUpdateAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateAuthorizationRuleWithResponse( @@ -1362,7 +1369,7 @@ public Response createOrUpdateAuthorizationRuleWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAuthorizationRuleWithResponseAsync( @@ -1408,7 +1415,7 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1422,7 +1429,7 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteAuthorizationRuleWithResponseAsync( @@ -1482,7 +1489,7 @@ private Mono> deleteAuthorizationRuleWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAuthorizationRuleAsync( @@ -1520,7 +1527,7 @@ public void deleteAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteAuthorizationRuleWithResponse( @@ -1544,7 +1551,8 @@ public Response deleteAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorizationRule for a WCF relay by name along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAuthorizationRuleWithResponseAsync( @@ -1590,7 +1598,7 @@ private Mono> getAuthorizationRuleWithResponseA this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1604,7 +1612,8 @@ private Mono> getAuthorizationRuleWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorizationRule for a WCF relay by name along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAuthorizationRuleWithResponseAsync( @@ -1664,7 +1673,7 @@ private Mono> getAuthorizationRuleWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorizationRule for a WCF relay by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAuthorizationRuleAsync( @@ -1709,7 +1718,7 @@ public AuthorizationRuleInner getAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorizationRule for a WCF relay by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAuthorizationRuleWithResponse( @@ -1733,7 +1742,7 @@ public Response getAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -1779,7 +1788,7 @@ private Mono> listKeysWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1793,7 +1802,7 @@ private Mono> listKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -1853,7 +1862,7 @@ private Mono> listKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listKeysAsync( @@ -1898,7 +1907,7 @@ public AccessKeysInner listKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysWithResponse( @@ -1922,7 +1931,7 @@ public Response listKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regenerateKeysWithResponseAsync( @@ -1978,7 +1987,7 @@ private Mono> regenerateKeysWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1993,7 +2002,7 @@ private Mono> regenerateKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regenerateKeysWithResponseAsync( @@ -2061,7 +2070,7 @@ private Mono> regenerateKeysWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regenerateKeysAsync( @@ -2118,7 +2127,7 @@ public AccessKeysInner regenerateKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response regenerateKeysWithResponse( @@ -2140,7 +2149,8 @@ public Response regenerateKeysWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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. + * @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> listByNamespaceNextSinglePageAsync(String nextLink) { @@ -2165,7 +2175,7 @@ private Mono> listByNamespaceNextSinglePageAsync(St res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2176,7 +2186,8 @@ private Mono> listByNamespaceNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the list WCF relay operation. + * @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> listByNamespaceNextSinglePageAsync(String nextLink, Context context) { @@ -2211,7 +2222,8 @@ private Mono> listByNamespaceNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { @@ -2237,7 +2249,7 @@ private Mono> listAuthorizationRulesNextSi res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2248,7 +2260,8 @@ private Mono> listAuthorizationRulesNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the list namespace operation. + * @return the response from the list namespace operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesNextSinglePageAsync( 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 a08c9f0808e8..503ea0809fe7 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 @@ -9,7 +9,6 @@ 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.RelayManager; import com.azure.resourcemanager.relay.fluent.WcfRelaysClient; import com.azure.resourcemanager.relay.fluent.models.AccessKeysInner; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; @@ -19,29 +18,28 @@ import com.azure.resourcemanager.relay.models.RegenerateAccessKeyParameters; import com.azure.resourcemanager.relay.models.WcfRelay; import com.azure.resourcemanager.relay.models.WcfRelays; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class WcfRelaysImpl implements WcfRelays { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WcfRelaysImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(WcfRelaysImpl.class); private final WcfRelaysClient innerClient; - private final RelayManager serviceManager; + private final com.azure.resourcemanager.relay.RelayManager serviceManager; - public WcfRelaysImpl(WcfRelaysClient innerClient, RelayManager serviceManager) { + public WcfRelaysImpl(WcfRelaysClient innerClient, com.azure.resourcemanager.relay.RelayManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByNamespace(String resourceGroupName, String namespaceName) { PagedIterable inner = this.serviceClient().listByNamespace(resourceGroupName, namespaceName); - return inner.mapPage(inner1 -> new WcfRelayImpl(inner1, this.manager())); + 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 inner.mapPage(inner1 -> new WcfRelayImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new WcfRelayImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String namespaceName, String relayName) { @@ -81,14 +79,14 @@ public PagedIterable listAuthorizationRules( String resourceGroupName, String namespaceName, String relayName) { PagedIterable inner = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName, relayName); - return inner.mapPage(inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + 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 inner.mapPage(inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); + return Utils.mapPage(inner, inner1 -> new AuthorizationRuleImpl(inner1, this.manager())); } public AuthorizationRule createOrUpdateAuthorizationRule( @@ -261,7 +259,7 @@ public Response regenerateKeysWithResponse( public WcfRelay getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -269,14 +267,14 @@ public WcfRelay getById(String id) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String relayName = Utils.getValueFromIdByName(id, "wcfRelays"); if (relayName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'wcfRelays'.", id))); @@ -287,7 +285,7 @@ public WcfRelay getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -295,14 +293,14 @@ public Response getByIdWithResponse(String id, Context context) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String relayName = Utils.getValueFromIdByName(id, "wcfRelays"); if (relayName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'wcfRelays'.", id))); @@ -313,7 +311,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -321,25 +319,25 @@ public void deleteById(String id) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String relayName = Utils.getValueFromIdByName(id, "wcfRelays"); if (relayName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'wcfRelays'.", id))); } - this.deleteWithResponse(resourceGroupName, namespaceName, relayName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, namespaceName, relayName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -347,14 +345,14 @@ public Response deleteByIdWithResponse(String id, Context context) { } String namespaceName = Utils.getValueFromIdByName(id, "namespaces"); if (namespaceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } String relayName = Utils.getValueFromIdByName(id, "wcfRelays"); if (relayName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'wcfRelays'.", id))); @@ -366,7 +364,7 @@ private WcfRelaysClient serviceClient() { return this.innerClient; } - private RelayManager manager() { + 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/models/AuthorizationRule.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/AuthorizationRule.java index 5c50ee82cb9f..2a42ac712415 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.relay.models; +import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; import java.util.List; @@ -150,4 +151,47 @@ interface WithRights { * @return the refreshed resource. */ AuthorizationRule refresh(Context context); + + /** + * Primary and secondary connection strings to the namespace. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/Relay Connection String. + */ + AccessKeys listKeys(); + + /** + * 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}. + */ + Response listKeysWithResponse(Context context); + + /** + * Regenerates the primary or secondary connection strings to the namespace. + * + * @param parameters Parameters supplied to regenerate authorization rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namespace/Relay Connection String. + */ + AccessKeys regenerateKeys(RegenerateAccessKeyParameters parameters); + + /** + * 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}. + */ + Response regenerateKeysWithResponse(RegenerateAccessKeyParameters parameters, Context context); } 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 36ee153718df..e8b618830646 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 @@ -5,17 +5,13 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The response from the list namespace operation. */ @Fluent public final class AuthorizationRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationRuleListResult.class); - /* * 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 3f9e06d15027..1f7446b7bac3 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 @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Description of the check name availability request properties. */ @Fluent public final class CheckNameAvailability { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailability.class); - /* * The namespace name to check for availability. The namespace name can * contain only letters, numbers, and hyphens. The namespace must start @@ -51,9 +48,11 @@ public CheckNameAvailability withName(String name) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model CheckNameAvailability")); } } + + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailability.class); } 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 046c9c47b545..28a1ed910d11 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 @@ -5,17 +5,13 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.fluent.models.HybridConnectionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The response of the list hybrid connection operation. */ @Fluent public final class HybridConnectionListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionListResult.class); - /* * 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 be92d7565573..3ac611b78a45 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 @@ -19,7 +19,7 @@ public interface HybridConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the list hybrid connection operation as paginated response with {@link PagedIterable}. */ PagedIterable listByNamespace(String resourceGroupName, String namespaceName); @@ -32,7 +32,7 @@ public interface HybridConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the list hybrid connection operation as paginated response with {@link PagedIterable}. */ PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); @@ -58,7 +58,7 @@ public interface HybridConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); @@ -86,7 +86,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of hybrid connection resource along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); @@ -100,7 +100,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules( String resourceGroupName, String namespaceName, String hybridConnectionName); @@ -115,7 +115,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 the response from the list namespace operation. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules( String resourceGroupName, String namespaceName, String hybridConnectionName, Context context); @@ -152,7 +152,7 @@ AuthorizationRule createOrUpdateAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 authorization rule along with {@link Response}. */ Response createOrUpdateAuthorizationRuleWithResponse( String resourceGroupName, @@ -187,7 +187,7 @@ 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 response. + * @return the {@link Response}. */ Response deleteAuthorizationRuleWithResponse( String resourceGroupName, @@ -222,7 +222,7 @@ 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. + * @return description of a namespace authorization rule along with {@link Response}. */ Response getAuthorizationRuleWithResponse( String resourceGroupName, @@ -257,7 +257,7 @@ AccessKeys listKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ Response listKeysWithResponse( String resourceGroupName, @@ -298,7 +298,7 @@ AccessKeys regenerateKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ Response regenerateKeysWithResponse( String resourceGroupName, @@ -315,7 +315,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 hybrid connection resource. + * @return description of hybrid connection resource along with {@link Response}. */ HybridConnection getById(String id); @@ -327,7 +327,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 hybrid connection resource. + * @return description of hybrid connection resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -349,7 +349,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 the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); 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 dc6b2cb96917..87c87771dbac 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 @@ -29,7 +29,7 @@ public interface Namespaces { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of the check name availability request properties along with {@link Response}. */ Response checkNameAvailabilityWithResponse( CheckNameAvailability parameters, Context context); @@ -39,7 +39,7 @@ Response checkNameAvailabilityWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -50,7 +50,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -61,7 +61,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -73,7 +73,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -121,7 +121,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of a namespace resource along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String namespaceName, Context context); @@ -134,7 +134,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName); @@ -147,7 +147,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules( String resourceGroupName, String namespaceName, Context context); @@ -174,7 +174,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 the response. + * @return the {@link Response}. */ Response deleteAuthorizationRuleWithResponse( String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); @@ -203,7 +203,7 @@ 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. + * @return description of a namespace authorization rule along with {@link Response}. */ Response getAuthorizationRuleWithResponse( String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); @@ -231,7 +231,7 @@ Response getAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ Response listKeysWithResponse( String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); @@ -265,7 +265,7 @@ AccessKeys regenerateKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ Response regenerateKeysWithResponse( String resourceGroupName, @@ -281,7 +281,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 resource. + * @return description of a namespace resource along with {@link Response}. */ RelayNamespace getById(String id); @@ -293,7 +293,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 resource. + * @return description of a namespace resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -304,7 +304,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. + * @return description of a namespace authorization rule along with {@link Response}. */ AuthorizationRule getAuthorizationRuleById(String id); @@ -316,7 +316,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. + * @return description of a namespace authorization rule along with {@link Response}. */ Response getAuthorizationRuleByIdWithResponse(String id, Context context); @@ -359,7 +359,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 the response. + * @return the {@link Response}. */ Response deleteAuthorizationRuleByIdWithResponse(String id, Context context); 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 ecd3e03aad0c..6fbc7736f994 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The object that represents the operation. */ @Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * Service provider: Relay. */ 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 78ba544642a5..73bd948fdaea 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 @@ -5,9 +5,7 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,8 +15,6 @@ */ @Immutable public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* * List of Relay operations supported by resource provider. */ diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operations.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operations.java index d9aac3c74309..6f2f38b58b8c 100644 --- a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operations.java +++ b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Relay operations. + * @return result of the request to list Relay operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RegenerateAccessKeyParameters.java b/sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/models/RegenerateAccessKeyParameters.java index 69121628b566..be06454088ee 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 @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Parameters supplied to the regenerate authorization rule operation, specifies which key neeeds to be reset. */ @Fluent public final class RegenerateAccessKeyParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateAccessKeyParameters.class); - /* * The access key to regenerate. */ @@ -76,10 +73,12 @@ public RegenerateAccessKeyParameters withKey(String key) { */ public void validate() { if (keyType() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property keyType in model RegenerateAccessKeyParameters")); } } + + private static final ClientLogger LOGGER = new ClientLogger(RegenerateAccessKeyParameters.class); } 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 8fb7c9e7e268..1ed496e8949f 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 @@ -5,17 +5,13 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The response from the list namespace operation. */ @Fluent public final class RelayNamespaceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RelayNamespaceListResult.class); - /* * 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 be0cc55e638b..fe5fc36d732b 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,19 +5,14 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.relay.fluent.models.RelayNamespaceProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; /** Description of a namespace resource. */ -@JsonFlatten @Fluent -public class RelayUpdateParameters extends ResourceNamespacePatch { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RelayUpdateParameters.class); - +public final class RelayUpdateParameters extends ResourceNamespacePatch { /* * SKU of the namespace. */ @@ -25,34 +20,10 @@ public class RelayUpdateParameters extends ResourceNamespacePatch { private Sku sku; /* - * The provisioningState property. + * Description of Relay namespace. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningStateEnum provisioningState; - - /* - * The time the namespace was created. - */ - @JsonProperty(value = "properties.createdAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdAt; - - /* - * The time the namespace was updated. - */ - @JsonProperty(value = "properties.updatedAt", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime updatedAt; - - /* - * Endpoint you can use to perform Service Bus operations. - */ - @JsonProperty(value = "properties.serviceBusEndpoint", access = JsonProperty.Access.WRITE_ONLY) - private String serviceBusEndpoint; - - /* - * Identifier for Azure Insights metrics. - */ - @JsonProperty(value = "properties.metricId", access = JsonProperty.Access.WRITE_ONLY) - private String metricId; + @JsonProperty(value = "properties") + private RelayNamespaceProperties innerProperties; /** * Get the sku property: SKU of the namespace. @@ -74,13 +45,29 @@ public RelayUpdateParameters withSku(Sku sku) { return this; } + /** + * Get the innerProperties property: Description of Relay namespace. + * + * @return the innerProperties value. + */ + private RelayNamespaceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public RelayUpdateParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the provisioningState property: The provisioningState property. * * @return the provisioningState value. */ public ProvisioningStateEnum provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -89,7 +76,7 @@ public ProvisioningStateEnum provisioningState() { * @return the createdAt value. */ public OffsetDateTime createdAt() { - return this.createdAt; + return this.innerProperties() == null ? null : this.innerProperties().createdAt(); } /** @@ -98,7 +85,7 @@ public OffsetDateTime createdAt() { * @return the updatedAt value. */ public OffsetDateTime updatedAt() { - return this.updatedAt; + return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); } /** @@ -107,7 +94,7 @@ public OffsetDateTime updatedAt() { * @return the serviceBusEndpoint value. */ public String serviceBusEndpoint() { - return this.serviceBusEndpoint; + return this.innerProperties() == null ? null : this.innerProperties().serviceBusEndpoint(); } /** @@ -116,14 +103,7 @@ public String serviceBusEndpoint() { * @return the metricId value. */ public String metricId() { - return this.metricId; - } - - /** {@inheritDoc} */ - @Override - public RelayUpdateParameters withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().metricId(); } /** @@ -137,5 +117,8 @@ public void validate() { if (sku() != null) { sku().validate(); } + if (innerProperties() != null) { + innerProperties().validate(); + } } } 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 d2ef9b107da6..47fa2fe49312 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 @@ -6,20 +6,18 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Definition of resource. */ @Fluent public class ResourceNamespacePatch extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceNamespacePatch.class); - /* * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map 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 406bce8499b5..ba33831977c7 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,20 +5,16 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** SKU of the namespace. */ @Fluent public final class Sku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); - /* * Name of this SKU. */ @JsonProperty(value = "name", required = true) - private String name; + private String name = "Standard"; /* * The tier of this SKU. 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 e602cc49c543..335c7e33f8b7 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 @@ -19,7 +19,7 @@ public interface WcfRelays { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the list WCF relay operation as paginated response with {@link PagedIterable}. */ PagedIterable listByNamespace(String resourceGroupName, String namespaceName); @@ -32,7 +32,7 @@ public interface WcfRelays { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response of the list WCF relay operation as paginated response with {@link PagedIterable}. */ PagedIterable listByNamespace(String resourceGroupName, String namespaceName, Context context); @@ -58,7 +58,7 @@ public interface WcfRelays { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String namespaceName, String relayName, Context context); @@ -86,7 +86,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 description of the WCF relay resource along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String namespaceName, String relayName, Context context); @@ -100,7 +100,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules( String resourceGroupName, String namespaceName, String relayName); @@ -115,7 +115,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 the response from the list namespace operation. + * @return the response from the list namespace operation as paginated response with {@link PagedIterable}. */ PagedIterable listAuthorizationRules( String resourceGroupName, String namespaceName, String relayName, Context context); @@ -152,7 +152,7 @@ AuthorizationRule createOrUpdateAuthorizationRule( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 authorization rule along with {@link Response}. */ Response createOrUpdateAuthorizationRuleWithResponse( String resourceGroupName, @@ -187,7 +187,7 @@ 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 response. + * @return the {@link Response}. */ Response deleteAuthorizationRuleWithResponse( String resourceGroupName, @@ -222,7 +222,7 @@ 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. + * @return authorizationRule for a WCF relay by name along with {@link Response}. */ Response getAuthorizationRuleWithResponse( String resourceGroupName, @@ -256,7 +256,7 @@ Response getAuthorizationRuleWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ Response listKeysWithResponse( String resourceGroupName, @@ -297,7 +297,7 @@ AccessKeys regenerateKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. */ Response regenerateKeysWithResponse( String resourceGroupName, @@ -314,7 +314,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 the WCF relay resource. + * @return description of the WCF relay resource along with {@link Response}. */ WcfRelay getById(String id); @@ -326,7 +326,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 the WCF relay resource. + * @return description of the WCF relay resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -348,7 +348,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 the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); 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 5f9e144eabe2..79e33eb4486c 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 @@ -5,17 +5,13 @@ package com.azure.resourcemanager.relay.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.relay.fluent.models.WcfRelayInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The response of the list WCF relay operation. */ @Fluent public final class WcfRelaysListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(WcfRelaysListResult.class); - /* * 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 new file mode 100644 index 000000000000..3f16bd43201a --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateAuthorizationRuleSamples.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.core.util.Context; +import com.azure.resourcemanager.relay.fluent.models.AuthorizationRuleInner; +import com.azure.resourcemanager.relay.models.AccessRights; +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 + */ + /** + * Sample code: RelayHybridConnectionAuthorizationRuleCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAuthorizationRuleCreate( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .createOrUpdateAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..b261198f3109 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsCreateOrUpdateSamples.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; + +/** 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 + */ + /** + * Sample code: RelayHybridConnectionCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .define("example-Relay-Hybrid-01") + .withExistingNamespace("resourcegroup", "example-RelayNamespace-01") + .withRequiresClientAuthorization(true) + .create(); + } +} 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 new file mode 100644 index 000000000000..5bcf63655c03 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteAuthorizationRuleSamples.java @@ -0,0 +1,30 @@ +// 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 HybridConnections DeleteAuthorizationRule. */ +public final class HybridConnectionsDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/RelayHybridConnectionAutorizationRuleDelete.json + */ + /** + * Sample code: RelayHybridConnectionAutorizationRuleDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAutorizationRuleDelete( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .deleteAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteSamples.java new file mode 100644 index 000000000000..4a5a80d7e308 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsDeleteSamples.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 HybridConnections Delete. */ +public final class HybridConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/RelayHybridconnectionDelete.json + */ + /** + * Sample code: RelayHybridconnectionDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridconnectionDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .deleteWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..f805f9a97409 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetAuthorizationRuleSamples.java @@ -0,0 +1,29 @@ +// 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 HybridConnections GetAuthorizationRule. */ +public final class HybridConnectionsGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/RelayHybridConnectionAutorizationRuleGet.json + */ + /** + * Sample code: RelayHybridConnectionAutorizationRuleGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .getAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetSamples.java new file mode 100644 index 000000000000..1672059a9dc9 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsGetSamples.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 HybridConnections Get. */ +public final class HybridConnectionsGetSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/RelayHybridConnectionGet.json + */ + /** + * Sample code: RelayHybridConnectionGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .getWithResponse("resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..1b7e7700e3f3 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListAuthorizationRulesSamples.java @@ -0,0 +1,26 @@ +// 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 HybridConnections ListAuthorizationRules. */ +public final class HybridConnectionsListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/RelayHybridConnectionAutorizationRuleListAll.json + */ + /** + * Sample code: RelayHybridConnectionAutorizationRuleListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAutorizationRuleListAll( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .listAuthorizationRules( + "resourcegroup", "example-RelayNamespace-01", "example-Relay-Hybrid-01", Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListByNamespaceSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListByNamespaceSamples.java new file mode 100644 index 000000000000..d536e32291b9 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListByNamespaceSamples.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 HybridConnections ListByNamespace. */ +public final class HybridConnectionsListByNamespaceSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/RelayHybridConnectionListAll.json + */ + /** + * Sample code: RelayHybridConnectionListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionListAll(com.azure.resourcemanager.relay.RelayManager manager) { + manager.hybridConnections().listByNamespace("resourcegroup", "example-RelayNamespace-01", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..d6eb510ef184 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsListKeysSamples.java @@ -0,0 +1,30 @@ +// 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 HybridConnections ListKeys. */ +public final class HybridConnectionsListKeysSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/HybridConnection/RelayHybridConnectionAuthorizationRuleListKey.json + */ + /** + * Sample code: RelayHybridConnectionAuthorizationRuleListKey. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAuthorizationRuleListKey( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .listKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..d1f5de8545ff --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/HybridConnectionsRegenerateKeysSamples.java @@ -0,0 +1,33 @@ +// 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.models.KeyType; +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 + */ + /** + * Sample code: RelayHybridConnectionAuthorizationRuleRegenrateKey. + * + * @param manager Entry point to RelayManager. + */ + public static void relayHybridConnectionAuthorizationRuleRegenrateKey( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .hybridConnections() + .regenerateKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-Hybrid-01", + "example-RelayAuthRules-01", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..2e9c7eb14661 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCheckNameAvailabilitySamples.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; +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 + */ + /** + * Sample code: RelayCheckNameAvailability. + * + * @param manager Entry point to RelayManager. + */ + public static void relayCheckNameAvailability(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse(new CheckNameAvailability().withName("sdk-Namespace1321"), 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 new file mode 100644 index 000000000000..9d7c3a1db503 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java @@ -0,0 +1,28 @@ +// 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.AccessRights; +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 + */ + /** + * Sample code: RelayNameSpaceAuthorizationRuleCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAuthorizationRuleCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .defineAuthorizationRule("example-RelayAuthRules-01") + .withExistingNamespace("resourcegroup", "example-RelayNamespace-01") + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)) + .create(); + } +} 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 new file mode 100644 index 000000000000..53ecaf6e498e --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesCreateOrUpdateSamples.java @@ -0,0 +1,43 @@ +// 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.Sku; +import com.azure.resourcemanager.relay.models.SkuTier; +import java.util.HashMap; +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 + */ + /** + * Sample code: RelayNamespaceCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNamespaceCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .define("example-RelayNamespace-01") + .withRegion("West US") + .withExistingResourceGroup("resourcegroup") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withSku(new Sku().withTier(SkuTier.STANDARD)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..4213a2245b9e --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteAuthorizationRuleSamples.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 Namespaces DeleteAuthorizationRule. */ +public final class NamespacesDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceAutorizationRuleDelete.json + */ + /** + * Sample code: RelayNameSpaceAutorizationRuleDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .deleteAuthorizationRuleWithResponse( + "resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteSamples.java new file mode 100644 index 000000000000..5bee20aebd38 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesDeleteSamples.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 Namespaces Delete. */ +public final class NamespacesDeleteSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceDelete.json + */ + /** + * Sample code: RelayNameSpaceDelete. + * + * @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); + } +} 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 new file mode 100644 index 000000000000..ed29752b8ca3 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetAuthorizationRuleSamples.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 Namespaces GetAuthorizationRule. */ +public final class NamespacesGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceAutorizationRuleGet.json + */ + /** + * Sample code: RelayNameSpaceAutorizationRuleGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .getAuthorizationRuleWithResponse( + "resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..3c874a16cd31 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesGetByResourceGroupSamples.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 Namespaces GetByResourceGroup. */ +public final class NamespacesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceGet.json + */ + /** + * Sample code: RelayNameSpaceGet. + * + * @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); + } +} 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 new file mode 100644 index 000000000000..4359c0a098eb --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListAuthorizationRulesSamples.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 Namespaces ListAuthorizationRules. */ +public final class NamespacesListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceAutorizationRuleListAll.json + */ + /** + * Sample code: RelayNameSpaceAutorizationRuleListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAutorizationRuleListAll(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 new file mode 100644 index 000000000000..05700c73595d --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListByResourceGroupSamples.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 Namespaces ListByResourceGroup. */ +public final class NamespacesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceListByResourceGroup.json + */ + /** + * Sample code: RelayNameSpaceListByResourceGroup. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceListByResourceGroup(com.azure.resourcemanager.relay.RelayManager manager) { + manager.namespaces().listByResourceGroup("resourcegroup", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..90cae25758f1 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListKeysSamples.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 Namespaces ListKeys. */ +public final class NamespacesListKeysSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceAuthorizationRuleListKey.json + */ + /** + * Sample code: RelayNameSpaceAuthorizationRuleListKey. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAuthorizationRuleListKey(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .listKeysWithResponse( + "resourcegroup", "example-RelayNamespace-01", "example-RelayAuthRules-01", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..fc99db6120ee --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesListSamples.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 Namespaces List. */ +public final class NamespacesListSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/NameSpaces/RelayNameSpaceListBySubscription.json + */ + /** + * Sample code: RelayNameSpaceListBySubscription. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceListBySubscription(com.azure.resourcemanager.relay.RelayManager manager) { + manager.namespaces().list(Context.NONE); + } +} 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 new file mode 100644 index 000000000000..80757d77812c --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesRegenerateKeysSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.models.KeyType; +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 + */ + /** + * Sample code: RelayNameSpaceAuthorizationRuleRegenrateKey. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceAuthorizationRuleRegenrateKey( + com.azure.resourcemanager.relay.RelayManager manager) { + manager + .namespaces() + .regenerateKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-RelayAuthRules-01", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesUpdateSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesUpdateSamples.java new file mode 100644 index 000000000000..c0ba5f9ae069 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/NamespacesUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.models.RelayNamespace; +import java.util.HashMap; +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 + */ + /** + * Sample code: RelayNameSpaceUpdate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayNameSpaceUpdate(com.azure.resourcemanager.relay.RelayManager manager) { + RelayNamespace resource = + manager + .namespaces() + .getByResourceGroupWithResponse("resourcegroup", "example-RelayNamespace-01", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("tag3", "value3", "tag4", "value4", "tag5", "value5", "tag6", "value6")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..c3a75164cca9 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/OperationsListSamples.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 Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/RelayOperations_List.json + */ + /** + * Sample code: RelayOperationsList. + * + * @param manager Entry point to RelayManager. + */ + public static void relayOperationsList(com.azure.resourcemanager.relay.RelayManager manager) { + manager.operations().list(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 new file mode 100644 index 000000000000..0155a861195e --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateAuthorizationRuleSamples.java @@ -0,0 +1,33 @@ +// 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.AuthorizationRuleInner; +import com.azure.resourcemanager.relay.models.AccessRights; +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 + */ + /** + * Sample code: RelayAuthorizationRuleCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAuthorizationRuleCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .createOrUpdateAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..527db815eb62 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// 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.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 + */ + /** + * Sample code: RelayCreate. + * + * @param manager Entry point to RelayManager. + */ + public static void relayCreate(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .define("example-Relay-Wcf-1194") + .withExistingNamespace("resourcegroup", "example-RelayNamespace-9953") + .withRelayType(Relaytype.NET_TCP) + .withRequiresClientAuthorization(true) + .withRequiresTransportSecurity(true) + .create(); + } +} 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 new file mode 100644 index 000000000000..fc85fb7971ac --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteAuthorizationRuleSamples.java @@ -0,0 +1,29 @@ +// 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 WcfRelays DeleteAuthorizationRule. */ +public final class WcfRelaysDeleteAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayAutorizationRuleDelete.json + */ + /** + * Sample code: RelayAutorizationRuleDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAutorizationRuleDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .deleteAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteSamples.java new file mode 100644 index 000000000000..fd01219e3ca8 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysDeleteSamples.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 WcfRelays Delete. */ +public final class WcfRelaysDeleteSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayDelete.json + */ + /** + * Sample code: RelayDelete. + * + * @param manager Entry point to RelayManager. + */ + public static void relayDelete(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .deleteWithResponse("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/WcfRelaysGetAuthorizationRuleSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleSamples.java new file mode 100644 index 000000000000..9c7c2c0f3f8e --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetAuthorizationRuleSamples.java @@ -0,0 +1,29 @@ +// 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 WcfRelays GetAuthorizationRule. */ +public final class WcfRelaysGetAuthorizationRuleSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayAutorizationRuleGet.json + */ + /** + * Sample code: RelayAutorizationRuleGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAutorizationRuleGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .getAuthorizationRuleWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} diff --git a/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetSamples.java b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetSamples.java new file mode 100644 index 000000000000..64f2ed2e206e --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysGetSamples.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 WcfRelays Get. */ +public final class WcfRelaysGetSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayGet.json + */ + /** + * Sample code: RelayGet. + * + * @param manager Entry point to RelayManager. + */ + public static void relayGet(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .getWithResponse("resourcegroup", "example-RelayNamespace-9953", "example-Relay-Wcf-1194", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..19737f343e46 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListAuthorizationRulesSamples.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 WcfRelays ListAuthorizationRules. */ +public final class WcfRelaysListAuthorizationRulesSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayAutorizationRuleListAll.json + */ + /** + * Sample code: RelayAutorizationRuleListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAutorizationRuleListAll(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 new file mode 100644 index 000000000000..bd0e7703b549 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListByNamespaceSamples.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 WcfRelays ListByNamespace. */ +public final class WcfRelaysListByNamespaceSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayListAll.json + */ + /** + * Sample code: RelayListAll. + * + * @param manager Entry point to RelayManager. + */ + public static void relayListAll(com.azure.resourcemanager.relay.RelayManager manager) { + manager.wcfRelays().listByNamespace("resourcegroup", "example-RelayNamespace-01", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..fe398c1eeb13 --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysListKeysSamples.java @@ -0,0 +1,29 @@ +// 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 WcfRelays ListKeys. */ +public final class WcfRelaysListKeysSamples { + /* + * x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2017-04-01/examples/Relay/RelayAuthorizationRuleListKey.json + */ + /** + * Sample code: RelayAuthorizationRuleListKey.json. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAuthorizationRuleListKeyJson(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .listKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + Context.NONE); + } +} 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 new file mode 100644 index 000000000000..a4d4a362e9ac --- /dev/null +++ b/sdk/relay/azure-resourcemanager-relay/src/samples/java/com/azure/resourcemanager/relay/generated/WcfRelaysRegenerateKeysSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.relay.models.KeyType; +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 + */ + /** + * Sample code: RelayAuthorizationRuleRegenrateKey.json. + * + * @param manager Entry point to RelayManager. + */ + public static void relayAuthorizationRuleRegenrateKeyJson(com.azure.resourcemanager.relay.RelayManager manager) { + manager + .wcfRelays() + .regenerateKeysWithResponse( + "resourcegroup", + "example-RelayNamespace-01", + "example-Relay-wcf-01", + "example-RelayAuthRules-01", + new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY), + Context.NONE); + } +}